Probably not.
R is doing a lot of things behind the hood. Sometimes it is good,
sometimes it is bad.
The code snippet given to you has a quadratic time-complexity ( O(nm) ).
It can be make linearithmic ( O(n log(m) ) ) simply:
from rpy2.robjects.vector import BoolVector
ref = set(differential)
select_b = BoolVector(tuple(x in ref for x in source.rx2('gene')))
mysubset = source.rx(select_b, True)
On 2011-09-12 12:15, Luca Beltrame wrote:
In data lunedì 12 settembre 2011 11:45:32, Luca Beltrame ha scritto:
I forgot to add that I had to change the code to use list comprehensions
instead of generators, because otherwise I'd get a ValueError with "The
object does not have a length." (on rpy 2.2.x).
Some follow ups on this issue. Unlike %in%, the approach posted is extremely
slow with large dataframes (the one I'm using has 1939461 rows).
I ended up putting the objects in the global environment and called R from
there for the time being.
Should I file a bug report?
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list