Thanks to all who responded.

On Jan 12, 10:34 am, Peter Ehlers <ehl...@ucalgary.ca> wrote:
> On 2011-01-12 07:16, analys...@hotmail.com wrote:
>
> > 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).
>
> > How can I output it to a csv file with the columns in the order that I
> > want?
>
> Let's say that your data.frame is DF.
> mynames <- c("ID", "date", "estimate", "actual")
> write.csv(DF[, mynames], ....)
>
> Peter Ehlers
>
> ______________________________________________
> r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@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.

Reply via email to