Description Usage Arguments Value Examples
View source: R/functions_vector_code.R
This function converts the clipboard (or indeed any character vector) into the code for an R vector. This can be useful if there it is necessary to “hard-code” vectors.
It treats entirely numeric clipboards — picked up by clipboard_is_numeric
— slightly differently to supposed “character” clipboards.
1 | to_vector_code(x = clipr::read_clip())
|
x |
A character vector (defaults to the |
We show the output by way of the following examples that assume x
is the clipboard.
Numeric: suppose we copy the following into the clipboard...
1
2
3
Then the function will output c(1,2,3)
.
Character: suppose we copy the following into the clipboard...
Apple
Orange
Banana
Then the function will output c("Apple","Orange","Banana")
.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.