Skip to content
Back to formatted view

Raw Message

Message-ID: <43FD7B1D.2000602@uwinst.unizh.ch>
Date: 2006-02-23T09:06:37Z
From: Stefanie von Felten, IPW&IfU
Subject: 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