RockefellerUniversity / Intro_To_R_1Day

Introduction to R training course
https://rockefelleruniversity.github.io/Intro_To_R_1Day/
3 stars 2 forks source link

Question about comment.char #23

Open imarin79 opened 4 years ago

imarin79 commented 4 years ago

Hi all,

I hope everybody is doing well. I am writing because I have a question about the comment.char function. On the Reading and Writing exercises, one of the answers included the following "comment.char=">" . I have been trying to understand the meaning of ">" and other potential options like "#" or "<". My guess is that ">" eliminates any comments on the original text, so only the table elements are displayed in R. Let me know if this is correct.

Many thanks

Isaac

ThomasCarroll commented 4 years ago

Comment.char is an argument in read.table/read.delim set of functions for reading in tabular data.

The comment.char (comment character) argument tells the read.delim family of functions to skip any lines starting with that character (by default this character is #).

This is useful if we have an annotated file with additional information which we do not want to read this into R but want to maintain in file. An example is MACS peak calls which contain line with the program information and parameters commented with "#" and a table underneath.

The comment.char can be any character and in this example was a ">".

imarin79 commented 4 years ago

Thanks Tom!