[R] Writing specific columns to a data file

Coen van Hasselt coenvanhasselt at gmail.com
Tue Apr 7 04:41:36 CEST 2009


By only selecting the first column, i.e. write.table(data[,1], file="", .....) ?


On Tue, Apr 7, 2009 at 12:28, Brendan Morse <morse.brendan at gmail.com> wrote:
> Hi, I have a function that generates some output with 2 columns, but I
> only want to write the first column to a file. Is there a way to do
> this in the write.table command?
>
> thetaout=write.table(estimatedtheta, file="/Users/morse07/Desktop/R/
> Trial/score.dat", row.names=F, col.names=F)
>
> Any advice would be great, thanks!
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>




More information about the R-help mailing list