[R] how to read just a column

mel mel at altk.com
Thu Aug 31 07:48:57 CEST 2006


Carlo Trimarchi a écrit :

> Hi,
> how can I read, using for example read.table() or scan(), just one
> column from a text file that has more columns without any header?
> Thanks, bye.

afaik, you have to read all the table
and then you select the column you want.
eg read.table(blabla)[3] to get the 3rd column.

You can read partially rows (see nrows) but not columns.
Please somebody correct me if I am wrong.

(Of course a trick could be to transpose your table
before writing it, etc)

hih



More information about the R-help mailing list