An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050912/ef55d634/attachment.pl
Covert list of list to dataframe for export or outputting by(test) output
4 messages · Mike Bock, Peter Dalgaard, Chris Buddenhagen +1 more
"Mike Bock" <mbock at Environcorp.com> writes:
Greetings, I am running a buch of wilcox tests and need to be able to rapidly export the results into a csv file. I have attached example code as well as my attempts to get what I need. I have tried unlist,cbind,rbind etc but I am obvously missing something simple. FYI I am actually running about 50 WRS tests per dataset, this is just an example.
....
WRS <- by(AKCCR, AKCCR$Compound.Name, function(AKCCR) wilcox.test(AdjRes ~ ExposureUnit, data = AKCCR)) #just one of many attempts to get the output into a form I can write to a file and import into excel WRSlist <- cbind(WRS) WRSFinal <- data.frame(WRSlist)
How about do.call("rbind", WRS) instead? (Or just the first and
hird column of it.)
A fine point: This gives a character matrix. If the function inside
by() returned a data frame, then rbind()'ing would give one too, but
one component of the return value of wilcox.test is NULL, so you need
WRS <- by(AKCCR, AKCCR$Compound.Name, function(AKCCR)
+ as.data.frame(wilcox.test(AdjRes~ ExposureUnit, data = AKCCR)[-2])) Warning messages: 1: cannot compute exact p-value with ties in: wilcox.test.default(x = c(0.03, 0.24, 0.0082, 0.29, 0.01, 0.19, 2: cannot compute exact p-value with ties in: wilcox.test.default(x = c(0.15, 0.09, 0.16, 0.08, 0.15, 0.17,
class(do.call("rbind", WRS))
[1] "data.frame"
O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Chris Buddenhagen, Botany Department, Charles Darwin Research Station, Santa Cruz,Galapagos. Mail: Charles Darwin Foundation, Casilla 17-01-3891 Avenida 6 de Diciembre N36-109 y Pasaje California Quito, ECUADOR Dear R experts Is there a simple means of doing this multiple comparison test in R? I did a search and found information about it at http://finzi.psych.upenn.edu/R/Rhelp02a/archive/44566.html but it did not include information about doing it in R. Chris Buddenhagen, Botany Department, Charles Darwin Research Station, Santa Cruz,Galapagos. Mail: Charles Darwin Foundation, Casilla 17-01-3891 Avenida 6 de Diciembre N36-109 y Pasaje California Quito, ECUADOR ______________________________________________________________________ EL CONTENIDO DE ESTE MENSAJE ES DE ABSOLUTA RESPONSABILIDAD DEL AUTOR. FUNDACION CHARLES DARWIN WWW.DARWINFOUNDATION.ORG
On Mon, 12 Sep 2005, Chris Buddenhagen wrote:
Is there a simple means of doing this multiple comparison test in R?
p.adjust() -thomas