Skip to content

Writing specific columns to a data file

3 messages · Brendan Morse, Coen van Hasselt, Peter Dalgaard

#
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:
#
Coen van Hasselt wrote:
Notice that this drops to a vector, losing the variable name.

Brendan may need data[,1, drop=FALSE], and/or give row.names=FALSE to 
write.table, depending on what the real problem was.