I have a data frame with 900,000 rows and 11 columns in R. The column names and types are as follows:
column name: date / mcode / mname / ycode / yname / yissue / bsent / breturn / tsent / treturn / csales type: Date / Char / Char / Char / Char / Numeric / Numeric / Numeric / Numeric / Numeric / Numeric I want to sort the data by those variables in the following order:
- date
- mcode
- ycode
- yissue
The order of levels are important here, i.e. they should be sorted by date first, and if there are identical dates, they should be sorted by mcode, so and so forth. How can I do that in R?
help(sort)answers your question.