Question: wilcoxon signed rank test for data frame
0
gravatar for Smeeta Shrestha
3.8 years ago by
Smeeta Shrestha20 wrote:

 


Hi !

Could anyone let me know as how I can do a wilcoxon signed rank test for data frames. I saw some people have attempted to explain at the stack flow. 

link : http://stackoverflow.com/questions/21271449/how-to-apply-the-wilcox-test-to-a-whole-dataframe-in-r

I have a huge data frame of 360,000 probes and 24 subjects.

I am trying to use this script 


out <- lapply(df, function(x) pairwise.wilcox.test(d[[x]], d$group))

names(out) <- names(d)
out


I keep getting the error 

> out <- lapply(df, function(x) pairwise.wilcox.test(d[[x]], d$group))

Error in .subset2(x, i, exact = exact) : 
  recursive indexing failed at level 2

Any help would be really great

 

Thank you

smeeta

 

My df is 360k x 24 

 

 

 

ADD COMMENTlink written 3.8 years ago by Smeeta Shrestha20

You'll probably want to use apply() rather than lapply.  lapply on a data.frame works on the columns.  Instead, apply() can work on either rows or columns.  

ADD REPLYlink written 3.8 years ago by Sean Davis21k

Thank you 

ADD REPLYlink written 3.8 years ago by Smeeta Shrestha20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 203 users visited in the last hour