Thanks for the advice,
df-read.table(infile, sep=, skip = 1, header=TRUE)
is indeed much cleaner from the outset (and was my usual way to it).
I was unaware that
readLines(infile, n=1)
could get me the first line without reading the whole file again.
But I do need to get my head around
Dear users,
I am importing a csv file whose first row is a single value that I need to
capture in a variable.
infile-file.choose()
in-read.csv( infile, header=FALSE)
single.value-as.character(in[1,1]) # fine
Now I need to take rows 3 and on as the data
df-in[3:dim(in)[1],]
But row 2
On Feb 1, 2012, at 10:21 PM, jjap wrote:
Dear users,
I am importing a csv file whose first row is a single value that I
need to
capture in a variable.
infile-file.choose()
in-read.csv( infile, header=FALSE)
single.value-as.character(in[1,1]) # fine
Now I need to take rows 3 and on as
3 matches
Mail list logo