customiser {customiser} | R Documentation |
Create your .Rprofile from R Markdown
Description
Mainly useful as the "knit:" parameter of an R Markdown file. A document with this option will have its R code made into the contents of the appropriate .Rprofile file for the user's operating system.
Usage
customiser(file, ..., quiet = FALSE)
Arguments
file |
Character. The R Markdown file from which to extract code. |
... |
For future extensions and must be empty. |
quiet |
Logical. Whether to silence the confirmation message.
|
Details
The function always writes the .Rprofile to R's home directory as determined
by fs::path_home_r()
. If you wish to overwrite this behaviour, you can
set the "customiser.r_home" global option to the target directory of your
choosing.
Value
Invisibly, a string with the location of the .Rprofile file being written to.
Examples
library(withr)
my_rmarkdown_file <- rmarkdown_simple()
tmp <- tempdir()
with_options(list(customiser.r_home = tmp), {
customiser(my_rmarkdown_file)
})
file.exists(file.path(tmp, ".Rprofile"))
[Package customiser version 0.1.1 Index]