Add comments on your R objects

It is always good to add comments on your R code. But it is also good to add comments on your objects like variables, functions, etc.

> Mydata comment(Mydata) <- "This is a data from a sequence" > Mydata
 [1] 1 2 3 4 5 6 7 8 9 10
 > comment(Mydata)
 [1] "This is a data from a sequence"
 > str(Mydata)
 atomic [1:10] 1 2 3 4 5 6 7 8 9 10
 - attr(*, "comment")= chr "This is a data from a sequence"

Leave a Reply

Your email address will not be published. Required fields are marked *