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?

有帮助吗?

解决方案

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="##")
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top