Chua Siang Li wrote:
Hi. May I know why the colnames is NULL when reading only 1 column from a
csv file?
You are not "reading only 1 column from a csv file", you are subsetting
one column of a data.frame. See ?Extract and the "drop" argument
specifically.
How do I get the colnam
Hi. May I know why the colnames is NULL when reading only 1 column from a
csv file? How do I get the colname then? Thanks.
> xy = read.table("dataFile.csv",header=T, sep=",")
> y <- xy[,1]
> xDate <- xy[,2]
> x <- xy[,3:8]
> colnames(y)
NULL
> colnames(xDate)
NULL
2 matches
Mail list logo