x %:)% yx %comment% y
Returns a character string of the class regex
with a comment
added as a "comment"
attribute.
This operator allows you to add comments to character strings.
The operator, %:)%
, is a simple smiley face emotion because
commented code is happy code.
a <- "The character string" b <- "The comment" (out <- a %:)% b)[1] "The character string"attributes(out)$class [1] "regex" "character" $comment [1] "The comment"comment(out)[1] "The comment"minimal <- construct("a", "b", "c" %:)% "A love note to your future self") minimal[1] "abc"comments(minimal)[[1]] NULL [[2]] NULL [[3]] [1] "A love note to your future self"
comment