Nothing
purl()
The function purl()
can be used to extract code chunks from a document.
1+1
## [1] 2
strsplit('hello world', ' ')
## [[1]]
## [1] "hello" "world"
A second chunk.
if (FALSE) plot(1:10)
When we do not evaluate a chunk, the code from purl()
will be commented out.
paste(letters, collapse = '|')
if (1 == 1) {
'Awesome!'
}
If one chunk should not be included in the results from purl()
, just use the chunk option purl = FALSE
:
# we do not like significance stars!
options(stringsAsFactors = FALSE, show.signif.stars = FALSE)
When a code chunk is supposed to error, use error = TRUE
, and purl()
will wrap the code in try()
:
1 + 'a'
## Error in `1 + "a"`:
## ! non-numeric argument to binary operator
That is it.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.