Question

Possible Duplicate:
cannt read file with “#” and space using read.table or read.csv in R

I have the problem with R that when I'm reading in (using read.table function) delimited files (e.g. tab-delimited text files) with R, the rows containing # or ' characters are silently dropped. how the file should be read in so that the rows containing these characters aren't dropped?

Was it helpful?

Solution

The default comment.char is the # character. You can change this using the comment.char argument, i.e.

read.table(file, comment.char="@")
read.table(file, comment.char="##")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top