Message-ID: <OF579A56C9.42BCF5B7-ONC1257816.0055897F-C1257816.0055CB20@precheza.cz>
Date: 2011-01-12T15:36:25Z
From: PIKAL Petr
Subject: Odp: Outputting csv file from dataframe with columns in a particular order
In-Reply-To: <28017440-a62c-402f-a1c9-406fd4cc3d8b@i17g2000vbq.googlegroups.com>
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.