A Comment is a Comment.

code
beginner
r
tips
Author

Daniel Kick

Published

May 23, 2023

R treats “#” as a comment in text files.

If you have a file with this in a a header field (e.g. for biologists “# chromosomes”) R will fail to load the file. The solution is to pass in an explicit comment character like so read.table(“table_file.txt”, comment.char=‘’).