set_startup_options.Rd
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",
...
)
Default 4
Default FALSE
Default FALSE
Default cli::console_width() + 13L. See details.
Default number of CPUs - 1. Used for parallel pkg installs.
Default blank space (remove the default +)
Default 100 to avoid blow up
Default TRUE
. For xaringan presentations
Default 10
. For List printing
Default number of CPUs - 1. Used for parallel computing
Default TRUE
.
Warn if using partial arguments.
Default 999
. Always print out full numbers, i.e. not 1e2
Used by RStudio Package Manager (RSPM).
Used by RSPM for curl/wget installs, e.g. Rscript.
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 for sourcing
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.
Default FALSE
. Logical: should graphical menus be used if available?
Default rlang
. If rlang
is installed, then error = rlang::entrace.
Other arguments passed to options
.
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.