[R] Questions for manipulating datasets in R e.g. sorting and matching

From: Stefanie von Felten, IPW&IfU <sfelten_at_uwinst.unizh.ch>
Date: Thu 23 Feb 2006 - 20:06:37 EST


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@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@uwinst.unizh.ch
http://www.unizh.ch/uwinst/homepages/steffi.html

______________________________________________
R-help@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
Received on Thu Feb 23 20:15:54 2006

This archive was generated by hypermail 2.1.8 : Fri 10 Mar 2006 - 06:09:05 EST