[R] data file with columns of unequal length

William Simpson william.a.simpson at gmail.com
Fri Oct 23 13:05:09 CEST 2009


> As I understand it, they don't come in pairs anyway.
Correct.

> For the same reason
> a data frame is just the wrong kind of data structure. If you don't want
> separate data files, you can use one file with two columns where the
> second column is (say) 1 for the x and 2 for the y.
Could you explain this further? I don't really get it.
My xs and ys have different lengths. How would I read them in?

Ideally I would just read in the x column and y columns separately

x<-read.file("file.dat", column1)
y<-read.file("file.dat", column2)
But I know of no way to do that...

[Oh, by the way, I never mentioned this, the x and ys are event times
and are in ascending order (by time of occurrence).]

> (There are other options, like concatenating the x and the y with some
> sort of separator inbetween, but it easily gets painful to read them
> back in.)
>

Thanks
Bill




More information about the R-help mailing list