Skip to content
Prev 87082 / 398506 Next

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