Skip to content
Back to formatted view

Raw Message

Message-ID: <BAY103-F37416C2A91D44CF4145E42A6270@phx.gbl>
Date: 2005-05-02T22:56:32Z
From: Francisco J. Zagmutt
Subject: Reading in a dataset with uneven variable lengths
In-Reply-To: <39B6DDB9048D0F4DAD42CB26AAFF0AFA076EB4@usctmx1106.merck.com>

Is it OK to have NA's? If so you can use read.table(,fill=TRUE) or 
read.delim().  Notice that the default in the second option is fill=TRUE.

Cheers

Francisco

>From: "Liaw, Andy" <andy_liaw at merck.com>
>To: "'Owen, Jason'" <wowen at richmond.edu>, r-help at stat.math.ethz.ch
>Subject: RE: [R] Reading in a dataset with uneven variable lengths
>Date: Mon, 2 May 2005 16:24:29 -0400
>
>One possibility is to use read.fwf().
>
>Andy
>
> > From: Owen, Jason
> >
> > Suppose I have a text file that I want to read into R like the
> > following:
> >
> > X	Y
> > 649	699
> > 657	891
> > 714	632
> > 849	727
> > 721	597
> > 791	868
> > 874	652
> > 405	978
> > 	733
> > 	549
> > 	790
> >
> > This is a simple example -- I could have a huge file with many
> > columns of unequal lengths.
> >
> > What is the best way to do it?  I can't see how a data frame
> > can be used.  I checked the FAQ and did a web search on the topic
> > but I came up empty.
> >
> > Jason
> >
> > ______________________________________________
> > R-help at 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 at 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