Add Comments to Character Strings.

Usage

x %:)% y
x %comment% y

Arguments

x
A character string that is to be commented.
y
A character string (the comment).

Add Comments to Character Strings.

Value

Returns a character string of the class regex with a comment added as a "comment" attribute.

Description

This operator allows you to add comments to character strings.

Note

The operator, %:)%, is a simple smiley face emotion because commented code is happy code.

Examples

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"

See also

comment