Learn R Programming

xpose.xtras (version 0.2.2)

persist_process_presets: Write current process presets out to a .Rprofile

Description

Syncs the in-session add_process_preset() registry out to a .Rprofile file, so it's available again in future sessions. This is what persist = TRUE on add_process_preset()/remove_process_preset()/ amend_process_preset() calls internally; call it directly to persist several in-session changes (each made with persist = FALSE) in one write/confirmation instead of one per change. See the CRAN-policy notes in add_process_preset() -- in particular, this always errors instead of writing anything when rlang::is_interactive() is FALSE.

Usage

persist_process_presets(ask = TRUE, profile = "project")

Value

TRUE if the file was written, FALSE if declined (invisibly)

Arguments

ask

<logical(1)> When persist = TRUE, ask for interactive confirmation before writing? (default: TRUE; only ever consulted when rlang::is_interactive() is already TRUE)

profile

<character(1)> Where to persist to when persist = TRUE: "project" (default, .Rprofile in getwd()), "user" (the user-level profile), or a literal file path.

Examples

Run this code
if (FALSE) {
add_process_preset(~ .x %>% as_xpdb_x(), name = "convert", persist = FALSE)
persist_process_presets()
}

Run the code above in your browser using DataLab