Re: [R] Stuck with levels while reassigning dataframe colnames?

2012-02-02 Thread jjap
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

[R] Stuck with levels while reassigning dataframe colnames?

2012-02-01 Thread jjap
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

Re: [R] Stuck with levels while reassigning dataframe colnames?

2012-02-01 Thread David Winsemius
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