View source: R/startup-options.R
set_startup_options | R Documentation |
Sets nicer options. All arguments are passed to the options
function.
This function also sets ipck = TRUE
in rc.settings
.
set_startup_options(
digits = 4L,
show.signif.stars = FALSE,
useFancyQuotes = FALSE,
width = cli::console_width(),
Ncpus = max(1L, parallel::detectCores() - 1L),
continue = " ",
max.print = 100L,
servr.daemon = TRUE,
max = 10L,
mc.cores = max(1L, parallel::detectCores() - 1L),
warnPartialMatchArgs = TRUE,
warnPartialMatchDollar = TRUE,
warnPartialMatchAttr = TRUE,
scipen = 999L,
HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(),
R.version$platform, R.version$arch, R.version$os)),
download.file.extra = sprintf("--header \"User-Agent: R (%s)\"",
paste(getRversion(), R.version$platform, R.version$arch, R.version$os)),
setWidthOnResize = TRUE,
show.error.locations = TRUE,
check.bounds = FALSE,
menu.graphics = FALSE,
error = "rlang",
...
)
digits |
Default |
show.signif.stars |
Default |
useFancyQuotes |
Default |
width |
Default cli::console_width() + 13L. See details. |
Ncpus |
Default number of CPUs - 1. Used for parallel pkg installs. |
continue |
Default blank space (remove the default +) |
max.print |
Default 100 to avoid blow up |
servr.daemon |
Default |
max |
Default |
mc.cores |
Default number of CPUs - 1. Used for parallel computing |
warnPartialMatchArgs , warnPartialMatchAttr , warnPartialMatchDollar |
Default |
scipen |
Default |
HTTPUserAgent |
Used by RStudio Package Manager (RSPM). |
download.file.extra |
Used by RSPM for curl/wget installs, e.g. Rscript. |
setWidthOnResize |
If set and TRUE, R run in a terminal using a recent readline library will set the width option when the terminal is resized. |
show.error.locations |
Show error locations for sourcing |
check.bounds |
logical, defaulting to FALSE. If true, a warning is produced whenever a vector (atomic or list) is extended, by something like x <- 1:3; x[5] <- 6. |
menu.graphics |
Default |
error |
Default |
... |
Other arguments passed to |
The width
is only used in an R terminal (not RStudio). However,
fancy prompts that involve colours (such as grey), mean that the column count is off
as grey is grey()(cli::symbol$pointer)
is translated to a 17 character
Unicode string. My slightly hacky solution is to add a line break in the
prompt, than add an additional 17 characters to the width to pad out the width.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.