[R] question...
arun
smartpink111 at yahoo.com
Fri Jul 19 14:44:30 CEST 2013
Hi,
dat<-read.table(text="
1 0 1 1 1 1
0 0 1 0 0 1
1 0 0 0 0 0
2 1 1 2 1 1
",sep="",header=FALSE)
which(sapply(seq_len(nrow(dat)),function(i) wilcox.test(unlist(dat[i,]))$p.value)>0.05) #there will be warnings() though
#[1] 2 3
table(sapply(seq_len(nrow(dat)),function(i) wilcox.test(unlist(dat[i,]))$p.value)>0.05)
#FALSE TRUE
# 2 2
Regarding the warnings(), please check:
http://r.789695.n4.nabble.com/What-are-ties-Wilcox-u-test-td857059.html
A.K.
I have some data like this...
1 1 0 1 1 1 1
2 0 0 1 0 0 1
3 1 0 0 0 0 0
4 2 1 1 2 1 1
and I have a expression
lapply(Wilcox.test, function(testNew)
apply(Specc[,-c(1:3)],1,function(x) get(testNew)(x)$p.value)) that gives
me a p-values for each row.
I need to count how many p-values are more than 0.05.
How can I do this? I have always different errors...
Thank you
More information about the R-help
mailing list