Description Usage Arguments Details Value Examples
View source: R/comment_width.R
Helper function to the commet family of functions. Can take both numerical values as the width in characters or a prespecified standard through a character string.
1 | comment_width(width = "option", a4portrait_width = 80)
|
width |
is the prefered width. Could be numeric (number of characters), a paper size
(currently |
a4portrait_width |
specifies the number of characters that can be printed on a single line on a a4 paper
in portrait orientation. This value is usually 80 (or in the range from 60 to 75). Here a lower value is set by default
due to experimentation on the authors own computer. Please contact the author if this value seems strange.
Note however that it is usully more sufficient to use a global option for the |
The width is specified in order to fit the comment on a printed page or in a script file showed in RStudio
(hence the -5 in getOption("width") - 5
to adjust for the line numbering in the script file compared to the console.
It is also possible to use a global option comment_width
. This is not a standard option and has to be manually
specified (for example in a .Rprofile-file).
An integer specifiing the text width (in number of characters) to be used in a comment.
1 2 3 4 5 6 7 8 9 10 | comment_width()
comment_width(42)
comment_width("a4portrait")
## Not run:
# We can set a global option for the comment_width
options(comment_width = 80)
header_comment("Test", "A small test")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.