Re: [R] reading in vectors from text files

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Mon 21 Mar 2005 - 18:29:33 EST

Rashmi Mathur wrote:

> Hello,
>
> I am trying to read in a file of data using read.table(), in which the
> data in one column is vectors.
>
> The format of the file is as follows -
>
>
> FirstName LastName no.Children children.ages
> Sally James 3 c(3,5,7)
> John Smith 2 c(13,16)
> Betsy Harold 6 c(2,5,8,12,15,17)
>
>
> How do I specify that the children.ages column contains vector data, and
> that each vector is of a different length when reading in this text
> file?

You might want to read the column as character, parse it afterwards, and convert your data structure into a list which seems more appropriate to represent the data.

Uwe Ligges

> Thanks in advance,
> Rashmi
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Mar 21 18:35:35 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:51 EST