On 2011-09-12 21:16, Artur Wroblewski wrote:
> On Mon, Sep 12, 2011 at 12:26 PM, Laurent Gautier wrote:
>> 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
>>
On Mon, Sep 12, 2011 at 12:26 PM, Laurent Gautier wrote:
> 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:
>
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
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
In data lunedì 12 settembre 2011 11:07:42, Luca Beltrame ha scritto:
> Thanks Laurent, that did it.
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).
--
In data lunedì 12 settembre 2011 10:55:33, Laurent Gautier ha scritto:
> from rpy2.robjects.vector import BoolVector
> select_b = BoolVector(x in differential for x in source.rx2('gene'))
> mysubset = source.rx(select_b, True)
Thanks Laurent, that did it.
--
Luca Beltrame, Ph.D. - Translational G
from rpy2.robjects.vector import BoolVector
select_b = BoolVector(x in differential for x in source.rx2('gene'))
mysubset = source.rx(select_b, True)
On 2011-09-12 10:33, Luca Beltrame wrote:
Hello,
in R I'm using something like this expression:
mysubset<- source[source$gene %in% differentia
Hello,
in R I'm using something like this expression:
mysubset <- source[source$gene %in% differential, ]
where "differential" is a vector and "source" a dataframe.
How can I replicate the use of %in% in rpy2?
Thanks.
--
Luca Beltrame, Ph.D. - Translational Genomics Unit
Oncology Department,