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

From: Christian Montel <christian.montel_at_eligo.de>
Date: Thu 23 Feb 2006 - 20:29:05 EST

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@eligo.de
http://www.eligo.de/

______________________________________________
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:38:49 2006

This archive was generated by hypermail 2.1.8 : Thu 23 Feb 2006 - 21:08:45 EST