All R objects have attributes – one of these can be a comment. You can set or view the comment attribute of an object using the comment() command. For example:
> x <- c(2, 3, 5, 4, 3, 6)
> comment(x)
NULL
> comment(x) <- "A simple numeric variable"
> comment(x)
[1] "A simple numeric variable"
Use the comment to remind you what the object is – it is easy to forget later.
My Publications
I have written several books on ecology and data analysis
We run training courses in data management, visualisation and analysis using Excel and R: The Statistical Programming Environment. Courses will be held at our training centre in Sutton, South London. Alternatively we can come to you and provide the training at your workplace.
Get In Touch Now
for any information regarding our training courses, publications or help with a data project
Add comments to objects in R
Home » Data Analytics Articles » Data Analytics Articles » Add comments to objects in R
All R objects have attributes – one of these can be a comment. You can set or view the comment attribute of an object using the comment() command. For example:
Use the comment to remind you what the object is – it is easy to forget later.
My Publications
I have written several books on ecology and data analysis
Register your interest for our Training Courses
We run training courses in data management, visualisation and analysis using Excel and R: The Statistical Programming Environment. Courses will be held at our training centre in Sutton, South London. Alternatively we can come to you and provide the training at your workplace.
Get In Touch Now
for any information regarding our training courses, publications or help with a data project