Odp: Outputting csv file from dataframe with columns in a particular order
Hi r-help-bounces at r-project.org napsal dne 12.01.2011 16:16:16:
I have a dataframe with columns "ID",'date","estimate","actual" (but not necessarily in that order - I do a merge somewhere and that somehow messes up the order of the columns).
If you have datafreme with column order a, b, c, d and you want b, c, d, a
just order columns accordingly
write.table(df[,c("b", "c", "d", "s")], ....)
Regards
Petr
How can I output it to a csv file with the columns in the order that I want? Thanks.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.