Question: row t test with biocLite(genefilter)

0

sebastien200109 •

**0**wrote:I'm trying to run a t test on 2 groups of samples for a list of variables. My dataset (=df) looks like this:

GeneName group1 group1 group1 group2 group2 group2

gene1

gene2

gene3

...

I want to obtain p value for t test comparing for each row (gene) the values of group1 vs group2.

I tried to use the rowttests() function of genefilter package for bioconductor as such:

df$ttest <- rowttests(df, factor(c(group1, group2)))

I'm getting the following error:

Error in (function (classes, fdef, mtable) :

unable to find an inherited method for function ‘rowttests’ for signature ‘"data.frame", "factor"’

What am I doing wrong?

Thanks

gives the following error:

27k• written 4.9 years ago by sebastien200109 •0So throw an

`as.double()`

in there.95kCould you be more specific? (I'm beginner in R)

0This is going to get messy, but the general idea is:

Or something along those lines. BTW, don't worry about the

`unlist()`

part, it just converts your`data.frame`

into a vector (data.frames are actually a special kind of list in R).27k• written 4.9 years ago by Devon Ryan ♦95k