comments(x, ...)comments(x) <- valueset_comments(x, y)
comments - Returns a list of comments.
set_comments - Returns a regexr object.
comments - Get the comments from a regexr object.
comments<- - Set the comments of a regexr object.
set_comments - This is a convenience function that sets the
comments on a regexr object and returns the
object.
minimal <- construct("a", "b", "c" %:)% "Comment #3") minimal[1] "abc"comments(minimal)[[1]] NULL [[2]] NULL [[3]] [1] "Comment #3"comments(minimal)[2] <- "A comment" comments(minimal)[[1]] NULL [[2]] [1] "A comment" [[3]] [1] "Comment #3"minimal <- construct("a", "b", "c") out <- set_comments(minimal, paste("comment", 1:3)) comments(out)[1] "comment 1" "comment 2" "comment 3"