Description Usage Arguments Examples
Read in clipboard contents as lines, apply a function on them, and write results back to the clipboard
1 |
FUN |
function to be applied |
... |
optional arguments to |
collapse |
collapse the lines into a single string separated by newlines |
write |
write the results back to the clipboard |
eval |
parse and evaluate the results |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
# Copy to clipboard
a <- 10
b <- 20
s <- a + b
s
# end
# Run
ev <- cbapply(FUN=function(x) paste(x, "+ 2"), eval=TRUE)
ev; a; b; s
# Clipboard contents changed to
a <- 10 + 2
b <- 20 + 2
s <- a + b + 2
s + 2
# end
# Copy to clipboard
One Two
Three
# end
# Run
cbapply(FUN=toupper, write=FALSE)
# Clipboard contents unchanged
One Two
Three
# end
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.