On Wed, Apr 9, 2008 at 7:37 PM, Ravi Varadhan [EMAIL PROTECTED] wrote:
I have a data file, certain lines of which are character fields. I would
like to skip these rows, and read the data file as a numeric data frame. I
know that I can skip lines at the beginning with read.table and scan,
Hi Ravi,
One thing I tend to do is, when using read.table, specify the option
'colClasses='character''. This forces everything to be read as a
character. From there, as.numeric works fine, and you don't have to deal
with factors and reconverting them.
Hope this helps
Abhijit
Ravi Varadhan
Hi,
I have a data file, certain lines of which are character fields. I would
like to skip these rows, and read the data file as a numeric data frame. I
know that I can skip lines at the beginning with read.table and scan, but is
there a way to skip a specified sequence of lines (e.g., 1, 2,
Read the file in as lines of text (readLines), 'grep' through the
character vector and delete the lines you want and then use:
read.table(textConntection(yourvector))
to read the corrected data in.
On 4/9/08, Ravi Varadhan [EMAIL PROTECTED] wrote:
Hi,
I have a data file, certain lines of
On Wed, 9 Apr 2008, Ravi Varadhan wrote:
Hi,
I have a data file, certain lines of which are character fields. I would
like to skip these rows, and read the data file as a numeric data frame. I
know that I can skip lines at the beginning with read.table and scan, but is
there a way to
5 matches
Mail list logo