Is it possible to sort/order by a specific column using the write.csv() function?

Viewed 1357

Is it possible to dynamically sort my data by a specific column on-the-fly, during the export (write.csv()) function itself?

I export my data thus:

write.csv(level_names, "level_names.csv")

But want to know if it possible to achieve something like this:

write.csv(level_names, "level_names.csv", order(dataset$longname))

I know this doesn't work - this is merely for illustration purposes.

Is something to this effect possible?

1 Answers
Related