Stefanie von Felten, IPW&IfU
2006-Feb-23 09:06 UTC
[R] Questions for manipulating datasets in R e.g. sorting and matching
Hello everyone, I want to sort a dataset in R, using multiple columns as sorting criteria. I know I can sort a dataset "Data" with 14 columns using one column (the fifth), by typing: DataSort<-Data[order(Data[,5]),1:14] But how can the dataset be sorted by column 5, then by 6, then by 8? Another question is, how two datasets can be matched by a column present in both of them? Steffi -- --------------------------------- Stefanie von Felten Doktorandin ETH Z??rich Institut f??r Pflanzenwissenschaften ETH Zentrum, LFW A 2 Telefon: 044 632 85 97 Telefax: 044 632 11 53 e-mail: stefanie.vonfelten at ipw.agrl.ethz.ch http://www.ipw.agrl.ethz.ch/~svfelten/ und: Universit??t Z??rich Institut f??r Umweltwissenschaften Winterthurerstrasse 190 8057 Z??rich Telefon: 044 635 61 23 Telefax: 044 635 57 11 e-mail: sfelten at uwinst.unizh.ch http://www.unizh.ch/uwinst/homepages/steffi.html
Dimitris Rizopoulos
2006-Feb-23 09:17 UTC
[R] Questions for manipulating datasets in R e.g. sorting andmatching
regarding your 1st question you can still use order(), i.e., order(Data[,5], Data[,6], Data[,8]); regarding you 2nd question look at ?merge. I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Stefanie von Felten, IPW&IfU" <sfelten at uwinst.unizh.ch> To: <r-help at stat.math.ethz.ch> Sent: Thursday, February 23, 2006 10:06 AM Subject: [R] Questions for manipulating datasets in R e.g. sorting andmatching Hello everyone, I want to sort a dataset in R, using multiple columns as sorting criteria. I know I can sort a dataset "Data" with 14 columns using one column (the fifth), by typing: DataSort<-Data[order(Data[,5]),1:14] But how can the dataset be sorted by column 5, then by 6, then by 8? Another question is, how two datasets can be matched by a column present in both of them? Steffi -- --------------------------------- Stefanie von Felten Doktorandin ETH Z??rich Institut f??r Pflanzenwissenschaften ETH Zentrum, LFW A 2 Telefon: 044 632 85 97 Telefax: 044 632 11 53 e-mail: stefanie.vonfelten at ipw.agrl.ethz.ch http://www.ipw.agrl.ethz.ch/~svfelten/ und: Universit??t Z??rich Institut f??r Umweltwissenschaften Winterthurerstrasse 190 8057 Z??rich Telefon: 044 635 61 23 Telefax: 044 635 57 11 e-mail: sfelten at uwinst.unizh.ch http://www.unizh.ch/uwinst/homepages/steffi.html ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
Christian Montel
2006-Feb-23 09:29 UTC
[R] Questions for manipulating datasets in R e.g. sorting and matching
hi steffi, try DataSort<-Data[order(Data[,5],Data[,6],Data[,8]),1:14] and for further details ?order. For matching try ?merge. Best Regards, Christian Stefanie von Felten, IPW&IfU schrieb:> Hello everyone, > > I want to sort a dataset in R, using multiple columns as sorting > criteria. I know I can sort a dataset "Data" with 14 columns using one > column (the fifth), by typing: > > DataSort<-Data[order(Data[,5]),1:14] > > But how can the dataset be sorted by column 5, then by 6, then by 8? > > Another question is, how two datasets can be matched by a column present > in both of them? > > Steffi-- Dr. Christian Montel Eligo GmbH - B??ro Berlin Friedrichstr. 90 10 117 Berlin Fon (030) -- 20 25 31 94 Fax (030) -- 20 25 33 33 e-mail: christian.montel at eligo.de http://www.eligo.de/
Hi, I am very confused about those note that I found in this web page about TYPE III SS in ANOVA. In my mind Type III is not useful when there are interaction. Can someone help me ? web site : http://www.xlstat.com/fr/support/tutorials/ano2.htm