Skip to content
Prev 294971 / 398506 Next

Sort across multiple csv

On May 18, 2012, at 12:56 PM, Matthew Ouellette wrote:

            
You should learn to use precise terminology to refer to R objects. You  
have a list of dataframes (not matrices)

You can loop over then and return a list of transformed (.e.g. sorted)  
dataframes:

alldata <- lapply (alldata, function(x) x[order(x[["Name"]], ] )
The above code would overwrite.
If you didn't want it overwritten then assign it to a different name.
Much better to stick with lists.
`lapply` is really a loop.
David Winsemius, MD
West Hartford, CT