persist_process_presets: Write current process presets out to a '.Rprofile'

View source: R/process_preset.R

persist_process_presetsR Documentation

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")

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.

Value

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

Examples

## Not run: 
add_process_preset(~ .x %>% as_xpdb_x(), name = "convert", persist = FALSE)
persist_process_presets()

## End(Not run)

xpose.xtras documentation built on Sept. 1, 2026, 5:08 p.m.