Soft-deprecated lifecycle

Normally, you invoke a R function by typing arguments manually. A powerful alternative is to call a function with a list of arguments assembled programmatically. This is the purpose of invoke().

invoke(.fn, .args = list(), ..., .env = caller_env(),
  .bury = c(".fn", ""))

Arguments

.fn

A function to invoke. Can be a function object or the name of a function in scope of .env.

.args, ...

List of arguments (possibly named) to be passed to .fn.

.env

The environment in which to call .fn.

.bury

A character vector of length 2. The first string specifies which name should the function have in the call recorded in the evaluation stack. The second string specifies a prefix for the argument names. Set .bury to NULL if you prefer to inline the function and its arguments in the call.

Details

Technically, invoke() is basically a version of base::do.call() that creates cleaner call traces because it does not inline the function and the arguments in the call (see examples). To achieve this, invoke() creates a child environment of .env with .fn and all arguments bound to new symbols (see env_bury()). It then uses the same strategy as eval_bare() to evaluate with minimal noise.

Life cycle

invoke() is soft-deprecated in favour of exec(). Now that we understand better the interaction between unquoting and dots capture, we can take a simpler approach in exec().

If you need finer control over the generated call, you should construct an environment and call yourself, manually burying large objects or complex expressions.

Examples

# invoke() has the same purpose as do.call(): invoke(paste, letters)
#> Warning: `invoke()` is deprecated as of rlang 0.4.0. #> Please use `exec()` or `eval(expr())`instead. #> This warning is displayed once per session.
#> [1] "a b c d e f g h i j k l m n o p q r s t u v w x y z"
# But it creates much cleaner calls: invoke(call_inspect, mtcars)
#> .fn(mpg = `1`, cyl = `2`, disp = `3`, hp = `4`, drat = `5`, wt = `6`, #> qsec = `7`, vs = `8`, am = `9`, gear = `10`, carb = `11`)
# and stacktraces: fn <- function(...) sys.calls() invoke(fn, list(mtcars))
#> [[1]] #> tryCatch(withCallingHandlers({ #> NULL #> saveRDS(do.call(do.call, c(readRDS("/tmp/Rtmp4B68tY/file4f26784478dc"), #> list(envir = .GlobalEnv)), envir = .GlobalEnv), file = "/tmp/Rtmp4B68tY/file4f2645afc31f") #> flush(stdout()) #> flush(stderr()) #> NULL #> invisible() #> }, error = function(e) { #> { #> callr_data <- as.environment("tools:callr")$`__callr_data__` #> err <- callr_data$err #> capture.output(assign(".Traceback", traceback(9), envir = baseenv())) #> dump.frames("__callr_dump__") #> assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) #> rm("__callr_dump__", envir = .GlobalEnv) #> calls <- sys.calls() #> dcframe <- which(vapply(calls, function(x) length(x) >= #> 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] #> if (!is.na(dcframe)) #> e$`_ignore` <- list(c(1, dcframe + 1L)) #> e$`_pid` <- Sys.getpid() #> e$`_timestamp` <- Sys.time() #> e <- err$add_trace_back(e) #> saveRDS(list("error", e), file = paste0("/tmp/Rtmp4B68tY/file4f2645afc31f", #> ".error")) #> } #> }, interrupt = function(e) { #> { #> callr_data <- as.environment("tools:callr")$`__callr_data__` #> err <- callr_data$err #> capture.output(assign(".Traceback", traceback(9), envir = baseenv())) #> dump.frames("__callr_dump__") #> assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) #> rm("__callr_dump__", envir = .GlobalEnv) #> calls <- sys.calls() #> dcframe <- which(vapply(calls, function(x) length(x) >= #> 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] #> if (!is.na(dcframe)) #> e$`_ignore` <- list(c(1, dcframe + 1L)) #> e$`_pid` <- Sys.getpid() #> e$`_timestamp` <- Sys.time() #> e <- err$add_trace_back(e) #> saveRDS(list("error", e), file = paste0("/tmp/Rtmp4B68tY/file4f2645afc31f", #> ".error")) #> } #> }, callr_message = function(e) { #> try({ #> pxlib <- as.environment("tools:callr")$`__callr_data__`$pxlib #> if (is.null(e$code)) #> e$code <- "301" #> msg <- paste0("base64::", pxlib$base64_encode(serialize(e, #> NULL))) #> data <- paste(e$code, msg, "\n") #> pxlib$write_fd(3L, data) #> if (!is.null(findRestart("muffleMessage"))) { #> invokeRestart("muffleMessage") #> } #> }) #> }), error = function(e) { #> NULL #> try(stop(e)) #> }, interrupt = function(e) { #> NULL #> e #> }) #> #> [[2]] #> tryCatchList(expr, classes, parentenv, handlers) #> #> [[3]] #> tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), #> names[nh], parentenv, handlers[[nh]]) #> #> [[4]] #> doTryCatch(return(expr), name, parentenv, handler) #> #> [[5]] #> tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) #> #> [[6]] #> tryCatchOne(expr, names, parentenv, handlers[[1L]]) #> #> [[7]] #> doTryCatch(return(expr), name, parentenv, handler) #> #> [[8]] #> withCallingHandlers({ #> NULL #> saveRDS(do.call(do.call, c(readRDS("/tmp/Rtmp4B68tY/file4f26784478dc"), #> list(envir = .GlobalEnv)), envir = .GlobalEnv), file = "/tmp/Rtmp4B68tY/file4f2645afc31f") #> flush(stdout()) #> flush(stderr()) #> NULL #> invisible() #> }, error = function(e) { #> { #> callr_data <- as.environment("tools:callr")$`__callr_data__` #> err <- callr_data$err #> capture.output(assign(".Traceback", traceback(9), envir = baseenv())) #> dump.frames("__callr_dump__") #> assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) #> rm("__callr_dump__", envir = .GlobalEnv) #> calls <- sys.calls() #> dcframe <- which(vapply(calls, function(x) length(x) >= #> 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] #> if (!is.na(dcframe)) #> e$`_ignore` <- list(c(1, dcframe + 1L)) #> e$`_pid` <- Sys.getpid() #> e$`_timestamp` <- Sys.time() #> e <- err$add_trace_back(e) #> saveRDS(list("error", e), file = paste0("/tmp/Rtmp4B68tY/file4f2645afc31f", #> ".error")) #> } #> }, interrupt = function(e) { #> { #> callr_data <- as.environment("tools:callr")$`__callr_data__` #> err <- callr_data$err #> capture.output(assign(".Traceback", traceback(9), envir = baseenv())) #> dump.frames("__callr_dump__") #> assign(".Last.dump", .GlobalEnv$`__callr_dump__`, envir = callr_data) #> rm("__callr_dump__", envir = .GlobalEnv) #> calls <- sys.calls() #> dcframe <- which(vapply(calls, function(x) length(x) >= #> 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] #> if (!is.na(dcframe)) #> e$`_ignore` <- list(c(1, dcframe + 1L)) #> e$`_pid` <- Sys.getpid() #> e$`_timestamp` <- Sys.time() #> e <- err$add_trace_back(e) #> saveRDS(list("error", e), file = paste0("/tmp/Rtmp4B68tY/file4f2645afc31f", #> ".error")) #> } #> }, callr_message = function(e) { #> try({ #> pxlib <- as.environment("tools:callr")$`__callr_data__`$pxlib #> if (is.null(e$code)) #> e$code <- "301" #> msg <- paste0("base64::", pxlib$base64_encode(serialize(e, #> NULL))) #> data <- paste(e$code, msg, "\n") #> pxlib$write_fd(3L, data) #> if (!is.null(findRestart("muffleMessage"))) { #> invokeRestart("muffleMessage") #> } #> }) #> }) #> #> [[9]] #> saveRDS(do.call(do.call, c(readRDS("/tmp/Rtmp4B68tY/file4f26784478dc"), #> list(envir = .GlobalEnv)), envir = .GlobalEnv), file = "/tmp/Rtmp4B68tY/file4f2645afc31f") #> #> [[10]] #> do.call(do.call, c(readRDS("/tmp/Rtmp4B68tY/file4f26784478dc"), #> list(envir = .GlobalEnv)), envir = .GlobalEnv) #> #> [[11]] #> (function (what, args, quote = FALSE, envir = parent.frame()) #> { #> if (!is.list(args)) #> stop("second argument must be a list") #> if (quote) #> args <- lapply(args, enquote) #> .Internal(do.call(what, args, envir)) #> })(function (..., crayon_enabled, crayon_colors, pkgdown_internet) #> { #> options(crayon.enabled = crayon_enabled, crayon.colors = crayon_colors, #> pkgdown.internet = pkgdown_internet) #> pkgdown::build_site(...) #> }, list(pkg = list(package = "rlang", version = list(c(0L, 4L, #> 0L, 9005L)), src_path = "/home/travis/build/r-lib/rlang", dst_path = "/tmp/Rtmp4B68tY/file4f2653f13748", #> github_url = "https://github.com/r-lib/rlang", desc = <environment>, #> meta = list(url = "https://rlang.r-lib.org", template = list( #> params = list(ganalytics = "UA-115082821-1")), home = list( #> links = list(list(text = "The tidy eval bookdown", href = "https://tidyeval.tidyverse.org"))), #> navbar = list(structure = list(left = c("home", "reference", #> "lifecycle", "news"), right = "github"), components = list( #> lifecycle = list(text = "Life cycle", href = "reference/lifecycle.html"), #> news = list(text = "News", menu = list(list(text = "Release notes"), #> list(text = "Version 0.4.0", href = "https://www.tidyverse.org/articles/2019/06/rlang-0-4-0/"), #> list(text = "Version 0.3.1", href = "https://www.tidyverse.org/articles/2019/01/rlang-0-3-1/"), #> list(text = "Version 0.3.0", href = "https://www.tidyverse.org/articles/2018/10/rlang-0-3-0/"), #> list(text = "Version 0.2.0", href = "https://www.tidyverse.org/articles/2018/03/rlang-0.2.0/"), #> list(text = "------------------"), list(text = "Change log", #> href = "news/index.html"))))), reference = list( #> list(title = "Tidy evaluation", desc = "Quote arguments and expressions with unquoting support. The quosure variants wrap an environment with the expression.\n", #> contents = c("quo", "quos", "enquo", "enquos", #> "expr", "exprs", "enexpr", "enexprs", "quasiquotation" #> )), list(title = "Tidy dots", desc = "Collect arguments contained in `...` with `!!!` and name-unquoting support.\n", #> contents = c("list2", "dots_list")), list(title = "Errors, conditions, and backtraces", #> contents = c("abort", "warn", "inform", "signal", #> "trace_back", "with_abort", "entrace")), list( #> title = "Evaluate expressions", contents = c("eval_tidy", #> "eval_bare", "exec")), list(title = "Symbols", #> contents = c("sym", "syms", "is_symbol")), list( #> title = "Calls", contents = c("starts_with(\"call_\")", #> "call2", "is_call")), list(title = "Expressions", #> contents = c("starts_with(\"expr_\")", "starts_with(\"exprs_\")", #> "starts_with(\"parse_\")", "is_expression", "is_symbolic", #> "expr_text", "expr_label", "expr_name", "set_expr", #> "get_expr")), list(title = "Quosures", contents = c("starts_with(\"quo_\")", #> "new_quosure", "is_quosure", "as_quosure", "is_quosures", #> "quos_auto_name")), list(title = "Formulas", contents = c("starts_with(\"f_\")", #> "new_formula", "is_formula", "is_bare_formula")), #> list(title = "Functions", contents = c("starts_with(\"fn_\")", #> "new_function", "is_function", "is_closure", "is_primitive", #> "as_function", "as_closure")), list(title = "Environments", #> contents = c("env", "new_environment", "env_print", #> "env_parent", "env_tail", "env_parents", "env_depth", #> "get_env", "set_env", "env_clone", "env_inherits", #> "is_environment", "is_bare_environment", "as_environment", #> "caller_env")), list(title = "Environment bindings", #> contents = c("env_bind", "env_bind_lazy", "env_bind_active", #> "env_unbind", "with_bindings", "scoped_bindings", #> "env_has", "env_get", "env_get_list", "env_names", #> "env_length", "env_poke")), list(title = "Search path and namespaces", #> contents = c("search_envs", "search_env", "base_env", #> "global_env", "empty_env", "is_installed", "is_namespace", #> "ns_env", "pkg_env", "env_name", "env_label")), #> list(title = "S3", contents = c("inherits_any", "inherits_all", #> "inherits_only", "new_box", "is_box", "as_box", "as_box_if", #> "unbox", "zap", "is_zap")), list(title = "Create vectors", #> desc = "Atomic vector constructors have implicit splicing (i.e. splice lists automatically), while the list constructor has explicit splicing.\n", #> contents = c("lgl", "int", "dbl", "cpl", "chr", #> "list2", "rep_along", "rep_named", "seq2", "seq2_along" #> )), list(title = "Attributes", contents = c("set_names", #> "names2")), list(title = "Type predicates", contents = c("is_list", #> "is_atomic", "is_vector", "is_integer", "is_double", #> "is_character", "is_logical", "is_raw", "is_bytes", #> "is_scalar_list", "is_scalar_atomic", "is_scalar_vector", #> "is_scalar_integer", "is_scalar_double", "is_scalar_character", #> "is_scalar_logical", "is_scalar_raw", "is_scalar_bytes", #> "is_bare_list", "is_bare_atomic", "is_bare_vector", #> "is_bare_double", "is_bare_integer", "is_bare_numeric", #> "is_bare_character", "is_bare_logical", "is_bare_raw", #> "is_bare_bytes", "is_empty", "is_integerish", "is_bare_integerish", #> "is_scalar_integerish", "is_null", "is_true", "is_false", #> "is_string", "is_bool", "is_bare_string")), list( #> title = "Operators", contents = c("`%||%`", "`%|%`", #> "`%@%`")), list(title = "Function arguments", #> contents = c("arg_match", "missing_arg", "is_missing", #> "maybe_missing")), list(title = "Create tidy evaluation APIs", #> desc = "Create data masking APIs à-la dplyr or tidyr. These functions are meant for developers rather than users.\n", #> contents = c("`tidyeval-data`", "eval_tidy", #> "as_data_mask", "new_data_mask", "as_data_pronoun" #> )), list(title = "Condition handlers", contents = c("with_handlers", #> "calling")), list(title = "Session state", contents = c("matches(\"interactive\")", #> "matches(\"option\")")), list(title = "Weak references", #> contents = c("matches(\"weakref\")", "matches(\"wref\")" #> ))), destination = "/tmp/Rtmp4B68tY/file4f2653f13748"), #> figures = list(dev = "grDevices::png", dpi = 96L, dev.args = list(), #> fig.ext = "png", fig.width = 7.29166666666667, fig.height = NULL, #> fig.retina = 2L, fig.asp = 0.618046971569839), development = list( #> destination = "dev", mode = "release", version_label = "default", #> version_tooltip = "Released version", in_dev = FALSE), #> topics = list(name = c("abort", "are_na", "arg_match", "as_box", #> "as_bytes", "as_data_mask", "as_env", "as_environment", "as_function", #> "as_label", "as_name", "as_overscope", "as_pairlist", "as_quosure", #> "as_string", "as_utf8_character", "bare-type-predicates", #> "box", "call2", "call_args", "call_fn", "call_inspect", "call_modify", #> "call_name", "call_standardise", "caller_env", "caller_fn", #> "caller_frame", "catch_cnd", "chr_unserialise_unicode", "error_cnd", #> "cnd_message", "cnd_muffle", "cnd_signal", "cnd_type", "done", #> "dots_definitions", "dots_n", "dots_values", "duplicate", #> "empty_env", "entrace", "env", "env_bind", "env_bind_exprs", #> "env_binding_are_active", "env_binding_lock", "env_bury", #> "env_clone", "env_depth", "env_get", "env_has", "env_inherits", #> "env_lock", "env_name", "env_names", "env_parent", "env_poke", #> "env_print", "env_unbind", "env_unlock", "eval_bare", "eval_tidy", #> "exec", "exiting", "expr_interp", "expr_label", "expr_print", #> "exprs_auto_name", "f_rhs", "f_text", "flatten", "fn_body", #> "fn_env", "fn_fmls", "frame_position", "friendly_type", "get_env", #> "has_length", "has_name", "inherits_any", "invoke", "is_call", #> "is_callable", "is_condition", "is_copyable", "is_empty", #> "is_env", "is_environment", "is_expr", "is_expression", "is_formula", #> "is_frame", "is_function", "is_installed", "is_integerish", #> "is_interactive", "is_lang", "is_named", "is_namespace", #> "is_pairlist", "is_reference", "is_stack", "is_symbol", "is_true", #> "is_weakref", "lang", "lang_head", "lang_modify", "last_error", #> "lifecycle", "missing", "missing_arg", "mut_node_car", "names2", #> "new-vector-along-retired", "new-vector", "new_call", "new_formula", #> "new_function", "new_node", "new_quosures", "new_weakref", #> "ns_env", "op-definition", "op-get-attr", "op-na-default", #> "op-null-default", "overscope_eval_next", "pairlist2", "parse_expr", #> "parse_quosure", "prepend", "prim_name", "quasiquotation", #> "quo_expr", "quo_label", "quo_squash", "quosure", "quotation", #> "rep_along", "restarting", "return_from", "rlang_backtrace_on_error", #> "rst_abort", "rst_list", "scalar-type-predicates", "scoped_bindings", #> "scoped_env", "scoped_options", "search_envs", "seq2", "set_attrs", #> "set_expr", "set_names", "splice", "stack", "stack_trim", #> "string", "switch_type", "sym", "tidy-dots", "tidyeval-data", #> "trace_back", "type-predicates", "type_of", "vec_poke_n", #> "vector-coercion", "vector-construction", "node", "with_abort", #> "with_env", "with_handlers", "with_restarts", "wref_key", #> "zap"), file_in = c("abort.Rd", "are_na.Rd", "arg_match.Rd", #> "as_box.Rd", "as_bytes.Rd", "as_data_mask.Rd", "as_env.Rd", #> "as_environment.Rd", "as_function.Rd", "as_label.Rd", "as_name.Rd", #> "as_overscope.Rd", "as_pairlist.Rd", "as_quosure.Rd", "as_string.Rd", #> "as_utf8_character.Rd", "bare-type-predicates.Rd", "box.Rd", #> "call2.Rd", "call_args.Rd", "call_fn.Rd", "call_inspect.Rd", #> "call_modify.Rd", "call_name.Rd", "call_standardise.Rd", #> "caller_env.Rd", "caller_fn.Rd", "caller_frame.Rd", "catch_cnd.Rd", #> "chr_unserialise_unicode.Rd", "cnd.Rd", "cnd_message.Rd", #> "cnd_muffle.Rd", "cnd_signal.Rd", "cnd_type.Rd", "done.Rd", #> "dots_definitions.Rd", "dots_n.Rd", "dots_values.Rd", "duplicate.Rd", #> "empty_env.Rd", "entrace.Rd", "env.Rd", "env_bind.Rd", "env_bind_exprs.Rd", #> "env_binding_are_active.Rd", "env_binding_lock.Rd", "env_bury.Rd", #> "env_clone.Rd", "env_depth.Rd", "env_get.Rd", "env_has.Rd", #> "env_inherits.Rd", "env_lock.Rd", "env_name.Rd", "env_names.Rd", #> "env_parent.Rd", "env_poke.Rd", "env_print.Rd", "env_unbind.Rd", #> "env_unlock.Rd", "eval_bare.Rd", "eval_tidy.Rd", "exec.Rd", #> "exiting.Rd", "expr_interp.Rd", "expr_label.Rd", "expr_print.Rd", #> "exprs_auto_name.Rd", "f_rhs.Rd", "f_text.Rd", "flatten.Rd", #> "fn_body.Rd", "fn_env.Rd", "fn_fmls.Rd", "frame_position.Rd", #> "friendly_type.Rd", "get_env.Rd", "has_length.Rd", "has_name.Rd", #> "inherits_any.Rd", "invoke.Rd", "is_call.Rd", "is_callable.Rd", #> "is_condition.Rd", "is_copyable.Rd", "is_empty.Rd", "is_env.Rd", #> "is_environment.Rd", "is_expr.Rd", "is_expression.Rd", "is_formula.Rd", #> "is_frame.Rd", "is_function.Rd", "is_installed.Rd", "is_integerish.Rd", #> "is_interactive.Rd", "is_lang.Rd", "is_named.Rd", "is_namespace.Rd", #> "is_pairlist.Rd", "is_reference.Rd", "is_stack.Rd", "is_symbol.Rd", #> "is_true.Rd", "is_weakref.Rd", "lang.Rd", "lang_head.Rd", #> "lang_modify.Rd", "last_error.Rd", "lifecycle.Rd", "missing.Rd", #> "missing_arg.Rd", "mut_node_car.Rd", "names2.Rd", "new-vector-along-retired.Rd", #> "new-vector.Rd", "new_call.Rd", "new_formula.Rd", "new_function.Rd", #> "new_node.Rd", "new_quosures.Rd", "new_weakref.Rd", "ns_env.Rd", #> "op-definition.Rd", "op-get-attr.Rd", "op-na-default.Rd", #> "op-null-default.Rd", "overscope_eval_next.Rd", "pairlist2.Rd", #> "parse_expr.Rd", "parse_quosure.Rd", "prepend.Rd", "prim_name.Rd", #> "quasiquotation.Rd", "quo_expr.Rd", "quo_label.Rd", "quo_squash.Rd", #> "quosure.Rd", "quotation.Rd", "rep_along.Rd", "restarting.Rd", #> "return_from.Rd", "rlang_backtrace_on_error.Rd", "rst_abort.Rd", #> "rst_list.Rd", "scalar-type-predicates.Rd", "scoped_bindings.Rd", #> "scoped_env.Rd", "scoped_options.Rd", "search_envs.Rd", "seq2.Rd", #> "set_attrs.Rd", "set_expr.Rd", "set_names.Rd", "splice.Rd", #> "stack.Rd", "stack_trim.Rd", "string.Rd", "switch_type.Rd", #> "sym.Rd", "tidy-dots.Rd", "tidyeval-data.Rd", "trace_back.Rd", #> "type-predicates.Rd", "type_of.Rd", "vec_poke_n.Rd", "vector-coercion.Rd", #> "vector-construction.Rd", "vector-old-ctors.Rd", "with_abort.Rd", #> "with_env.Rd", "with_handlers.Rd", "with_restarts.Rd", "wref_key.Rd", #> "zap.Rd"), file_out = c("abort.html", "are_na.html", "arg_match.html", #> "as_box.html", "as_bytes.html", "as_data_mask.html", "as_env.html", #> "as_environment.html", "as_function.html", "as_label.html", #> "as_name.html", "as_overscope.html", "as_pairlist.html", #> "as_quosure.html", "as_string.html", "as_utf8_character.html", #> "bare-type-predicates.html", "box.html", "call2.html", "call_args.html", #> "call_fn.html", "call_inspect.html", "call_modify.html", #> "call_name.html", "call_standardise.html", "caller_env.html", #> "caller_fn.html", "caller_frame.html", "catch_cnd.html", #> "chr_unserialise_unicode.html", "cnd.html", "cnd_message.html", #> "cnd_muffle.html", "cnd_signal.html", "cnd_type.html", "done.html", #> "dots_definitions.html", "dots_n.html", "dots_values.html", #> "duplicate.html", "empty_env.html", "entrace.html", "env.html", #> "env_bind.html", "env_bind_exprs.html", "env_binding_are_active.html", #> "env_binding_lock.html", "env_bury.html", "env_clone.html", #> "env_depth.html", "env_get.html", "env_has.html", "env_inherits.html", #> "env_lock.html", "env_name.html", "env_names.html", "env_parent.html", #> "env_poke.html", "env_print.html", "env_unbind.html", "env_unlock.html", #> "eval_bare.html", "eval_tidy.html", "exec.html", "exiting.html", #> "expr_interp.html", "expr_label.html", "expr_print.html", #> "exprs_auto_name.html", "f_rhs.html", "f_text.html", "flatten.html", #> "fn_body.html", "fn_env.html", "fn_fmls.html", "frame_position.html", #> "friendly_type.html", "get_env.html", "has_length.html", #> "has_name.html", "inherits_any.html", "invoke.html", "is_call.html", #> "is_callable.html", "is_condition.html", "is_copyable.html", #> "is_empty.html", "is_env.html", "is_environment.html", "is_expr.html", #> "is_expression.html", "is_formula.html", "is_frame.html", #> "is_function.html", "is_installed.html", "is_integerish.html", #> "is_interactive.html", "is_lang.html", "is_named.html", "is_namespace.html", #> "is_pairlist.html", "is_reference.html", "is_stack.html", #> "is_symbol.html", "is_true.html", "is_weakref.html", "lang.html", #> "lang_head.html", "lang_modify.html", "last_error.html", #> "lifecycle.html", "missing.html", "missing_arg.html", "mut_node_car.html", #> "names2.html", "new-vector-along-retired.html", "new-vector.html", #> "new_call.html", "new_formula.html", "new_function.html", #> "new_node.html", "new_quosures.html", "new_weakref.html", #> "ns_env.html", "op-definition.html", "op-get-attr.html", #> "op-na-default.html", "op-null-default.html", "overscope_eval_next.html", #> "pairlist2.html", "parse_expr.html", "parse_quosure.html", #> "prepend.html", "prim_name.html", "quasiquotation.html", #> "quo_expr.html", "quo_label.html", "quo_squash.html", "quosure.html", #> "quotation.html", "rep_along.html", "restarting.html", "return_from.html", #> "rlang_backtrace_on_error.html", "rst_abort.html", "rst_list.html", #> "scalar-type-predicates.html", "scoped_bindings.html", "scoped_env.html", #> "scoped_options.html", "search_envs.html", "seq2.html", "set_attrs.html", #> "set_expr.html", "set_names.html", "splice.html", "stack.html", #> "stack_trim.html", "string.html", "switch_type.html", "sym.html", #> "tidy-dots.html", "tidyeval-data.html", "trace_back.html", #> "type-predicates.html", "type_of.html", "vec_poke_n.html", #> "vector-coercion.html", "vector-construction.html", "vector-old-ctors.html", #> "with_abort.html", "with_env.html", "with_handlers.html", #> "with_restarts.html", "wref_key.html", "zap.html"), alias = list( #> abort.Rd = c("abort", "warn", "inform", "signal", "interrupt" #> ), are_na.Rd = c("are_na", "is_na", "is_lgl_na", "is_int_na", #> "is_dbl_na", "is_chr_na", "is_cpl_na"), arg_match.Rd = "arg_match", #> as_box.Rd = c("as_box", "as_box_if"), as_bytes.Rd = "as_bytes", #> as_data_mask.Rd = c("as_data_mask", "as_data_pronoun", #> "new_data_mask"), as_env.Rd = "as_env", as_environment.Rd = "as_environment", #> as_function.Rd = c("as_function", "is_lambda", "as_closure" #> ), as_label.Rd = "as_label", as_name.Rd = "as_name", #> as_overscope.Rd = c("as_overscope", "new_overscope", #> "overscope_clean"), as_pairlist.Rd = "as_pairlist", as_quosure.Rd = c("as_quosure", #> "new_quosure"), as_string.Rd = "as_string", as_utf8_character.Rd = "as_utf8_character", #> `bare-type-predicates.Rd` = c("bare-type-predicates", #> "is_bare_list", "is_bare_atomic", "is_bare_vector", "is_bare_double", #> "is_bare_integer", "is_bare_numeric", "is_bare_character", #> "is_bare_logical", "is_bare_raw", "is_bare_string", "is_bare_bytes" #> ), box.Rd = c("box", "new_box", "is_box", "unbox"), call2.Rd = "call2", #> call_args.Rd = c("call_args", "call_args_names"), call_fn.Rd = "call_fn", #> call_inspect.Rd = "call_inspect", call_modify.Rd = "call_modify", #> call_name.Rd = c("call_name", "call_ns"), call_standardise.Rd = "call_standardise", #> caller_env.Rd = c("caller_env", "current_env"), caller_fn.Rd = c("caller_fn", #> "current_fn"), caller_frame.Rd = "caller_frame", catch_cnd.Rd = "catch_cnd", #> chr_unserialise_unicode.Rd = "chr_unserialise_unicode", #> cnd.Rd = c("error_cnd", "cnd", "warning_cnd", "message_cnd" #> ), cnd_message.Rd = c("cnd_message", "cnd_issue", "cnd_bullets" #> ), cnd_muffle.Rd = "cnd_muffle", cnd_signal.Rd = "cnd_signal", #> cnd_type.Rd = "cnd_type", done.Rd = c("done", "is_done_box" #> ), dots_definitions.Rd = "dots_definitions", dots_n.Rd = "dots_n", #> dots_values.Rd = "dots_values", duplicate.Rd = "duplicate", #> empty_env.Rd = "empty_env", entrace.Rd = c("entrace", #> "cnd_entrace"), env.Rd = c("env", "child_env", "new_environment" #> ), env_bind.Rd = c("env_bind", "env_bind_lazy", "env_bind_active" #> ), env_bind_exprs.Rd = c("env_bind_exprs", "env_bind_fns" #> ), env_binding_are_active.Rd = c("env_binding_are_active", #> "env_binding_are_lazy"), env_binding_lock.Rd = c("env_binding_lock", #> "env_binding_unlock", "env_binding_are_locked"), env_bury.Rd = "env_bury", #> env_clone.Rd = "env_clone", env_depth.Rd = "env_depth", #> env_get.Rd = c("env_get", "env_get_list"), env_has.Rd = "env_has", #> env_inherits.Rd = "env_inherits", env_lock.Rd = c("env_lock", #> "env_is_locked"), env_name.Rd = c("env_name", "env_label" #> ), env_names.Rd = c("env_names", "env_length"), env_parent.Rd = c("env_parent", #> "env_tail", "env_parents"), env_poke.Rd = "env_poke", #> env_print.Rd = "env_print", env_unbind.Rd = "env_unbind", #> env_unlock.Rd = "env_unlock", eval_bare.Rd = "eval_bare", #> eval_tidy.Rd = "eval_tidy", exec.Rd = "exec", exiting.Rd = "exiting", #> expr_interp.Rd = "expr_interp", expr_label.Rd = c("expr_label", #> "expr_name", "expr_text"), expr_print.Rd = c("expr_print", #> "expr_deparse"), exprs_auto_name.Rd = c("exprs_auto_name", #> "quos_auto_name"), f_rhs.Rd = c("f_rhs", "f_rhs<-", "f_lhs", #> "f_lhs<-", "f_env", "f_env<-"), f_text.Rd = c("f_text", #> "f_name", "f_label"), flatten.Rd = c("flatten", "flatten_lgl", #> "flatten_int", "flatten_dbl", "flatten_cpl", "flatten_chr", #> "flatten_raw", "squash", "squash_lgl", "squash_int", #> "squash_dbl", "squash_cpl", "squash_chr", "squash_raw", #> "flatten_if", "squash_if"), fn_body.Rd = c("fn_body", #> "fn_body<-"), fn_env.Rd = c("fn_env", "fn_env<-"), fn_fmls.Rd = c("fn_fmls", #> "fn_fmls_names", "fn_fmls_syms", "fn_fmls<-", "fn_fmls_names<-" #> ), frame_position.Rd = "frame_position", friendly_type.Rd = "friendly_type", #> get_env.Rd = c("get_env", "set_env", "env_poke_parent" #> ), has_length.Rd = "has_length", has_name.Rd = "has_name", #> inherits_any.Rd = c("inherits_any", "inherits_all", "inherits_only" #> ), invoke.Rd = "invoke", is_call.Rd = "is_call", is_callable.Rd = "is_callable", #> is_condition.Rd = "is_condition", is_copyable.Rd = "is_copyable", #> is_empty.Rd = "is_empty", is_env.Rd = c("is_env", "is_bare_env" #> ), is_environment.Rd = c("is_environment", "is_bare_environment" #> ), is_expr.Rd = "is_expr", is_expression.Rd = c("is_expression", #> "is_syntactic_literal", "is_symbolic"), is_formula.Rd = c("is_formula", #> "is_bare_formula"), is_frame.Rd = "is_frame", is_function.Rd = c("is_function", #> "is_closure", "is_primitive", "is_primitive_eager", "is_primitive_lazy" #> ), is_installed.Rd = "is_installed", is_integerish.Rd = c("is_integerish", #> "is_bare_integerish", "is_scalar_integerish"), is_interactive.Rd = c("is_interactive", #> "scoped_interactive", "with_interactive"), is_lang.Rd = c("is_lang", #> "is_unary_lang", "is_binary_lang", "quo_is_lang"), is_named.Rd = c("is_named", #> "is_dictionaryish", "have_name"), is_namespace.Rd = "is_namespace", #> is_pairlist.Rd = c("is_pairlist", "is_node", "is_node_list" #> ), is_reference.Rd = "is_reference", is_stack.Rd = c("is_stack", #> "is_eval_stack", "is_call_stack"), is_symbol.Rd = "is_symbol", #> is_true.Rd = c("is_true", "is_false"), is_weakref.Rd = "is_weakref", #> lang.Rd = c("lang", "new_language"), lang_head.Rd = c("lang_head", #> "lang_tail"), lang_modify.Rd = c("lang_modify", "lang_standardise", #> "lang_fn", "lang_name", "lang_args", "lang_args_names" #> ), last_error.Rd = c("last_error", "last_trace"), lifecycle.Rd = "lifecycle", #> missing.Rd = c("missing", "na_lgl", "na_int", "na_dbl", #> "na_chr", "na_cpl"), missing_arg.Rd = c("missing_arg", #> "is_missing", "maybe_missing"), mut_node_car.Rd = c("mut_node_car", #> "mut_node_cdr", "mut_node_caar", "mut_node_cadr", "mut_node_cdar", #> "mut_node_cddr", "mut_node_tag"), names2.Rd = "names2", #> `new-vector-along-retired.Rd` = c("new-vector-along-retired", #> "new_logical_along", "new_integer_along", "new_double_along", #> "new_character_along", "new_complex_along", "new_raw_along", #> "new_list_along"), `new-vector.Rd` = c("new-vector", #> "new_logical", "new_integer", "new_double", "new_character", #> "new_complex", "new_raw", "new_list"), new_call.Rd = "new_call", #> new_formula.Rd = "new_formula", new_function.Rd = "new_function", #> new_node.Rd = c("new_node", "node_car", "node_cdr", "node_caar", #> "node_cadr", "node_cdar", "node_cddr", "node_poke_car", #> "node_poke_cdr", "node_poke_caar", "node_poke_cadr", #> "node_poke_cdar", "node_poke_cddr", "node_tag", "node_poke_tag" #> ), new_quosures.Rd = c("new_quosures", "as_quosures", #> "is_quosures"), new_weakref.Rd = "new_weakref", ns_env.Rd = c("ns_env", #> "ns_imports_env", "ns_env_name"), `op-definition.Rd` = c("op-definition", #> "is_definition", "new_definition", "is_formulaish"), #> `op-get-attr.Rd` = c("op-get-attr", "%@%", "%@%<-"), #> `op-na-default.Rd` = c("op-na-default", "%|%"), `op-null-default.Rd` = c("op-null-default", #> "%||%"), overscope_eval_next.Rd = "overscope_eval_next", #> pairlist2.Rd = "pairlist2", parse_expr.Rd = c("parse_expr", #> "parse_exprs", "parse_quo", "parse_quos"), parse_quosure.Rd = c("parse_quosure", #> "parse_quosures"), prepend.Rd = c("prepend", "modify" #> ), prim_name.Rd = "prim_name", quasiquotation.Rd = c("quasiquotation", #> "UQ", "UQS", "!!", "!!!", ":=", "qq_show"), quo_expr.Rd = "quo_expr", #> quo_label.Rd = c("quo_label", "quo_text", "quo_name"), #> quo_squash.Rd = "quo_squash", quosure.Rd = c("quosure", #> "is_quosure", "quo_is_missing", "quo_is_symbol", "quo_is_call", #> "quo_is_symbolic", "quo_is_null", "quo_get_expr", "quo_get_env", #> "quo_set_expr", "quo_set_env"), quotation.Rd = c("quotation", #> "expr", "enexpr", "exprs", "enexprs", "ensym", "ensyms", #> "quo", "enquo", "quos", "enquos"), rep_along.Rd = c("rep_along", #> "rep_named"), restarting.Rd = "restarting", return_from.Rd = c("return_from", #> "return_to"), rlang_backtrace_on_error.Rd = c("rlang_backtrace_on_error", #> "add_backtrace"), rst_abort.Rd = "rst_abort", rst_list.Rd = c("rst_list", #> "rst_exists", "rst_jump", "rst_maybe_jump"), `scalar-type-predicates.Rd` = c("scalar-type-predicates", #> "is_scalar_list", "is_scalar_atomic", "is_scalar_vector", #> "is_scalar_integer", "is_scalar_double", "is_scalar_character", #> "is_scalar_logical", "is_scalar_raw", "is_string", "is_scalar_bytes", #> "is_bool"), scoped_bindings.Rd = c("scoped_bindings", #> "with_bindings"), scoped_env.Rd = c("scoped_env", "is_scoped", #> "scoped_envs", "scoped_names"), scoped_options.Rd = c("scoped_options", #> "with_options", "push_options", "peek_options", "peek_option" #> ), search_envs.Rd = c("search_envs", "search_env", "pkg_env", #> "pkg_env_name", "is_attached", "base_env", "global_env" #> ), seq2.Rd = c("seq2", "seq2_along"), set_attrs.Rd = c("set_attrs", #> "mut_attrs"), set_expr.Rd = c("set_expr", "get_expr"), #> set_names.Rd = "set_names", splice.Rd = c("splice", "is_spliced", #> "is_spliced_bare", "dots_splice"), stack.Rd = c("stack", #> "global_frame", "current_frame", "ctxt_frame", "call_frame", #> "ctxt_depth", "call_depth", "ctxt_stack", "call_stack" #> ), stack_trim.Rd = "stack_trim", string.Rd = "string", #> switch_type.Rd = c("switch_type", "coerce_type", "switch_class", #> "coerce_class"), sym.Rd = c("sym", "syms"), `tidy-dots.Rd` = c("tidy-dots", #> "dots_list", "list2"), `tidyeval-data.Rd` = c("tidyeval-data", #> ".data"), trace_back.Rd = c("trace_back", "trace_length" #> ), `type-predicates.Rd` = c("type-predicates", "is_list", #> "is_atomic", "is_vector", "is_integer", "is_double", #> "is_character", "is_logical", "is_raw", "is_bytes", "is_null" #> ), type_of.Rd = "type_of", vec_poke_n.Rd = c("vec_poke_n", #> "vec_poke_range"), `vector-coercion.Rd` = c("vector-coercion", #> "as_logical", "as_integer", "as_double", "as_complex", #> "as_character", "as_list"), `vector-construction.Rd` = c("vector-construction", #> "lgl", "int", "dbl", "cpl", "chr", "bytes", "ll"), `vector-old-ctors.Rd` = c("node", #> "vector-old-ctors", "lgl_len", "int_len", "dbl_len", #> "chr_len", "cpl_len", "raw_len", "bytes_len", "list_len", #> "lgl_along", "int_along", "dbl_along", "chr_along", "cpl_along", #> "raw_along", "bytes_along", "list_along"), with_abort.Rd = "with_abort", #> with_env.Rd = c("with_env", "locally"), with_handlers.Rd = c("with_handlers", #> "calling"), with_restarts.Rd = "with_restarts", wref_key.Rd = c("wref_key", #> "wref_value"), zap.Rd = c("zap", "is_zap")), funs = list( #> abort.Rd = c("abort()", "warn()", "inform()", "signal()", #> "interrupt()"), are_na.Rd = c("are_na()", "is_na()", #> "is_lgl_na()", "is_int_na()", "is_dbl_na()", "is_chr_na()", #> "is_cpl_na()"), arg_match.Rd = "arg_match()", as_box.Rd = c("as_box()", #> "as_box_if()"), as_bytes.Rd = "as_bytes()", as_data_mask.Rd = c("as_data_mask()", #> "as_data_pronoun()", "new_data_mask()"), as_env.Rd = "as_env()", #> as_environment.Rd = "as_environment()", as_function.Rd = c("as_function()", #> "is_lambda()", "as_closure()"), as_label.Rd = "as_label()", #> as_name.Rd = "as_name()", as_overscope.Rd = c("as_overscope()", #> "new_overscope()", "overscope_clean()"), as_pairlist.Rd = "as_pairlist()", #> as_quosure.Rd = c("as_quosure()", "new_quosure()"), as_string.Rd = "as_string()", #> as_utf8_character.Rd = "as_utf8_character()", `bare-type-predicates.Rd` = c("is_bare_list()", #> "is_bare_atomic()", "is_bare_vector()", "is_bare_double()", #> "is_bare_integer()", "is_bare_numeric()", "is_bare_character()", #> "is_bare_logical()", "is_bare_raw()", "is_bare_string()", #> "is_bare_bytes()"), box.Rd = c("new_box()", "is_box()", #> "unbox()"), call2.Rd = "call2()", call_args.Rd = c("call_args()", #> "call_args_names()"), call_fn.Rd = "call_fn()", call_inspect.Rd = "call_inspect()", #> call_modify.Rd = "call_modify()", call_name.Rd = c("call_name()", #> "call_ns()"), call_standardise.Rd = "call_standardise()", #> caller_env.Rd = c("caller_env()", "current_env()"), caller_fn.Rd = c("caller_fn()", #> "current_fn()"), caller_frame.Rd = "caller_frame()", #> catch_cnd.Rd = "catch_cnd()", chr_unserialise_unicode.Rd = "chr_unserialise_unicode()", #> cnd.Rd = c("error_cnd()", "cnd()", "warning_cnd()", "message_cnd()" #> ), cnd_message.Rd = c("cnd_message()", "cnd_issue()", #> "cnd_bullets()"), cnd_muffle.Rd = "cnd_muffle()", cnd_signal.Rd = "cnd_signal()", #> cnd_type.Rd = "cnd_type()", done.Rd = c("done()", "is_done_box()" #> ), dots_definitions.Rd = "dots_definitions()", dots_n.Rd = "dots_n()", #> dots_values.Rd = "dots_values()", duplicate.Rd = "duplicate()", #> empty_env.Rd = "empty_env()", entrace.Rd = c("entrace()", #> "cnd_entrace()"), env.Rd = c("env()", "child_env()", #> "new_environment()"), env_bind.Rd = c("env_bind()", "env_bind_lazy()", #> "env_bind_active()"), env_bind_exprs.Rd = c("env_bind_exprs()", #> "env_bind_fns()"), env_binding_are_active.Rd = c("env_binding_are_active()", #> "env_binding_are_lazy()"), env_binding_lock.Rd = c("env_binding_lock()", #> "env_binding_unlock()", "env_binding_are_locked()"), #> env_bury.Rd = "env_bury()", env_clone.Rd = "env_clone()", #> env_depth.Rd = "env_depth()", env_get.Rd = c("env_get()", #> "env_get_list()"), env_has.Rd = "env_has()", env_inherits.Rd = "env_inherits()", #> env_lock.Rd = c("env_lock()", "env_is_locked()"), env_name.Rd = c("env_name()", #> "env_label()"), env_names.Rd = c("env_names()", "env_length()" #> ), env_parent.Rd = c("env_parent()", "env_tail()", "env_parents()" #> ), env_poke.Rd = "env_poke()", env_print.Rd = "env_print()", #> env_unbind.Rd = "env_unbind()", env_unlock.Rd = "env_unlock()", #> eval_bare.Rd = "eval_bare()", eval_tidy.Rd = "eval_tidy()", #> exec.Rd = "exec()", exiting.Rd = "exiting()", expr_interp.Rd = "expr_interp()", #> expr_label.Rd = c("expr_label()", "expr_name()", "expr_text()" #> ), expr_print.Rd = c("expr_print()", "expr_deparse()" #> ), exprs_auto_name.Rd = c("exprs_auto_name()", "quos_auto_name()" #> ), f_rhs.Rd = c("f_rhs()", "`f_rhs<-`()", "f_lhs()", #> "`f_lhs<-`()", "f_env()", "`f_env<-`()"), f_text.Rd = c("f_text()", #> "f_name()", "f_label()"), flatten.Rd = c("flatten()", #> "flatten_lgl()", "flatten_int()", "flatten_dbl()", "flatten_cpl()", #> "flatten_chr()", "flatten_raw()", "squash()", "squash_lgl()", #> "squash_int()", "squash_dbl()", "squash_cpl()", "squash_chr()", #> "squash_raw()", "flatten_if()", "squash_if()"), fn_body.Rd = c("fn_body()", #> "`fn_body<-`()"), fn_env.Rd = c("fn_env()", "`fn_env<-`()" #> ), fn_fmls.Rd = c("fn_fmls()", "fn_fmls_names()", "fn_fmls_syms()", #> "`fn_fmls<-`()", "`fn_fmls_names<-`()"), frame_position.Rd = "frame_position()", #> friendly_type.Rd = "friendly_type()", get_env.Rd = c("get_env()", #> "set_env()", "env_poke_parent()"), has_length.Rd = "has_length()", #> has_name.Rd = "has_name()", inherits_any.Rd = c("inherits_any()", #> "inherits_all()", "inherits_only()"), invoke.Rd = "invoke()", #> is_call.Rd = "is_call()", is_callable.Rd = "is_callable()", #> is_condition.Rd = "is_condition()", is_copyable.Rd = "is_copyable()", #> is_empty.Rd = "is_empty()", is_env.Rd = c("is_env()", #> "is_bare_env()"), is_environment.Rd = c("is_environment()", #> "is_bare_environment()"), is_expr.Rd = "is_expr()", is_expression.Rd = c("is_expression()", #> "is_syntactic_literal()", "is_symbolic()"), is_formula.Rd = c("is_formula()", #> "is_bare_formula()"), is_frame.Rd = "is_frame()", is_function.Rd = c("is_function()", #> "is_closure()", "is_primitive()", "is_primitive_eager()", #> "is_primitive_lazy()"), is_installed.Rd = "is_installed()", #> is_integerish.Rd = c("is_integerish()", "is_bare_integerish()", #> "is_scalar_integerish()"), is_interactive.Rd = c("is_interactive()", #> "scoped_interactive()", "with_interactive()"), is_lang.Rd = c("is_lang()", #> "is_unary_lang()", "is_binary_lang()", "quo_is_lang()" #> ), is_named.Rd = c("is_named()", "is_dictionaryish()", #> "have_name()"), is_namespace.Rd = "is_namespace()", is_pairlist.Rd = c("is_pairlist()", #> "is_node()", "is_node_list()"), is_reference.Rd = "is_reference()", #> is_stack.Rd = c("is_stack()", "is_eval_stack()", "is_call_stack()" #> ), is_symbol.Rd = "is_symbol()", is_true.Rd = c("is_true()", #> "is_false()"), is_weakref.Rd = "is_weakref()", lang.Rd = c("lang()", #> "new_language()"), lang_head.Rd = c("lang_head()", "lang_tail()" #> ), lang_modify.Rd = c("lang_modify()", "lang_standardise()", #> "lang_fn()", "lang_name()", "lang_args()", "lang_args_names()" #> ), last_error.Rd = c("last_error()", "last_trace()"), #> lifecycle.Rd = character(0), missing.Rd = c("na_lgl", #> "na_int", "na_dbl", "na_chr", "na_cpl"), missing_arg.Rd = c("missing_arg()", #> "is_missing()", "maybe_missing()"), mut_node_car.Rd = c("mut_node_car()", #> "mut_node_cdr()", "mut_node_caar()", "mut_node_cadr()", #> "mut_node_cdar()", "mut_node_cddr()", "mut_node_tag()" #> ), names2.Rd = "names2()", `new-vector-along-retired.Rd` = c("new_logical_along()", #> "new_integer_along()", "new_double_along()", "new_character_along()", #> "new_complex_along()", "new_raw_along()", "new_list_along()" #> ), `new-vector.Rd` = c("new_logical()", "new_integer()", #> "new_double()", "new_character()", "new_complex()", "new_raw()", #> "new_list()"), new_call.Rd = "new_call()", new_formula.Rd = "new_formula()", #> new_function.Rd = "new_function()", new_node.Rd = c("new_node()", #> "node_car()", "node_cdr()", "node_caar()", "node_cadr()", #> "node_cdar()", "node_cddr()", "node_poke_car()", "node_poke_cdr()", #> "node_poke_caar()", "node_poke_cadr()", "node_poke_cdar()", #> "node_poke_cddr()", "node_tag()", "node_poke_tag()"), #> new_quosures.Rd = c("new_quosures()", "as_quosures()", #> "is_quosures()"), new_weakref.Rd = "new_weakref()", ns_env.Rd = c("ns_env()", #> "ns_imports_env()", "ns_env_name()"), `op-definition.Rd` = c("is_definition()", #> "new_definition()", "is_formulaish()"), `op-get-attr.Rd` = c("`%@%`", #> "`%@%<-`()"), `op-na-default.Rd` = "`%|%`", `op-null-default.Rd` = "`%||%`", #> overscope_eval_next.Rd = "overscope_eval_next()", pairlist2.Rd = "pairlist2()", #> parse_expr.Rd = c("parse_expr()", "parse_exprs()", "parse_quo()", #> "parse_quos()"), parse_quosure.Rd = c("parse_quosure()", #> "parse_quosures()"), prepend.Rd = c("prepend()", "modify()" #> ), prim_name.Rd = "prim_name()", quasiquotation.Rd = "qq_show()", #> quo_expr.Rd = "quo_expr()", quo_label.Rd = c("quo_label()", #> "quo_text()", "quo_name()"), quo_squash.Rd = "quo_squash()", #> quosure.Rd = c("is_quosure()", "quo_is_missing()", "quo_is_symbol()", #> "quo_is_call()", "quo_is_symbolic()", "quo_is_null()", #> "quo_get_expr()", "quo_get_env()", "quo_set_expr()", #> "quo_set_env()"), quotation.Rd = c("expr()", "enexpr()", #> "exprs()", "enexprs()", "ensym()", "ensyms()", "quo()", #> "enquo()", "quos()", "enquos()"), rep_along.Rd = c("rep_along()", #> "rep_named()"), restarting.Rd = "restarting()", return_from.Rd = c("return_from()", #> "return_to()"), rlang_backtrace_on_error.Rd = character(0), #> rst_abort.Rd = "rst_abort()", rst_list.Rd = c("rst_list()", #> "rst_exists()", "rst_jump()", "rst_maybe_jump()"), `scalar-type-predicates.Rd` = c("is_scalar_list()", #> "is_scalar_atomic()", "is_scalar_vector()", "is_scalar_integer()", #> "is_scalar_double()", "is_scalar_character()", "is_scalar_logical()", #> "is_scalar_raw()", "is_string()", "is_scalar_bytes()", #> "is_bool()"), scoped_bindings.Rd = c("scoped_bindings()", #> "with_bindings()"), scoped_env.Rd = c("scoped_env()", #> "is_scoped()", "scoped_envs()", "scoped_names()"), scoped_options.Rd = c("scoped_options()", #> "with_options()", "push_options()", "peek_options()", #> "peek_option()"), search_envs.Rd = c("search_envs()", #> "search_env()", "pkg_env()", "pkg_env_name()", "is_attached()", #> "base_env()", "global_env()"), seq2.Rd = c("seq2()", #> "seq2_along()"), set_attrs.Rd = c("set_attrs()", "mut_attrs()" #> ), set_expr.Rd = c("set_expr()", "get_expr()"), set_names.Rd = "set_names()", #> splice.Rd = c("splice()", "is_spliced()", "is_spliced_bare()", #> "dots_splice()"), stack.Rd = c("global_frame()", "current_frame()", #> "ctxt_frame()", "call_frame()", "ctxt_depth()", "call_depth()", #> "ctxt_stack()", "call_stack()"), stack_trim.Rd = "stack_trim()", #> string.Rd = "string()", switch_type.Rd = c("switch_type()", #> "coerce_type()", "switch_class()", "coerce_class()"), #> sym.Rd = c("sym()", "syms()"), `tidy-dots.Rd` = c("dots_list()", #> "list2()"), `tidyeval-data.Rd` = ".data", trace_back.Rd = c("trace_back()", #> "trace_length()"), `type-predicates.Rd` = c("is_list()", #> "is_atomic()", "is_vector()", "is_integer()", "is_double()", #> "is_character()", "is_logical()", "is_raw()", "is_bytes()", #> "is_null()"), type_of.Rd = "type_of()", vec_poke_n.Rd = c("vec_poke_n()", #> "vec_poke_range()"), `vector-coercion.Rd` = c("as_logical()", #> "as_integer()", "as_double()", "as_complex()", "as_character()", #> "as_list()"), `vector-construction.Rd` = c("lgl()", "int()", #> "dbl()", "cpl()", "chr()", "bytes()"), `vector-old-ctors.Rd` = c("node()", #> "lgl_len()", "int_len()", "dbl_len()", "chr_len()", "cpl_len()", #> "raw_len()", "bytes_len()", "list_len()", "lgl_along()", #> "int_along()", "dbl_along()", "chr_along()", "cpl_along()", #> "raw_along()", "bytes_along()", "list_along()"), with_abort.Rd = "with_abort()", #> with_env.Rd = c("with_env()", "locally()"), with_handlers.Rd = c("with_handlers()", #> "calling()"), with_restarts.Rd = "with_restarts()", wref_key.Rd = c("wref_key()", #> "wref_value()"), zap.Rd = c("zap()", "is_zap()")), title = c("Signal an error, warning, or message", #> "Test for missing values", "Match an argument to a character vector", #> "Convert object to a box", "Coerce to a raw vector", "Create a data mask", #> "Coerce to an environment", "Coerce to an environment", "Convert to function or closure", #> "Create a default name for an R object", "Extract names from symbols", #> "Create an overscope", "Coerce to pairlist", "Coerce object to quosure", #> "Cast symbol to string", "Coerce to a character vector and attempt encoding conversion", #> "Bare type predicates", "Box a value", "Create a call", "Extract arguments from a call", #> "Extract function from a call", "Inspect a call", "Modify the arguments of a call", #> "Extract function name or namespaced of a call", "Standardise a call", #> "Get the current or caller environment", "Get properties of the current or caller frame", #> "Get caller frame", "Catch a condition", "Translate unicode points to UTF-8", #> "Create a condition object", "Build an error message from a main issue and bullet messages", #> "Muffle a condition", "Signal a condition object", "What type is a condition?", #> "Box a final value for early termination", "Capture definition objects", #> "How many arguments are currently forwarded in dots?", "Evaluate dots with preliminary splicing", #> "Duplicate an R object", "Get the empty environment", "Add backtrace from error handler", #> "Create a new environment", "Bind symbols to objects in an environment", #> "Bind a promise or active binding", "What kind of environment binding?", #> "Lock or unlock environment bindings", "Mask bindings by defining symbols deeper in a scope", #> "Clone an environment", "Depth of an environment chain", #> "Get an object in an environment", "Does an environment have or see bindings?", #> "Does environment inherit from another environment?", "Lock an environment", #> "Label of an environment", "Names and numbers of symbols bound in an environment", #> "Get parent environments", "Poke an object in an environment", #> "Pretty-print an environment", "Remove bindings from an environment", #> "Unlock an environment", "Evaluate an expression in an environment", #> "Evaluate an expression with quosures and pronoun support", #> "Execute a function", "Exiting handler", "Process unquote operators in a captured expression", #> "Turn an expression to a label", "Print an expression", "Ensure that all elements of a list of expressions are named", #> "Get or set formula components", "Turn RHS of formula into a string or label", #> "Flatten or squash a list of lists into a simpler vector", #> "Get or set function body", "Return the closure environment of a function", #> "Extract arguments from a function", "Find the position or distance of a frame on the evaluation stack", #> "Format a type for error messages", "Get or set the environment of an object", #> "How long is an object?", "Does an object have an element with this name?", #> "Does an object inherit from a set of classes?", "Invoke a function with a list of arguments", #> "Is object a call?", "Is an object callable?", "Is object a condition?", #> "Is an object copyable?", "Is object an empty vector or NULL?", #> "Is an object an environment?", "Is object an environment?", #> "Is an object an expression?", "Is an object an expression?", #> "Is object a formula?", "Is object a frame?", "Is object a function?", #> "Is a package installed in the library?", "Is a vector integer-like?", #> "Is R running interactively?", "Is object a call?", "Is object named?", #> "Is an object a namespace environment?", "Is object a node or pairlist?", #> "Is an object referencing another?", "Is object a stack?", #> "Is object a symbol?", "Is object identical to TRUE or FALSE?", #> "Is object a weak reference?", "Create a call", "Return the head or tail of a call", #> "Manipulate or access a call", "Last <code>abort()</code> error", #> "Life cycle of the rlang package", "Missing values", "Generate or handle a missing argument", #> "Mutate node components", "Get names of a vector", "Create vectors matching the length of a given vector", #> "Create vectors matching a given length", "Create a new call from components", #> "Create a formula", "Create a function", "Helpers for pairlist and language nodes", #> "Create a list of quosures", "Create a weak reference", "Get the namespace of a package", #> "Definition operator", "Infix attribute accessor and setter", #> "Replace missing values", "Default value for <code>NULL</code>", #> "Evaluate next quosure in a data mask", "Create pairlists with splicing support", #> "Parse R code", "Parse text into a quosure", "Prepend a vector", #> "Name of a primitive function", "Quasiquotation of an expression", #> "Squash a quosure", "Format quosures for printing or labelling", #> "Squash a quosure", "Quosure getters, setters and testers", #> "Quotation", "Create vectors matching the length of a given vector", #> "Create a restarting handler", "Jump to or from a frame", #> "Display backtrace on error", "Jump to the abort restart", #> "Restarts utilities", "Scalar type predicates", "Temporarily change bindings of an environment", #> "Retired <code>scoped</code> functions", "Change global options", #> "Search path environments", "Increasing sequence of integers in an interval", #> "Add attributes to an object", "Set and get an expression", #> "Set names of a vector", "Splice lists", "Call stack information", #> "Trim top call layers from the evaluation stack", "Create a string", #> "Dispatch on base types", "Create a symbol or list of symbols", #> "Collect dots tidily", "Data pronoun for tidy evaluation", #> "Capture a backtrace", "Type predicates", "Base type of an object", #> "Poke values into a vector", "Coerce an object to a base type", #> "Create vectors", "Retired vector construction by length", #> "Promote all errors to rlang errors", "Evaluate an expression within a given environment", #> "Establish handlers on the stack", "Establish a restart point on the stack", #> "Get key/value from a weak reference object", "Create zap objects" #> ), rd = list(abort.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-abort.R, R/cnd-signal.R", #> "\n", list("abort"), "\n", list("abort"), "\n", list( #> "warn"), "\n", list("inform"), "\n", list("signal"), #> "\n", list("interrupt"), "\n", list("Signal an error, warning, or message"), #> "\n", list("\n", "abort(message = \"\", .subclass = NULL, ..., trace = NULL,\n", #> " call = NULL, parent = NULL, msg, type)\n", "\n", #> "warn(message, .subclass = NULL, ..., call = NULL, msg, type)\n", #> "\n", "inform(message, .subclass = NULL, ..., call = NULL, msg, type)\n", #> "\n", "signal(message, .subclass, ...)\n", "\n", #> "interrupt()\n"), "\n", list("\n", list(list("message"), #> list("The message to display.")), "\n", "\n", list( #> list(".subclass"), list("Subclass of the condition. This allows your users\n", #> "to selectively handle the conditions signalled by your functions.")), #> "\n", "\n", list(list("..."), list("Additional data to be stored in the condition object.")), #> "\n", "\n", list(list("trace"), list("A ", list("trace"), #> " object created by ", list(list("trace_back()")), #> ".")), "\n", "\n", list(list("call"), list("Defunct as of rlang 0.4.0. Storing the full\n", #> "backtrace is now preferred to storing a simple call.")), #> "\n", "\n", list(list("parent"), list("A parent condition object created by ", #> list(list("abort()")), ".")), "\n", "\n", list( #> list("msg, type"), list("These arguments were renamed to ", #> list("message"), " and\n", list(".subclass"), #> " and are defunct as of rlang 0.4.0.")), "\n"), #> "\n", list("\n", "These functions are equivalent to base functions ", #> list(list("base::stop()")), ",\n", list(list("base::warning()")), #> " and ", list(list("base::message()")), ", but make it easy to supply\n", #> "condition metadata:\n", list("\n", list(), " Supply ", #> list(".subclass"), " to create a classed condition. Typed\n", #> "conditions can be captured or handled selectively, allowing for\n", #> "finer-grained error handling.\n", list(), " Supply metadata with named ", #> list("..."), " arguments. This data will be\n", #> "stored in the condition object and can be examined by handlers.\n"), #> "\n", "\n", list("interrupt()"), " allows R code to simulate a user interrupt of the\n", #> "kind that is signalled with ", list("Ctrl-C"), ". It is currently not possible\n", #> "to create custom interrupt condition objects.\n"), #> "\n", list(list("Backtrace"), list("\n", "\n", "\n", #> "Unlike ", list("stop()"), " and ", list("warning()"), #> ", these functions don't include call\n", "information by default. This saves you from typing ", #> list("call. = FALSE"), "\n", "and produces cleaner error messages.\n", #> "\n", "A backtrace is always saved into error objects. You can print a\n", #> "simplified backtrace of the last error by calling ", #> list(list("last_error()")), "\n", "and a full backtrace with ", #> list("summary(last_error())"), ".\n", "\n", "You can also display a backtrace with the error message by setting\n", #> "the option ", list("rlang_backtrace_on_error"), #> ". It supports the following\n", "values:\n", list( #> "\n", list(), " ", list("\"reminder\""), ": Invite users to call ", #> list("rlang::last_error()"), " to see a\n", "backtrace.\n", #> list(), " ", list("\"branch\""), ": Display a simplified backtrace.\n", #> list(), " ", list("\"collapse\""), ": Display a collapsed backtrace tree.\n", #> list(), " ", list("\"full\""), ": Display a full backtrace tree.\n", #> list(), " ", list("\"none\""), ": Display nothing.\n"), #> "\n")), "\n", "\n", list(list("Mufflable conditions"), #> list("\n", "\n", "\n", "Signalling a condition with ", #> list("inform()"), " or ", list("warn()"), " causes a message\n", #> "to be displayed in the console. These messages can be muffled with\n", #> list(list("base::suppressMessages()")), " or ", #> list(list("base::suppressWarnings()")), ".\n", #> "\n", "On recent R versions (>= R 3.5.0), interrupts are typically\n", #> "signalled with a ", list("\"resume\""), " restart. This is however not\n", #> "guaranteed.\n")), "\n", "\n", list(list("Lifecycle"), #> list("\n", "\n", "\n", "These functions were changed in rlang 0.3.0 to take condition\n", #> "metadata with ", list("..."), ". Consequently:\n", #> list("\n", list(), " All arguments were renamed to be prefixed with a dot, except for\n", #> list("type"), " which was renamed to ", list( #> ".subclass"), ".\n", list(), " ", list(".call"), #> " (previously ", list("call"), ") can no longer be passed positionally.\n"), #> "\n")), "\n", "\n", list("\n", "# These examples are guarded to avoid throwing errors\n", #> "if (FALSE) {\n", "\n", "# Signal an error with a message just like stop():\n", #> "abort(\"Something bad happened\")\n", "\n", "# Give a class to the error:\n", #> "abort(\"Something bad happened\", \"somepkg_bad_error\")\n", #> "\n", "# This will allow your users to handle the error selectively\n", #> "tryCatch(\n", " somepkg_function(),\n", " somepkg_bad_error = function(err) {\n", #> " warn(err$message) # Demote the error to a warning\n", #> " NA # Return an alternative value\n", #> " }\n", ")\n", "\n", "# You can also specify metadata that will be stored in the condition:\n", #> "abort(\"Something bad happened\", \"somepkg_bad_error\", data = 1:10)\n", #> "\n", "# This data can then be consulted by user handlers:\n", #> "tryCatch(\n", " somepkg_function(),\n", " somepkg_bad_error = function(err) {\n", #> " # Compute an alternative return value with the data:\n", #> " recover_error(err$data)\n", " }\n", ")\n", #> "\n", "# If you call low-level APIs it is good practice to catch technical\n", #> "# errors and rethrow them with a more meaningful message. Pass on\n", #> "# the caught error as `parent` to get a nice decomposition of\n", #> "# errors and backtraces:\n", "file <- \"http://foo.bar/baz\"\n", #> "tryCatch(\n", " download(file),\n", " error = function(err) {\n", #> " msg <- sprintf(\"Can't download `%s`\", file)\n", #> " abort(msg, parent = err)\n", "})\n", "\n", "# Unhandled errors are saved automatically by `abort()` and can be\n", #> "# retrieved with `last_error()`. The error prints with a simplified\n", #> "# backtrace:\n", "abort(\"Saved error?\")\n", "last_error()\n", #> "\n", "# Use `summary()` to print the full backtrace and the condition fields:\n", #> "summary(last_error())\n", "\n", "}\n"), "\n", list( #> "\n", list(list("with_abort()")), " to convert all errors to rlang errors.\n"), #> "\n"), are_na.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-na.R", "\n", #> list("are_na"), "\n", list("are_na"), "\n", list("is_na"), #> "\n", list("is_lgl_na"), "\n", list("is_int_na"), "\n", #> list("is_dbl_na"), "\n", list("is_chr_na"), "\n", list( #> "is_cpl_na"), "\n", list("Test for missing values"), #> "\n", list("\n", "are_na(x)\n", "\n", "is_na(x)\n", "\n", #> "is_lgl_na(x)\n", "\n", "is_int_na(x)\n", "\n", "is_dbl_na(x)\n", #> "\n", "is_chr_na(x)\n", "\n", "is_cpl_na(x)\n"), #> "\n", list("\n", list(list("x"), list("An object to test")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("are_na()"), " checks for missing values in a vector and is equivalent\n", #> "to ", list(list("base::is.na()")), ". It is a vectorised predicate, meaning that its\n", #> "output is always the same length as its input. On the other hand,\n", #> list("is_na()"), " is a scalar predicate and always returns a scalar\n", #> "boolean, ", list("TRUE"), " or ", list("FALSE"), #> ". If its input is not scalar, it returns\n", list( #> "FALSE"), ". Finally, there are typed versions that check for\n", #> "particular ", list("missing types"), ".\n"), "\n", #> list("\n", "The scalar predicates accept non-vector inputs. They are equivalent\n", #> "to ", list(list("is_null()")), " in that respect. In contrast the vectorised\n", #> "predicate ", list("are_na()"), " requires a vector input since it is defined\n", #> "over vector values.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "These functions might be moved to the vctrs package at some\n", #> "point. This is why they are marked as questioning.\n")), #> "\n", "\n", list("\n", "# are_na() is vectorised and works regardless of the type\n", #> "are_na(c(1, 2, NA))\n", "are_na(c(1L, NA, 3L))\n", #> "\n", "# is_na() checks for scalar input and works for all types\n", #> "is_na(NA)\n", "is_na(na_dbl)\n", "is_na(character(0))\n", #> "\n", "# There are typed versions as well:\n", "is_lgl_na(NA)\n", #> "is_lgl_na(na_dbl)\n"), "\n"), arg_match.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/arg.R", "\n", list( #> "arg_match"), "\n", list("arg_match"), "\n", list( #> "Match an argument to a character vector"), "\n", #> list("\n", "arg_match(arg, values = NULL)\n"), "\n", #> list("\n", list(list("arg"), list("A symbol referring to an argument accepting strings.")), #> "\n", "\n", list(list("values"), list("The possible values that ", #> list("arg"), " can take. If ", list("NULL"), #> ",\n", "the values are taken from the function definition of the ", #> list("caller frame"), ".")), "\n"), "\n", list( #> "\n", "The string supplied to ", list("arg"), ".\n"), #> "\n", list("\n", "This is equivalent to ", list(list( #> "base::match.arg()")), " with a few differences:\n", #> list("\n", list(), " Partial matches trigger an error.\n", #> list(), " Error messages are a bit more informative and obey the tidyverse\n", #> "standards.\n"), "\n"), "\n", list("\n", "fn <- function(x = c(\"foo\", \"bar\")) arg_match(x)\n", #> "fn(\"bar\")\n", "\n", "# This would throw an informative error if run:\n", #> "# fn(\"b\")\n", "# fn(\"baz\")\n"), "\n"), as_box.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/s3.R", "\n", list("as_box"), #> "\n", list("as_box"), "\n", list("as_box_if"), "\n", #> list("Convert object to a box"), "\n", list("\n", "as_box(x, class = NULL)\n", #> "\n", "as_box_if(.x, .p, .class = NULL, ...)\n"), #> "\n", list("\n", list(list("x"), list("An R object.")), #> "\n", "\n", list(list("class, .class"), list("A box class. If the input is already a box of\n", #> "that class, it is returned as is. If the input needs to be boxed,\n", #> list("class"), " is passed to ", list(list("new_box()")), #> ".")), "\n", "\n", list(list(".x"), list("An R object.")), #> "\n", "\n", list(list(".p"), list("A predicate function.")), #> "\n", "\n", list(list("..."), list("Arguments passed to ", #> list(".p"), ".")), "\n"), "\n", list("\n", list( #> "\n", list(), " ", list("as_box()"), " boxes its input only if it is not already a box. The\n", #> "class is also checked if supplied.\n", list(), " ", #> list("as_box_if()"), " boxes its input only if it not already a box, or if\n", #> "the predicate ", list(".p"), " returns ", list("TRUE"), #> ".\n"), "\n"), "\n"), as_bytes.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/utils-encoding.R", #> "\n", list("as_bytes"), "\n", list("as_bytes"), "\n", #> list("Coerce to a raw vector"), "\n", list("\n", "as_bytes(x)\n"), #> "\n", list("\n", list(list("x"), list("A string.")), #> "\n"), "\n", list("\n", "A raw vector of bytes.\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "This currently only works with strings, and returns its hexadecimal\n", #> "representation.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "Raw vector functions are experimental.\n")), #> "\n", "\n", list("internal"), "\n"), as_data_mask.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/eval-tidy.R", "\n", #> list("as_data_mask"), "\n", list("as_data_mask"), "\n", #> list("as_data_pronoun"), "\n", list("new_data_mask"), #> "\n", list("Create a data mask"), "\n", list("\n", "as_data_mask(data, parent = NULL)\n", #> "\n", "as_data_pronoun(data)\n", "\n", "new_data_mask(bottom, top = bottom, parent = NULL)\n"), #> "\n", list("\n", list(list("data"), list("A data frame or named vector of masking data.")), #> "\n", "\n", list(list("parent"), list("Deprecated. This argument no longer has any effect.\n", #> "The parent of the data mask is determined from either:\n", #> list("\n", list(), " The ", list("env"), " argument of ", #> list("eval_tidy()"), "\n", list(), " Quosure environments when applicable\n"))), #> "\n", "\n", list(list("bottom"), list("The environment containing masking objects if the\n", #> "data mask is one environment deep. The bottom environment if the\n", #> "data mask comprises multiple environment.\n", #> "\n", "If you haven't supplied ", list("top"), #> ", this ", list("must"), " be an environment\n", #> "that you own, i.e. that you have created yourself.")), #> "\n", "\n", list(list("top"), list("The last environment of the data mask. If the data mask\n", #> "is only one environment deep, ", list("top"), #> " should be the same as\n", list("bottom"), ".\n", #> "\n", "This ", list("must"), " be an environment that you own, i.e. that you have\n", #> "created yourself. The parent of ", list("top"), #> " will be changed by the tidy\n", "eval engine and should be considered undetermined. Never make\n", #> "assumption about the parent of ", list("top"), #> ".")), "\n"), "\n", list("\n", "A data mask that you can supply to ", #> list(list("eval_tidy()")), ".\n"), "\n", list("\n", #> list("rlang:::lifecycle(\"stable\")"), "\n", "\n", #> "A data mask is an environment (or possibly multiple environments\n", #> "forming an ancestry) containing user-supplied objects. Objects in\n", #> "the mask have precedence over objects in the environment (i.e. they\n", #> "mask those objects). Many R functions evaluate quoted expressions\n", #> "in a data mask so these expressions can refer to objects within the\n", #> "user data.\n", "\n", "These functions let you construct a tidy eval data mask manually.\n", #> "They are meant for developers of tidy eval interfaces rather than\n", #> "for end users.\n"), "\n", list(list("Why build a data mask?"), #> list("\n", "\n", "\n", "Most of the time you can just call ", #> list(list("eval_tidy()")), " with a list or a\n", #> "data frame and the data mask will be constructed automatically.\n", #> "There are three main use cases for manual creation of data masks:\n", #> list("\n", list(), " When ", list(list("eval_tidy()")), #> " is called with the same data in a tight loop.\n", #> "Because there is some overhead to creating tidy eval data masks,\n", #> "constructing the mask once and reusing it for subsequent\n", #> "evaluations may improve performance.\n", list(), #> " When several expressions should be evaluated in the exact same\n", #> "environment because a quoted expression might create new objects\n", #> "that can be referred in other quoted expressions evaluated at a\n", #> "later time. One example of this is ", list( #> "tibble::lst()"), " where new\n", "columns can refer to previous ones.\n", #> list(), " When your data mask requires special features. For instance the\n", #> "data frame columns in dplyr data masks are implemented with\n", #> list("active bindings"), ".\n"), "\n")), "\n", #> "\n", list(list("Building your own data mask"), list( #> "\n", "\n", "\n", "Unlike ", list(list("base::eval()")), #> " which takes any kind of environments as data\n", #> "mask, ", list(list("eval_tidy()")), " has specific requirements in order to support\n", #> list("quosures"), ". For this reason you can't supply bare\n", #> "environments.\n", "\n", "There are two ways of constructing an rlang data mask manually:\n", #> list("\n", list(), " ", list("as_data_mask()"), " transforms a list or data frame to a data mask.\n", #> "It automatically installs the data pronoun ", #> list(list(".data")), ".\n", list(), " ", list( #> "new_data_mask()"), " is a bare bones data mask constructor for\n", #> "environments. You can supply a bottom and a top environment in\n", #> "case your data mask comprises multiple environments (see section\n", #> "below).\n", "\n", "Unlike ", list("as_data_mask()"), #> " it does not install the ", list(".data"), " pronoun\n", #> "so you need to provide one yourself. You can provide a pronoun\n", #> "constructed with ", list("as_data_pronoun()"), #> " or your own pronoun class.\n", "\n", list("as_data_pronoun()"), #> " will create a pronoun from a list, an\n", "environment, or an rlang data mask. In the latter case, the whole\n", #> "ancestry is looked up from the bottom to the top of the mask.\n", #> "Functions stored in the mask are bypassed by the pronoun.\n"), #> "\n", "\n", "Once you have built a data mask, simply pass it to ", #> list(list("eval_tidy()")), " as\n", "the ", list( #> "data"), " argument. You can repeat this as many times as\n", #> "needed. Note that any objects created there (perhaps because of a\n", #> "call to ", list("<-"), ") will persist in subsequent evaluations.\n")), #> "\n", "\n", list(list("Top and bottom of data mask"), #> list("\n", "\n", "\n", "In some cases you'll need several levels in your data mask. One\n", #> "good reason is when you include functions in the mask. It's a good\n", #> "idea to keep data objects one level lower than function objects, so\n", #> "that the former cannot override the definitions of the latter (see\n", #> "examples).\n", "\n", "In that case, set up all your environments and keep track of the\n", #> "bottom child and the top parent. You'll need to pass both to\n", #> list("new_data_mask()"), ".\n", "\n", "Note that the parent of the top environment is completely\n", #> "undetermined, you shouldn't expect it to remain the same at all\n", #> "times. This parent is replaced during evaluation by ", #> list(list("eval_tidy()")), "\n", "to one of the following environments:\n", #> list("\n", list(), " The default environment passed as the ", #> list("env"), " argument of ", list("eval_tidy()"), #> ".\n", list(), " The environment of the current quosure being evaluated, if applicable.\n"), #> "\n", "\n", "Consequently, all masking data should be contained between the\n", #> "bottom and top environment of the data mask.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> "\n", "The ", list("parent"), " argument no longer has any effect and is defunct as of\n", #> "rlang 0.4.0. The parent of the data mask is determined from either:\n", #> list("\n", list(), " The ", list("env"), " argument of ", #> list("eval_tidy()"), "\n", list(), " Quosure environments when applicable\n"), #> "\n", "\n", "Passing environments to ", list("as_data_mask()"), #> " is deprecated as of rlang\n", "0.3.0. Please use ", #> list("new_data_mask()"), " instead.\n", "\n", list( #> "rlang 0.2.0"), "\n", "\n", "In early versions of rlang data masks were called overscopes. We\n", #> "think data mask is a more natural name in R. It makes reference to\n", #> "masking in the search path which occurs through the same mechanism\n", #> "(in technical terms, lexical scoping with hierarchically nested\n", #> "environments). We say that objects from user data mask objects\n", #> "in the current environment.\n", "\n", "Following this change in terminology, ", #> list("as_overscope()"), " and\n", list("new_overscope()"), #> " were deprecated in rlang 0.2.0 in favour of\n", #> list("as_data_mask()"), " and ", list("new_data_mask()"), #> ".\n")), "\n", "\n", list("\n", "# Evaluating in a tidy evaluation environment enables all tidy\n", #> "# features:\n", "mask <- as_data_mask(mtcars)\n", #> "eval_tidy(quo(letters), mask)\n", "\n", "# You can install new pronouns in the mask:\n", #> "mask$.pronoun <- as_data_pronoun(list(foo = \"bar\", baz = \"bam\"))\n", #> "eval_tidy(quo(.pronoun$foo), mask)\n", "\n", "# In some cases the data mask can leak to the user, for example if\n", #> "# a function or formula is created in the data mask environment:\n", #> "cyl <- \"user variable from the context\"\n", "fn <- eval_tidy(quote(function() cyl), mask)\n", #> "fn()\n", "\n", "# If new objects are created in the mask, they persist in the\n", #> "# subsequent calls:\n", "eval_tidy(quote(new <- cyl + am), mask)\n", #> "eval_tidy(quote(new * 2), mask)\n", "\n", "\n", #> "# In some cases your data mask is a whole chain of environments\n", #> "# rather than a single environment. You'll have to use\n", #> "# `new_data_mask()` and let it know about the bottom of the mask\n", #> "# (the last child of the environment chain) and the topmost parent.\n", #> "\n", "# A common situation where you'll want a multiple-environment mask\n", #> "# is when you include functions in your mask. In that case you'll\n", #> "# put functions in the top environment and data in the bottom. This\n", #> "# will prevent the data from overwriting the functions.\n", #> "top <- new_environment(list(`+` = base::paste, c = base::paste))\n", #> "\n", "# Let's add a middle environment just for sport:\n", #> "middle <- env(top)\n", "\n", "# And finally the bottom environment containing data:\n", #> "bottom <- env(middle, a = \"a\", b = \"b\", c = \"c\")\n", #> "\n", "# We can now create a mask by supplying the top and bottom\n", #> "# environments:\n", "mask <- new_data_mask(bottom, top = top)\n", #> "\n", "# This data mask can be passed to eval_tidy() instead of a list or\n", #> "# data frame:\n", "eval_tidy(quote(a + b + c), data = mask)\n", #> "\n", "# Note how the function `c()` and the object `c` are looked up\n", #> "# properly because of the multi-level structure:\n", #> "eval_tidy(quote(c(a, b, c)), data = mask)\n", "\n", #> "# new_data_mask() does not create data pronouns, but\n", #> "# data pronouns can be added manually:\n", "mask$.fns <- as_data_pronoun(top)\n", #> "\n", "# The `.data` pronoun should generally be created from the\n", #> "# mask. This will ensure data is looked up throughout the whole\n", #> "# ancestry. Only non-function objects are looked up from this\n", #> "# pronoun:\n", "mask$.data <- as_data_pronoun(mask)\n", #> "mask$.data$c\n", "\n", "# Now we can reference the values with the pronouns:\n", #> "eval_tidy(quote(c(.data$a, .data$b, .data$c)), data = mask)\n"), #> "\n"), as_env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("as_env"), "\n", list("as_env"), "\n", list( #> "Coerce to an environment"), "\n", list("\n", "as_env(x, parent = NULL)\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "This function is deprecated as it was renamed to ", #> list(list("as_environment()")), "\n", "in rlang 0.2.0.\n"), #> "\n", list("internal"), "\n"), as_environment.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env.R", "\n", list( #> "as_environment"), "\n", list("as_environment"), #> "\n", list("Coerce to an environment"), "\n", list("\n", #> "as_environment(x, parent = NULL)\n"), "\n", list( #> "\n", list(list("x"), list("An object to coerce.")), #> "\n", "\n", list(list("parent"), list("A parent environment, ", #> list(list("empty_env()")), " by default. This\n", #> "argument is only used when ", list("x"), " is data actually coerced to an\n", #> "environment (as opposed to data representing an environment, like\n", #> list("NULL"), " representing the empty environment).")), #> "\n"), "\n", list("\n", list("as_environment()"), #> " coerces named vectors (including lists) to an\n", #> "environment. The names must be unique. If supplied an unnamed\n", #> "string, it returns the corresponding package environment (see\n", #> list(list("pkg_env()")), ").\n"), "\n", list("\n", #> "If ", list("x"), " is an environment and ", list( #> "parent"), " is not ", list("NULL"), ", the\n", #> "environment is duplicated before being set a new parent. The return\n", #> "value is therefore a different environment than ", #> list("x"), ".\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", list("as_env()"), " was soft-deprecated and renamed to ", #> list("as_environment()"), " in\n", "rlang 0.2.0. This is for consistency as type predicates should not\n", #> "be abbreviated.\n")), "\n", "\n", list("\n", #> "# Coerce a named vector to an environment:\n", "env <- as_environment(mtcars)\n", #> "\n", "# By default it gets the empty environment as parent:\n", #> "identical(env_parent(env), empty_env())\n", "\n", #> "\n", "# With strings it is a handy shortcut for pkg_env():\n", #> "as_environment(\"base\")\n", "as_environment(\"rlang\")\n", #> "\n", "# With NULL it returns the empty environment:\n", #> "as_environment(NULL)\n"), "\n"), as_function.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list("as_function"), #> "\n", list("as_function"), "\n", list("is_lambda"), "\n", #> list("as_closure"), "\n", list("Convert to function or closure"), #> "\n", list("\n", "as_function(x, env = caller_env())\n", #> "\n", "is_lambda(x)\n", "\n", "as_closure(x, env = caller_env())\n"), #> "\n", list("\n", list(list("x"), list("A function or formula.\n", #> "\n", "If a ", list("function"), ", it is used as is.\n", #> "\n", "If a ", list("formula"), ", e.g. ", list("~ .x + 2"), #> ", it is converted to a function\n", "with up to two arguments: ", #> list(".x"), " (single argument) or ", list(".x"), #> " and ", list(".y"), "\n", "(two arguments). The ", #> list("."), " placeholder can be used instead of ", #> list(".x"), ".\n", "This allows you to create very compact anonymous functions (lambdas) with up\n", #> "to two inputs. Functions created from formulas have a special\n", #> "class. Use ", list("is_lambda()"), " to test for it.\n", #> "\n", "Lambdas currently do not support ", list("quasiquotation"), #> ",\n", "due to the way the arguments are handled internally.")), #> "\n", "\n", list(list("env"), list("Environment in which to fetch the function in case ", #> list("x"), "\n", "is a string.")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"stable\")"), "\n", #> list("\n", list(), " ", list("as_function()"), " transforms a one-sided formula into a function.\n", #> "This powers the lambda syntax in packages like purrr.\n", #> list(), " ", list("as_closure()"), " first passes its argument to ", #> list("as_function()"), ". If\n", "the result is a primitive function, it regularises it to a proper\n", #> list("closure"), " (see ", list(list("is_function()")), #> " about primitive functions).\n"), "\n"), "\n", #> list("\n", "f <- as_function(~ .x + 1)\n", "f(10)\n", #> "\n", "g <- as_function(~ -1 * .)\n", "g(4)\n", "\n", #> "h <- as_function(~ .x - .y)\n", "h(6, 3)\n", "\n", #> "# Functions created from a formula have a special class:\n", #> "is_lambda(f)\n", "is_lambda(as_function(function() \"foo\"))\n", #> "\n", "# Primitive functions are regularised as closures\n", #> "as_closure(list)\n", "as_closure(\"list\")\n", "\n", #> "# Operators have `.x` and `.y` as arguments, just like lambda\n", #> "# functions created with the formula syntax:\n", #> "as_closure(`+`)\n", "as_closure(`~`)\n", "\n", "# Use a regular function for tidy evaluation, also when calling functions\n", #> "# that use tidy evaluation:\n", "## Bad:\n", "e <- as_function(~ as_label(ensym(.x)))\n", #> "## Good:\n", "e <- as_function(function(x) as_label(ensym(x)))\n", #> "\n", "e(y)\n"), "\n"), as_label.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/deparse.R", "\n", #> list("as_label"), "\n", list("as_label"), "\n", list( #> "Create a default name for an R object"), "\n", list( #> "\n", "as_label(x)\n"), "\n", list("\n", list(list( #> "x"), list("An object.")), "\n"), "\n", list("\n", #> list("as_label()"), " transforms R objects into a short, human-readable\n", #> "description. You can use labels to:\n", list("\n", #> list(), " Display an object in a concise way, for example to labellise axes\n", #> "in a graphical plot.\n", list(), " Give default names to columns in a data frame. In this case,\n", #> "labelling is the first step before name repair.\n"), #> "\n", "\n", "See also ", list(list("as_name()")), #> " for transforming symbols back to a\n", "string. Unlike ", #> list("as_label()"), ", ", list("as_string()"), " is a well defined\n", #> "operation that guarantees the roundtrip symbol -> string ->\n", #> "symbol.\n", "\n", "In general, if you don't know for sure what kind of object you're\n", #> "dealing with (a call, a symbol, an unquoted constant), use\n", #> list("as_label()"), " and make no assumption about the resulting string. If\n", #> "you know you have a symbol and need the name of the object it\n", #> "refers to, use ", list(list("as_string()")), ". For instance, use ", #> list("as_label()"), " with\n", "objects captured with ", #> list("enquo()"), " and ", list("as_string()"), " with symbols\n", #> "captured with ", list("ensym()"), ".\n"), "\n", #> list(list("Transformation to string"), list("\n", "\n", #> list("\n", list(), " Quosures are ", list("squashed"), #> " before being labelled.\n", list(), " Symbols are transformed to string with ", #> list("as_string()"), ".\n", list(), " Calls are abbreviated.\n", #> list(), " Numbers are represented as such.\n", #> list(), " Other constants are represented by their type, such as ", #> list("<dbl>"), "\n", "or ", list("<data.frame>"), #> ".\n"), "\n", "\n", "Note that simple symbols should generally be transformed to strings\n", #> "with ", list(list("as_name()")), ". Labelling is not a well defined operation and\n", #> "no assumption should be made about how the label is created. On the\n", #> "other hand, ", list("as_name()"), " only works with symbols and is a well\n", #> "defined, deterministic operation.\n")), "\n", "\n", #> list("\n", "# as_label() is useful with quoted expressions:\n", #> "as_label(expr(foo(bar)))\n", "as_label(expr(foobar))\n", #> "\n", "# It works with any R object. This is also useful for quoted\n", #> "# arguments because the user might unquote constant objects:\n", #> "as_label(1:3)\n", "as_label(base::list)\n"), "\n", #> list("\n", list(list("as_name()")), " for transforming symbols back to a string\n", #> "deterministically.\n"), "\n"), as_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/deparse.R", "\n", list( #> "as_name"), "\n", list("as_name"), "\n", list("Extract names from symbols"), #> "\n", list("\n", "as_name(x)\n"), "\n", list("\n", list( #> list("x"), list("A string or symbol, possibly wrapped in a ", #> list("quosure"), ".\n", "If a string, the attributes are removed, if any.")), #> "\n"), "\n", list("\n", "A character vector of length 1.\n"), #> "\n", list("\n", list("as_name()"), " converts ", list( #> "symbols"), " to character strings. The\n", "conversion is deterministic. That is, the roundtrip symbol -> name\n", #> "-> symbol always gets the same result.\n", list( #> "\n", list(), " Use ", list("as_name()"), " when you need to transform a symbol to a string\n", #> "to ", list("refer"), " to an object by its name.\n", #> list(), " Use ", list(list("as_label()")), " when you need to transform any kind of object to\n", #> "a string to ", list("represent"), " that object with a short description.\n"), #> "\n", "\n", "Expect ", list("as_name()"), " to gain\n", #> list(list("https://principles.tidyverse.org/names-attribute.html#minimal-unique-universal"), #> list("name-repairing")), "\n", "features in the future.\n", #> "\n", "Note that ", list("rlang::as_name()"), " is the ", #> list("opposite"), " of\n", list(list("base::as.name()")), #> ". If you're writing base R code, we recommend\n", #> "using ", list(list("base::as.symbol()")), " which is an alias of ", #> list("as.name()"), " that\n", "follows a more modern terminology (R types instead of S modes).\n"), #> "\n", list("\n", "# Let's create some symbols:\n", "foo <- quote(foo)\n", #> "bar <- sym(\"bar\")\n", "\n", "# as_name() converts symbols to strings:\n", #> "foo\n", "as_name(foo)\n", "\n", "typeof(bar)\n", #> "typeof(as_name(bar))\n", "\n", "# as_name() unwraps quosured symbols automatically:\n", #> "as_name(quo(foo))\n"), "\n", list("\n", list(list( #> "as_label()")), " for converting any object to a single string\n", #> "suitable as a label. ", list(list("as_string()")), #> " for a lower-level version that\n", "doesn't unwrap quosures.\n"), #> "\n"), as_overscope.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("as_overscope"), "\n", list("as_overscope"), #> "\n", list("new_overscope"), "\n", list("overscope_clean"), #> "\n", list("Create an overscope"), "\n", list("\n", "as_overscope(quo, data = NULL)\n", #> "\n", "new_overscope(bottom, top = NULL, enclosure = NULL)\n", #> "\n", "overscope_clean(overscope)\n"), "\n", list( #> "\n", list(list("quo"), list("A ", list("quosure"), #> ".")), "\n", "\n", list(list("data"), list("A data frame or named vector of masking data.")), #> "\n", "\n", list(list("bottom"), list("The environment containing masking objects if the\n", #> "data mask is one environment deep. The bottom environment if the\n", #> "data mask comprises multiple environment.\n", #> "\n", "If you haven't supplied ", list("top"), #> ", this ", list("must"), " be an environment\n", #> "that you own, i.e. that you have created yourself.")), #> "\n", "\n", list(list("top"), list("The last environment of the data mask. If the data mask\n", #> "is only one environment deep, ", list("top"), #> " should be the same as\n", list("bottom"), ".\n", #> "\n", "This ", list("must"), " be an environment that you own, i.e. that you have\n", #> "created yourself. The parent of ", list("top"), #> " will be changed by the tidy\n", "eval engine and should be considered undetermined. Never make\n", #> "assumption about the parent of ", list("top"), #> ".")), "\n", "\n", list(list("enclosure"), list( #> "The ", list("parent"), " argument of ", list( #> list("new_data_mask()")), ".")), "\n", "\n", #> list(list("overscope"), list("A data mask.")), "\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions have been deprecated in rlang 0.2.0. Please use\n", #> list(list("as_data_mask()")), " and ", list(list( #> "new_data_mask()")), " instead. We no longer\n", #> "require the mask to be cleaned up so ", list("overscope_clean()"), #> " does not\n", "have a replacement.\n"), "\n", list( #> "internal"), "\n"), as_pairlist.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/node.R", "\n", #> list("as_pairlist"), "\n", list("as_pairlist"), "\n", #> list("Coerce to pairlist"), "\n", list("\n", "as_pairlist(x)\n"), #> "\n", list("\n", list(list("x"), list("An object to coerce.")), #> "\n"), "\n", list("\n", "This transforms vector objects to a linked pairlist of nodes. See\n", #> "the ", list("pairlist"), " type help page.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> list("as_pairlist()"), " is experimental because we are still figuring out\n", #> "the naming scheme for pairlists and node-like objects.\n")), #> "\n", "\n", list("internal"), "\n"), as_quosure.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "as_quosure"), "\n", list("as_quosure"), "\n", list( #> "new_quosure"), "\n", list("Coerce object to quosure"), #> "\n", list("\n", "as_quosure(x, env = NULL)\n", "\n", #> "new_quosure(expr, env = caller_env())\n"), "\n", #> list("\n", list(list("x"), list("An object to convert. Either an ", #> list("expression"), " or a\n", "formula.")), "\n", #> "\n", list(list("env"), list("The environment in which the expression should be\n", #> "evaluated. Only used for symbols and calls. This should typically\n", #> "be the environment in which the expression was created.")), #> "\n", "\n", list(list("expr"), list("The expression wrapped by the quosure.")), #> "\n"), "\n", list("\n", "While ", list("new_quosure()"), #> " wraps any R object (including expressions,\n", #> "formulas, or other quosures) into a quosure, ", #> list("as_quosure()"), "\n", "converts formulas and quosures and does not double-wrap.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", list( #> "\n", list(), " ", list("as_quosure()"), " now requires an explicit default environment for\n", #> "creating quosures from symbols and calls.\n", list(), #> " ", list("as_quosureish()"), " is deprecated as of rlang 0.2.0. This function\n", #> "assumes that quosures are formulas which is currently true but\n", #> "might not be in the future.\n"), "\n")), "\n", "\n", #> list("\n", "# as_quosure() converts expressions or any R object to a validly\n", #> "# scoped quosure:\n", "env <- env(var = \"thing\")\n", #> "as_quosure(quote(var), env)\n", "\n", "\n", "# The environment is ignored for formulas:\n", #> "as_quosure(~foo, env)\n", "as_quosure(~foo)\n", #> "\n", "# However you must supply it for symbols and calls:\n", #> "try(as_quosure(quote(var)))\n"), "\n", list("\n", #> list(list("quo()")), ", ", list(list("is_quosure()")), #> "\n"), "\n"), as_string.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/sym.R", "\n", #> list("as_string"), "\n", list("as_string"), "\n", list( #> "Cast symbol to string"), "\n", list("\n", "as_string(x)\n"), #> "\n", list("\n", list(list("x"), list("A string or symbol. If a string, the attributes are\n", #> "removed, if any.")), "\n"), "\n", list("\n", "A character vector of length 1.\n"), #> "\n", list("\n", list("as_string()"), " converts ", list( #> "symbols"), " to character strings.\n"), "\n", list( #> list("Unicode tags"), list("\n", "\n", "\n", "Unlike ", #> list(list("base::as.symbol()")), " and ", list( #> list("base::as.name()")), ", ", list("as_string()"), #> "\n", "automatically transforms unicode tags such as ", #> list("\"<U+5E78>\""), " to the\n", "proper UTF-8 character. This is important on Windows because:\n", #> list("\n", list(), " R on Windows has no UTF-8 support, and uses native encoding instead.\n", #> list(), " The native encodings do not cover all Unicode characters. For\n", #> "example, Western encodings do not support CKJ characters.\n", #> list(), " When a lossy UTF-8 -> native transformation occurs, uncovered\n", #> "characters are transformed to an ASCII unicode tag like ", #> list("\"<U+5E78>\""), ".\n", list(), " Symbols are always encoded in native. This means that\n", #> "transforming the column names of a data frame to symbols might be\n", #> "a lossy operation.\n", list(), " This operation is very common in the tidyverse because of data\n", #> "masking APIs like dplyr where data frames are transformed to\n", #> "environments. While the names of a data frame are stored as a\n", #> "character vector, the bindings of environments are stored as\n", #> "symbols.\n"), "\n", "\n", "Because it reencodes the ASCII unicode tags to their UTF-8\n", #> "representation, the string -> symbol -> string roundtrip is\n", #> "more stable with ", list("as_string()"), ".\n")), #> "\n", "\n", list("\n", "# Let's create some symbols:\n", #> "foo <- quote(foo)\n", "bar <- sym(\"bar\")\n", "\n", #> "# as_string() converts symbols to strings:\n", "foo\n", #> "as_string(foo)\n", "\n", "typeof(bar)\n", "typeof(as_string(bar))\n"), #> "\n", list("\n", list(list("as_name()")), " for a higher-level variant of ", #> list("as_string()"), "\n", "that automatically unwraps quosures.\n"), #> "\n"), as_utf8_character.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/utils-encoding.R", #> "\n", list("as_utf8_character"), "\n", list("as_utf8_character"), #> "\n", list("Coerce to a character vector and attempt encoding conversion"), #> "\n", list("\n", "as_utf8_character(x)\n"), "\n", list( #> "\n", list(list("x"), list("An object to coerce.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "Unlike specifying the ", list("encoding"), #> " argument in ", list("as_string()"), " and\n", list( #> "as_character()"), ", which is only declarative, these functions\n", #> "actually attempt to convert the encoding of their input. There are\n", #> "two possible cases:\n", list("\n", list(), " The string is tagged as UTF-8 or latin1, the only two encodings\n", #> "for which R has specific support. In this case, converting to the\n", #> "same encoding is a no-op, and converting to native always works\n", #> "as expected, as long as the native encoding, the one specified by\n", #> "the ", list("LC_CTYPE"), " locale has support for all characters occurring in\n", #> "the strings. Unrepresentable characters are serialised as unicode\n", #> "points: \"<U+xxxx>\".\n", list(), " The string is not tagged. R assumes that it is encoded in the\n", #> "native encoding. Conversion to native is a no-op, and conversion\n", #> "to UTF-8 should work as long as the string is actually encoded in\n", #> "the locale codeset.\n"), "\n", "\n", "When translating to UTF-8, the strings are parsed for serialised\n", #> "unicode points (e.g. strings looking like \"U+xxxx\") with\n", #> list(list("chr_unserialise_unicode()")), ". This helps to alleviate the effects of\n", #> "character-to-symbol-to-character roundtrips on systems with\n", #> "non-UTF-8 native encoding.\n"), "\n", list("\n", #> "# Let's create a string marked as UTF-8 (which is guaranteed by the\n", #> "# Unicode escaping in the string):\n", "utf8 <- \"caf\\uE9\"\n", #> "Encoding(utf8)\n", "as_bytes(utf8)\n"), "\n"), `bare-type-predicates.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", list( #> "bare-type-predicates"), "\n", list("bare-type-predicates"), #> "\n", list("is_bare_list"), "\n", list("is_bare_atomic"), #> "\n", list("is_bare_vector"), "\n", list("is_bare_double"), #> "\n", list("is_bare_integer"), "\n", list("is_bare_numeric"), #> "\n", list("is_bare_character"), "\n", list("is_bare_logical"), #> "\n", list("is_bare_raw"), "\n", list("is_bare_string"), #> "\n", list("is_bare_bytes"), "\n", list("Bare type predicates"), #> "\n", list("\n", "is_bare_list(x, n = NULL)\n", "\n", #> "is_bare_atomic(x, n = NULL)\n", "\n", "is_bare_vector(x, n = NULL)\n", #> "\n", "is_bare_double(x, n = NULL)\n", "\n", "is_bare_integer(x, n = NULL)\n", #> "\n", "is_bare_numeric(x, n = NULL)\n", "\n", "is_bare_character(x, n = NULL, encoding = NULL)\n", #> "\n", "is_bare_logical(x, n = NULL)\n", "\n", "is_bare_raw(x, n = NULL)\n", #> "\n", "is_bare_string(x, n = NULL)\n", "\n", "is_bare_bytes(x, n = NULL)\n"), #> "\n", list("\n", list(list("x"), list("Object to be tested.")), #> "\n", "\n", list(list("n"), list("Expected length of a vector.")), #> "\n", "\n", list(list("encoding"), list("Defunct as of rlang 0.4.0.")), #> "\n"), "\n", list("\n", "These predicates check for a given type but only return ", #> list("TRUE"), " for\n", "bare R objects. Bare objects have no class attributes. For example,\n", #> "a data frame is a list, but not a bare list.\n"), #> "\n", list("\n", list("\n", list(), " The predicates for vectors include the ", #> list("n"), " argument for\n", "pattern-matching on the vector length.\n", #> list(), " Like ", list(list("is_atomic()")), " and unlike base R ", #> list("is.atomic()"), ",\n", list("is_bare_atomic()"), #> " does not return ", list("TRUE"), " for ", list( #> "NULL"), ".\n", list(), " Unlike base R ", list( #> "is.numeric()"), ", ", list("is_bare_double()"), #> " only returns\n", list("TRUE"), " for floating point numbers.\n"), #> "\n"), "\n", list("\n", list("type-predicates"), #> ", ", list("scalar-type-predicates"), "\n"), "\n"), #> box.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/s3.R", "\n", #> list("box"), "\n", list("box"), "\n", list("new_box"), #> "\n", list("is_box"), "\n", list("unbox"), "\n", #> list("Box a value"), "\n", list("\n", "new_box(.x, class = NULL, ...)\n", #> "\n", "is_box(x, class = NULL)\n", "\n", "unbox(box)\n"), #> "\n", list("\n", list(list("class"), list("For ", #> list("new_box()"), ", an additional class for the\n", #> "boxed value (in addition to ", list("rlang_box"), #> "). For ", list("is_box()"), ", a class\n", "or vector of classes passed to ", #> list(list("inherits_all()")), ".")), "\n", "\n", #> list(list("..."), list("Additional attributes passed to ", #> list(list("base::structure()")), ".")), "\n", #> "\n", list(list("x, .x"), list("An R object.")), #> "\n", "\n", list(list("box"), list("A boxed value to unbox.")), #> "\n"), "\n", list("\n", list("new_box()"), " is similar to ", #> list(list("base::I()")), " but it protects a value by\n", #> "wrapping it in a scalar list rather than by adding an attribute.\n", #> list("unbox()"), " retrieves the boxed value. ", #> list("is_box()"), " tests whether an\n", "object is boxed with optional class. ", #> list("as_box()"), " ensures that a\n", "value is wrapped in a box. ", #> list("as_box_if()"), " does the same but only if\n", #> "the value matches a predicate.\n"), "\n", list( #> "\n", "boxed <- new_box(letters, \"mybox\")\n", #> "is_box(boxed)\n", "is_box(boxed, \"mybox\")\n", #> "is_box(boxed, \"otherbox\")\n", "\n", "unbox(boxed)\n", #> "\n", "# as_box() avoids double-boxing:\n", "boxed2 <- as_box(boxed, \"mybox\")\n", #> "boxed2\n", "unbox(boxed2)\n", "\n", "# Compare to:\n", #> "boxed_boxed <- new_box(boxed, \"mybox\")\n", #> "boxed_boxed\n", "unbox(unbox(boxed_boxed))\n", #> "\n", "# Use `as_box_if()` with a predicate if you need to ensure a box\n", #> "# only for a subset of values:\n", "as_box_if(NULL, is_null, \"null_box\")\n", #> "as_box_if(\"foo\", is_null, \"null_box\")\n"), #> "\n"), call2.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call2"), "\n", list("call2"), "\n", list( #> "Create a call"), "\n", list("\n", "call2(.fn, ..., .ns = NULL)\n"), #> "\n", list("\n", list(list(".fn"), list("Function to call. Must be a callable object: a string,\n", #> "symbol, call, or a function.")), "\n", "\n", #> list(list("..."), list("Arguments to the call either in or out of a list. These dots\n", #> "support ", list("tidy dots"), " features. Empty arguments are preserved.")), #> "\n", "\n", list(list(".ns"), list("Namespace with which to prefix ", #> list(".fn"), ". Must be a string\n", "or symbol.")), #> "\n"), "\n", list("\n", "Quoted function calls are one of the two types of\n", #> list("symbolic"), " objects in R. They represent the action of\n", #> "calling a function, possibly with arguments. There are two ways of\n", #> "creating a quoted call:\n", list("\n", list(), #> " By ", list("quoting"), " it. Quoting prevents functions from being\n", #> "called. Instead, you get the description of the function call as\n", #> "an R object. That is, a quoted function call.\n", #> list(), " By constructing it with ", list(list( #> "base::call()")), ", ", list(list("base::as.call()")), #> ", or\n", list("call2()"), ". In this case, you pass the call elements (the function\n", #> "to call and the arguments to call it with) separately.\n"), #> "\n", "\n", "See section below for the difference between ", #> list("call2()"), " and the base\n", "constructors.\n"), #> "\n", list(list("Difference with base constructors"), #> list("\n", "\n", "\n", list("call2()"), " is more flexible and convenient than ", #> list("base::call()"), ":\n", list("\n", list(), #> " The function to call can be a string or a ", #> list("callable"), "\n", "object: a symbol, another call (e.g. a ", #> list("$"), " or ", list("[["), " call), or a\n", #> "function to inline. ", list("base::call()"), #> " only supports strings and you\n", "need to use ", #> list("base::as.call()"), " to construct a call with a callable\n", #> "object.", list("call2(list, 1, 2)\n", "\n", #> "as.call(list(list, 1, 2))\n"), "\n", list(), #> " The ", list(".ns"), " argument is convenient for creating namespaced calls.", #> list("call2(\"list\", 1, 2, .ns = \"base\")\n", #> "\n", "ns_call <- as.call(list(as.name(\"::\"), as.name(\"list\"), as.name(\"base\")))\n", #> "as.call(list(ns_call, 1, 2))\n"), "\n", #> list(), " ", list("call2()"), " has ", list( #> "tidy dots"), " support and you can splice lists\n", #> "of arguments with ", list("!!!"), ". With base R, you need to use ", #> list("as.call()"), "\n", "instead of ", list( #> "call()"), " if the arguments are in a list.", #> list("args <- list(na.rm = TRUE, trim = 0)\n", #> "\n", "call2(\"mean\", 1:10, !!!args)\n", #> "\n", "as.call(c(list(as.name(\"mean\"), 1:10), args))\n"), #> "\n"), "\n")), "\n", "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "In rlang 0.2.0 ", list( #> "lang()"), " was soft-deprecated and renamed to\n", #> list("call2()"), ".\n", "\n", "In early versions of rlang calls were called \"language\" objects in\n", #> "order to follow the R type nomenclature as returned by\n", #> list(list("base::typeof()")), ". The goal was to avoid adding to the confusion\n", #> "between S modes and R types. With hindsight we find it is better to\n", #> "use more meaningful type names.\n")), "\n", #> "\n", list("\n", "# fn can either be a string, a symbol or a call\n", #> "call2(\"f\", a = 1)\n", "call2(quote(f), a = 1)\n", #> "call2(quote(f()), a = 1)\n", "\n", "#' Can supply arguments individually or in a list\n", #> "call2(quote(f), a = 1, b = 2)\n", "call2(quote(f), !!!list(a = 1, b = 2))\n", #> "\n", "# Creating namespaced calls is easy:\n", #> "call2(\"fun\", arg = quote(baz), .ns = \"mypkg\")\n", #> "\n", "# Empty arguments are preserved:\n", "call2(\"[\", quote(x), , drop = )\n"), #> "\n", list("\n", "call_modify\n"), "\n"), call_args.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("call_args"), "\n", list("call_args"), "\n", #> list("call_args_names"), "\n", list("Extract arguments from a call"), #> "\n", list("\n", "call_args(call)\n", "\n", "call_args_names(call)\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n"), "\n", list("\n", "A named list of arguments.\n"), #> "\n", list("\n", "Extract arguments from a call\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "In rlang 0.2.0, ", list("lang_args()"), " and ", #> list("lang_args_names()"), " were\n", "deprecated and renamed to ", #> list("call_args()"), " and ", list("call_args_names()"), #> ".\n", "See lifecycle section in ", list(list( #> "call2()")), " for more about this change.\n")), #> "\n", "\n", list("\n", "call <- quote(f(a, b))\n", #> "\n", "# Subsetting a call returns the arguments converted to a language\n", #> "# object:\n", "call[-1]\n", "\n", "# On the other hand, call_args() returns a regular list that is\n", #> "# often easier to work with:\n", "str(call_args(call))\n", #> "\n", "# When the arguments are unnamed, a vector of empty strings is\n", #> "# supplied (rather than NULL):\n", "call_args_names(call)\n"), #> "\n", list("\n", list(list("fn_fmls()")), " and ", #> list(list("fn_fmls_names()")), "\n"), "\n"), #> call_fn.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call_fn"), "\n", list("call_fn"), "\n", #> list("Extract function from a call"), "\n", list( #> "\n", "call_fn(call, env = caller_env())\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n", "\n", list(list("env"), list("The environment where to find the definition of the\n", #> "function quoted in ", list("call"), " in case ", #> list("call"), " is not wrapped in a\n", "quosure.")), #> "\n"), "\n", list("\n", "If a frame or formula, the function will be retrieved from the\n", #> "associated environment. Otherwise, it is looked up in the calling\n", #> "frame.\n"), "\n", list(list("Life cycle"), list( #> "\n", "\n", "\n", "In rlang 0.2.0, ", list("lang_fn()"), #> " was deprecated and renamed to\n", list("call_fn()"), #> ". See lifecycle section in ", list(list("call2()")), #> " for more about this\n", "change.\n")), "\n", #> "\n", list("\n", "# Extract from a quoted call:\n", #> "call_fn(quote(matrix()))\n", "call_fn(quo(matrix()))\n", #> "\n", "# Extract the calling function\n", "test <- function() call_fn(call_frame())\n", #> "test()\n"), "\n", list("\n", list(list("call_name()")), #> "\n"), "\n"), call_inspect.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/stack.R", #> "\n", list("call_inspect"), "\n", list("call_inspect"), #> "\n", list("Inspect a call"), "\n", list("\n", "call_inspect(...)\n"), #> "\n", list("\n", list(list("..."), list("Arguments to display in the returned call.")), #> "\n"), "\n", list("\n", "This function is useful for quick testing and debugging when you\n", #> "manipulate expressions and calls. It lets you check that a function\n", #> "is called with the right arguments. This can be useful in unit\n", #> "tests for instance. Note that this is just a simple wrapper around\n", #> list(list("base::match.call()")), ".\n"), "\n", #> list("\n", "call_inspect(foo(bar), \"\" %>% identity())\n"), #> "\n"), call_modify.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call_modify"), "\n", list("call_modify"), #> "\n", list("Modify the arguments of a call"), "\n", #> list("\n", "call_modify(.call, ..., .homonyms = c(\"keep\", \"first\", \"last\", \"error\"),\n", #> " .standardise = NULL, .env = caller_env())\n"), #> "\n", list("\n", list(list(".call"), list("Can be a call, a formula quoting a call in the\n", #> "right-hand side, or a frame object from which to extract the call\n", #> "expression.")), "\n", "\n", list(list("..."), #> list("Named or unnamed expressions (constants, names or calls)\n", #> "used to modify the call. Use ", list(list( #> "zap()")), " to remove arguments. These\n", #> "dots support ", list("tidy dots"), " features. Empty arguments are\n", #> "allowed and preserved.")), "\n", "\n", list( #> list(".homonyms"), list("How to treat arguments with the same name. The\n", #> "default, ", list("\"keep\""), ", preserves these arguments. Set ", #> list(".homonyms"), " to\n", list("\"first\""), #> " to only keep the first occurrences, to ", #> list("\"last\""), " to keep\n", "the last occurrences, and to ", #> list("\"error\""), " to raise an informative\n", #> "error and indicate what arguments have duplicated names.")), #> "\n", "\n", list(list(".standardise, .env"), #> list("Soft-deprecated as of rlang 0.3.0. Please\n", #> "call ", list(list("call_standardise()")), #> " manually.")), "\n"), "\n", list("\n", "A quosure if ", #> list(".call"), " is a quosure, a call otherwise.\n"), #> "\n", list("\n", "If you are working with a user-supplied call, make sure the\n", #> "arguments are standardised with ", list(list( #> "call_standardise()")), " before\n", "modifying the call.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", list( #> "\n", list(), " The ", list(".standardise"), #> " argument is deprecated as of rlang 0.3.0.\n", #> list(), " In rlang 0.2.0, ", list("lang_modify()"), #> " was deprecated and renamed to\n", list("call_modify()"), #> ". See lifecycle section in ", list(list("call2()")), #> " for more about\n", "this change.\n"), "\n")), #> "\n", "\n", list("\n", "call <- quote(mean(x, na.rm = TRUE))\n", #> "\n", "# Modify an existing argument\n", "call_modify(call, na.rm = FALSE)\n", #> "call_modify(call, x = quote(y))\n", "\n", "# Remove an argument\n", #> "call_modify(call, na.rm = zap())\n", "\n", "# Add a new argument\n", #> "call_modify(call, trim = 0.1)\n", "\n", "# Add an explicit missing argument:\n", #> "call_modify(call, na.rm = )\n", "\n", "# Supply a list of new arguments with `!!!`\n", #> "newargs <- list(na.rm = NULL, trim = 0.1)\n", #> "call <- call_modify(call, !!!newargs)\n", "call\n", #> "\n", "# Remove multiple arguments by splicing zaps:\n", #> "newargs <- rep_named(c(\"na.rm\", \"trim\"), list(zap()))\n", #> "call <- call_modify(call, !!!newargs)\n", "call\n", #> "\n", "\n", "# Modify the `...` arguments as if it were a named argument:\n", #> "call <- call_modify(call, ... = )\n", "call\n", #> "\n", "call <- call_modify(call, ... = zap())\n", #> "call\n", "\n", "\n", "# When you're working with a user-supplied call, standardise it\n", #> "# beforehand because it might contain unmatched arguments:\n", #> "user_call <- quote(matrix(x, nc = 3))\n", "call_modify(user_call, ncol = 1)\n", #> "\n", "# Standardising applies the usual argument matching rules:\n", #> "user_call <- call_standardise(user_call)\n", #> "user_call\n", "call_modify(user_call, ncol = 1)\n", #> "\n", "\n", "# You can also modify quosures inplace:\n", #> "f <- quo(matrix(bar))\n", "call_modify(f, quote(foo))\n", #> "\n", "\n", "# By default, arguments with the same name are kept. This has\n", #> "# subtle implications, for instance you can move an argument to\n", #> "# last position by removing it and remapping it:\n", #> "call <- quote(foo(bar = , baz))\n", "call_modify(call, bar = NULL, bar = missing_arg())\n", #> "\n", "# You can also choose to keep only the first or last homonym\n", #> "# arguments:\n", "args <- list(bar = NULL, bar = missing_arg())\n", #> "call_modify(call, !!!args, .homonyms = \"first\")\n", #> "call_modify(call, !!!args, .homonyms = \"last\")\n"), #> "\n"), call_name.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call_name"), "\n", list("call_name"), #> "\n", list("call_ns"), "\n", list("Extract function name or namespaced of a call"), #> "\n", list("\n", "call_name(call)\n", "\n", "call_ns(call)\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n"), "\n", list("\n", "A string with the function name, or ", #> list("NULL"), " if the function\n", "is anonymous.\n"), #> "\n", list("\n", "Extract function name or namespaced of a call\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "In rlang 0.2.0, ", list("lang_name()"), " was deprecated and renamed to\n", #> list("call_name()"), ". See lifecycle section in ", #> list(list("call2()")), " for more about\n", "this change.\n")), #> "\n", "\n", list("\n", "# Extract the function name from quoted calls:\n", #> "call_name(quote(foo(bar)))\n", "call_name(quo(foo(bar)))\n", #> "\n", "# Namespaced calls are correctly handled:\n", #> "call_name(~base::matrix(baz))\n", "\n", "# Anonymous and subsetted functions return NULL:\n", #> "call_name(quote(foo$bar()))\n", "call_name(quote(foo[[bar]]()))\n", #> "call_name(quote(foo()()))\n", "\n", "# Extract namespace of a call with call_ns():\n", #> "call_ns(quote(base::bar()))\n", "\n", "# If not namespaced, call_ns() returns NULL:\n", #> "call_ns(quote(bar()))\n"), "\n", list("\n", #> list(list("call_fn()")), "\n"), "\n"), call_standardise.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("call_standardise"), "\n", list("call_standardise"), #> "\n", list("Standardise a call"), "\n", list("\n", #> "call_standardise(call, env = caller_env())\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n", "\n", list(list("env"), list("The environment where to find the definition of the\n", #> "function quoted in ", list("call"), " in case ", #> list("call"), " is not wrapped in a\n", "quosure.")), #> "\n"), "\n", list("\n", "A quosure if ", list( #> "call"), " is a quosure, a raw call otherwise.\n"), #> "\n", list("\n", "This is essentially equivalent to ", #> list(list("base::match.call()")), ", but with\n", #> "experimental handling of primitive functions.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "In rlang 0.2.0, ", list("lang_standardise()"), #> " was deprecated and renamed to\n", list("call_standardise()"), #> ". See lifecycle section in ", list(list("call2()")), #> " for more\n", "about this change.\n")), "\n", #> "\n"), caller_env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("caller_env"), "\n", list("caller_env"), #> "\n", list("current_env"), "\n", list("Get the current or caller environment"), #> "\n", list("\n", "caller_env(n = 1)\n", "\n", "current_env()\n"), #> "\n", list("\n", list(list("n"), list("Number of frames to go back.")), #> "\n"), "\n", list("\n", list("\n", list(), " The current environment is the execution environment of the\n", #> "current function (the one currently being evaluated).\n", #> list(), " The caller environment is the execution environment of the\n", #> "function that called the current function.\n"), #> "\n"), "\n", list("\n", "# Let's create a function that returns its current environment and\n", #> "# its caller environment:\n", "fn <- function() list(current = current_env(), caller = caller_env())\n", #> "\n", "# The current environment is an unique execution environment\n", #> "# created when `fn()` was called. The caller environment is the\n", #> "# global env because that's where we called `fn()`.\n", #> "fn()\n", "\n", "# Let's call `fn()` again but this time within a function:\n", #> "g <- function() fn()\n", "\n", "# Now the caller environment is also an unique execution environment.\n", #> "# This is the exec env created by R for our call to g():\n", #> "g()\n"), "\n", list("\n", list(list("caller_frame()")), #> " and ", list(list("current_frame()")), "\n"), #> "\n"), caller_fn.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/stack.R", #> "\n", list("caller_fn"), "\n", list("caller_fn"), #> "\n", list("current_fn"), "\n", list("Get properties of the current or caller frame"), #> "\n", list("\n", "caller_fn(n = 1)\n", "\n", "current_fn()\n"), #> "\n", list("\n", list(list("n"), list("The number of generations to go back.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", list("\n", list(), " The current frame is the execution context of the function that\n", #> "is currently being evaluated.\n", list(), #> " The caller frame is the execution context of the function that\n", #> "called the function currently being evaluated.\n"), #> "\n", "\n", "See the ", list("call stack"), " topic for more information.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "These functions are experimental.\n")), "\n", #> "\n", list("\n", list(list("caller_env()")), " and ", #> list(list("current_env()")), "\n"), "\n"), caller_frame.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("caller_frame"), "\n", list("caller_frame"), #> "\n", list("Get caller frame"), "\n", list("\n", #> "caller_frame(n = 1)\n"), "\n", list("\n", list( #> list("n"), list("Number of frames to go back.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n"), "\n", list("internal"), "\n"), catch_cnd.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-handlers.R", #> "\n", list("catch_cnd"), "\n", list("catch_cnd"), #> "\n", list("Catch a condition"), "\n", list("\n", #> "catch_cnd(expr, classes = \"condition\")\n"), #> "\n", list("\n", list(list("expr"), list("Expression to be evaluated with a catching condition\n", #> "handler.")), "\n", "\n", list(list("classes"), #> list("A character vector of condition classes to catch. By\n", #> "default, catches all conditions.")), "\n"), #> "\n", list("\n", "A condition if any was signalled, ", #> list("NULL"), " otherwise.\n"), "\n", list("\n", #> "This is a small wrapper around ", list("tryCatch()"), #> " that captures any\n", "condition signalled while evaluating its argument. It is useful for\n", #> "situations where you expect a specific condition to be signalled,\n", #> "for debugging, and for unit testing.\n"), "\n", #> list("\n", "catch_cnd(10)\n", "catch_cnd(abort(\"an error\"))\n", #> "catch_cnd(cnd_signal(\"my_condition\", .msg = \"a condition\"))\n"), #> "\n"), chr_unserialise_unicode.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/utils-encoding.R", #> "\n", list("chr_unserialise_unicode"), "\n", list( #> "chr_unserialise_unicode"), "\n", list("Translate unicode points to UTF-8"), #> "\n", list("\n", "chr_unserialise_unicode(chr)\n"), #> "\n", list("\n", list(list("chr"), list("A character vector.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "For historical reasons, R translates strings to the native encoding\n", #> "when they are converted to symbols. This string-to-symbol\n", #> "conversion is not a rare occurrence and happens for instance to the\n", #> "names of a list of arguments converted to a call by ", #> list("do.call()"), ".\n", "\n", "If the string contains unicode characters that cannot be\n", #> "represented in the native encoding, R serialises those as an ASCII\n", #> "sequence representing the unicode point. This is why Windows users\n", #> "with western locales often see strings looking like ", #> list("<U+xxxx>"), ". To\n", "alleviate some of the pain, rlang parses strings and looks for\n", #> "serialised unicode points to translate them back to the proper\n", #> "UTF-8 representation. This transformation occurs automatically in\n", #> "functions like ", list(list("env_names()")), #> " and can be manually triggered with\n", list( #> "as_utf8_character()"), " and ", list("chr_unserialise_unicode()"), #> ".\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "This function is experimental.\n")), #> "\n", "\n", list("\n", "ascii <- \"<U+5E78>\"\n", #> "chr_unserialise_unicode(ascii)\n", "\n", "identical(chr_unserialise_unicode(ascii), \"\\u5e78\")\n"), #> "\n", list("internal"), "\n"), cnd.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-error.R, R/cnd.R", #> "\n", list("error_cnd"), "\n", list("error_cnd"), #> "\n", list("cnd"), "\n", list("warning_cnd"), "\n", #> list("message_cnd"), "\n", list("Create a condition object"), #> "\n", list("\n", "error_cnd(.subclass = NULL, ..., message = \"\", trace = NULL,\n", #> " parent = NULL)\n", "\n", "cnd(.subclass, ..., message = \"\")\n", #> "\n", "warning_cnd(.subclass = NULL, ..., message = \"\")\n", #> "\n", "message_cnd(.subclass = NULL, ..., message = \"\")\n"), #> "\n", list("\n", list(list(".subclass"), list("The condition subclass.")), #> "\n", "\n", list(list("..."), list("Named data fields stored inside the condition\n", #> "object. These dots are evaluated with ", list( #> "explicit splicing"), ".")), "\n", "\n", #> list(list("message"), list("A default message to inform the user about the\n", #> "condition when it is signalled.")), "\n", #> "\n", list(list("trace"), list("A ", list("trace"), #> " object created by ", list(list("trace_back()")), #> ".")), "\n", "\n", list(list("parent"), list( #> "A parent condition object created by ", list( #> list("abort()")), ".")), "\n"), "\n", list( #> "\n", "These constructors make it easy to create subclassed conditions.\n", #> "Conditions are objects that power the error system in R. They can\n", #> "also be used for passing messages to pre-established handlers.\n"), #> "\n", list("\n", list("cnd()"), " creates objects inheriting from ", #> list("condition"), ". Conditions\n", "created with ", #> list("error_cnd()"), ", ", list("warning_cnd()"), #> " and ", list("message_cnd()"), "\n", "inherit from ", #> list("error"), ", ", list("warning"), " or ", #> list("message"), ".\n"), "\n", list(list("Lifecycle"), #> list("\n", "\n", "\n", "The ", list(".type"), #> " and ", list(".msg"), " arguments have been renamed to ", #> list(".subclass"), "\n", "and ", list("message"), #> ". They are deprecated as of rlang 0.3.0.\n")), #> "\n", "\n", list("\n", "# Create a condition inheriting from the s3 type \"foo\":\n", #> "cnd <- cnd(\"foo\")\n", "\n", "# Signal the condition to potential handlers. Since this is a bare\n", #> "# condition the signal has no effect if no handlers are set up:\n", #> "cnd_signal(cnd)\n", "\n", "# When a relevant handler is set up, the signal causes the handler\n", #> "# to be called:\n", "with_handlers(cnd_signal(cnd), foo = exiting(function(c) \"caught!\"))\n", #> "\n", "# Handlers can be thrown or executed inplace. See with_handlers()\n", #> "# documentation for more on this.\n", "\n", #> "# Signalling an error condition aborts the current computation:\n", #> "err <- error_cnd(\"foo\", message = \"I am an error\")\n", #> "try(cnd_signal(err))\n"), "\n", list("\n", list( #> list("cnd_signal()")), ", ", list(list("with_handlers()")), #> ".\n"), "\n"), cnd_message.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-message.R", #> "\n", list("cnd_message"), "\n", list("cnd_message"), #> "\n", list("cnd_issue"), "\n", list("cnd_bullets"), #> "\n", list("Build an error message from a main issue and bullet messages"), #> "\n", list("\n", "cnd_message(cnd)\n", "\n", "cnd_issue(cnd, ...)\n", #> "\n", "cnd_bullets(cnd, ...)\n"), "\n", list( #> "\n", list(list("cnd"), list("A condition object.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", list("cnd_message()"), " assembles an error message from two components:\n", #> list("\n", list(), " The ", list("cnd_issue()"), #> " generic. Methods should return a single line.\n", #> list(), " The ", list("cnd_bullets()"), " generic. Methods should return a named vector\n", #> "of lines. These lines are automatically prefixed with a bullet by\n", #> list("cnd_message()"), " (see the section on error statements).\n"), #> "\n", "\n", list("cnd_message()"), " is automatically called by the ", #> list("conditionMessage()"), "\n", "for rlang errors so that errors thrown with ", #> list(list("abort()")), " only need to\n", "implement ", #> list("cnd_issue()"), " and ", list("cnd_bullets()"), #> ". It can also be called\n", "in custom ", list( #> "conditionMessage()"), " methods.\n"), "\n", #> list(list("Error statements"), list("\n", "\n", "\n", #> "This experimental infrastructure is based on the idea that\n", #> "sentences in error messages are best kept short and simple. From\n", #> "this point of view, the best way to present the information is as a\n", #> "bullet list of simple sentences containing a single clause.\n", #> list("cnd_message()"), " helps following this structure by building an error\n", #> "message from two parts: the ", list("issue"), #> " and the ", list("bullets"), ".\n", "\n", list( #> "cnd_issue()"), " is the generic for the main error message. It should\n", #> "be as generic as possible, but since it is a generic it is easy to\n", #> "override by error subclasses.\n", "\n", "The ", #> list("cnd_bullets()"), " methods should return a character vector of\n", #> "sentences. These are automatically prefixed with bullets by\n", #> list("cnd_message()"), ", according to the following scheme:\n", #> list("\n", list(), " Elements named ", list("\"i\""), #> " are prefixed with a blue \"info\" symbol.\n", #> list(), " Elements named ", list("\"x\""), #> " are prefixed with a red \"cross\" symbol.\n", #> list(), " Unnamed elements are prefixed with a \"*\" symbol.\n"), #> "\n", "\n", "While you are free to lay out the bullets in the order that you\n", #> "like, \"x\" bullets should usually precede \"i\" bullets.\n")), #> "\n", "\n", list(list("Overriding ", list("cnd_bullets()")), #> list("\n", "\n", "\n", "Sometimes the generation of an error message depends on the state\n", #> "of the type checking. In that case, it can be tricky to lazily\n", #> "generate error messages with ", list("cnd_bullets()"), #> ": you can either\n", "overspecify your error class hierarchies with one class per state,\n", #> "or replicate the type-checking control flow within the\n", #> list("cnd_bullets()"), " method. None of these options are ideal.\n", #> "\n", "A better option is to define a ", list( #> ".bullets"), " field in your error\n", "object. This should be a function (or a lambda-formula which will\n", #> "be passed to ", list(list("as_function()")), #> ") with the same signature as\n", list("cnd_bullets()"), #> " methods. This function overrides the\n", #> list("cnd_bullets()"), " generic and can generate an error message tailored\n", #> "to the state in which the error was constructed.\n", #> "\n", "Note that as a rule, ", list("cnd_issue()"), #> " should be a general thematic\n", "issues that does not depend on state. For this reason, it isn't\n", #> "possible to define an overriding method in the condition object.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> "\n", "This infrastructure is experimental. In particular, the output of\n", #> list("cnd_message()"), " is likely to change in the future and you shouldn't\n", #> "test it verbatim in a way that makes R CMD check fail. Instead, use\n", #> list(list("testthat::verify_output()")), " to monitor the output without causing\n", #> "CRAN check failures when it changes.\n")), "\n", #> "\n", list("internal"), "\n"), cnd_muffle.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-handlers.R", #> "\n", list("cnd_muffle"), "\n", list("cnd_muffle"), #> "\n", list("Muffle a condition"), "\n", list("\n", #> "cnd_muffle(cnd)\n"), "\n", list("\n", list(list( #> "cnd"), list("A condition to muffle.")), "\n"), #> "\n", list("\n", "Unlike ", list(list("exiting()")), #> " handlers, ", list(list("calling()")), " handlers must be explicit\n", #> "that they have handled a condition to stop it from propagating to\n", #> "other handlers. Use ", list("cnd_muffle()"), #> " within a calling handler (or as\n", "a calling handler, see examples) to prevent any other handlers from\n", #> "being called for that condition.\n"), "\n", #> list(list("Mufflable conditions"), list("\n", "\n", #> "\n", "Most conditions signalled by base R are muffable, although the name\n", #> "of the restart varies. cnd_muffle() will automatically call the\n", #> "correct restart for you. It is compatible with the following\n", #> "conditions:\n", list("\n", list(), " ", list( #> "warning"), " and ", list("message"), " conditions. In this case ", #> list("cnd_muffle()"), "\n", "is equivalent to ", #> list(list("base::suppressMessages()")), " and\n", #> list(list("base::suppressWarnings()")), ".\n", #> list(), " Bare conditions signalled with ", #> list("signal()"), " or ", list(list("cnd_signal()")), #> ". Note\n", "that conditions signalled with ", #> list(list("base::signalCondition()")), " are not\n", #> "mufflable.\n", list(), " Interrupts are sometimes signalled with a ", #> list("resume"), " restart on\n", "recent R versions. When this is the case, you can muffle the\n", #> "interrupt with ", list("cnd_muffle()"), ". Check if a restart is available\n", #> "with ", list("base::findRestart(\"resume\")"), #> ".\n"), "\n", "\n", "If you call ", list("cnd_muffle()"), #> " with a condition that is not mufflable\n", #> "you will cause a new error to be signalled.\n", #> list("\n", list(), " Errors are not mufflable since they are signalled in critical\n", #> "situations where execution cannot continue safely.\n", #> list(), " Conditions captured with ", list( #> list("base::tryCatch()")), ", ", list(list( #> "with_handlers()")), " or\n", list(list("catch_cnd()")), #> " are no longer mufflable. Muffling restarts ", #> list("must"), "\n", "be called from a ", list( #> "calling"), " handler.\n"), "\n")), "\n", #> "\n", list("\n", "fn <- function() {\n", " inform(\"Beware!\", \"my_particular_msg\")\n", #> " inform(\"On your guard!\")\n", " \"foobar\"\n", #> "}\n", "\n", "# Let's install a muffling handler for the condition thrown by `fn()`.\n", #> "# This will suppress all `my_particular_wng` warnings but let other\n", #> "# types of warnings go through:\n", "with_handlers(fn(),\n", #> " my_particular_msg = calling(function(cnd) {\n", #> " inform(\"Dealt with this particular message\")\n", #> " cnd_muffle(cnd)\n", " })\n", ")\n", "\n", #> "# Note how execution of `fn()` continued normally after dealing\n", #> "# with that particular message.\n", "\n", "# cnd_muffle() can also be passed to with_handlers() as a calling\n", #> "# handler:\n", "with_handlers(fn(),\n", " my_particular_msg = calling(cnd_muffle)\n", #> ")\n"), "\n"), cnd_signal.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-signal.R", #> "\n", list("cnd_signal"), "\n", list("cnd_signal"), #> "\n", list("Signal a condition object"), "\n", list( #> "\n", "cnd_signal(cnd, .cnd, .mufflable)\n"), #> "\n", list("\n", list(list("cnd"), list("A condition object (see ", #> list(list("cnd()")), ").")), "\n", "\n", list( #> list(".cnd, .mufflable"), list("These arguments are deprecated.")), #> "\n"), "\n", list("\n", "The type of signal depends on the class of the condition:\n", #> list("\n", list(), " A message is signalled if the condition inherits from\n", #> list("\"message\""), ". This is equivalent to signalling with ", #> list(list("inform()")), " or\n", list(list( #> "base::message()")), ".\n", list(), " A warning is signalled if the condition inherits from\n", #> list("\"warning\""), ". This is equivalent to signalling with ", #> list(list("warn()")), " or\n", list(list("base::warning()")), #> ".\n", list(), " An error is signalled if the condition inherits from\n", #> list("\"error\""), ". This is equivalent to signalling with ", #> list(list("abort()")), " or\n", list(list("base::stop()")), #> ".\n", list(), " An interrupt is signalled if the condition inherits from\n", #> list("\"interrupt\""), ". This is equivalent to signalling with\n", #> list(list("interrupt()")), ".\n"), "\n", "\n", #> "Use ", list(list("cnd_type()")), " to determine the type of a condition.\n"), #> "\n", list(list("Lifecycle"), list("\n", "\n", list( #> "\n", list(), " ", list(".cnd"), " has been renamed to ", #> list("cnd"), " and is deprecated as of rlang 0.3.0.\n", #> list(), " The ", list(".mufflable"), " argument is deprecated as of rlang 0.3.0 and no\n", #> "longer has any effect. Non-critical conditions are always\n", #> "signalled with a muffle restart.\n", list(), #> " Creating a condition object with ", list(list( #> "cnd_signal()")), " is deprecated as\n", "of rlang 0.3.0. Please use ", #> list(list("signal()")), " instead.\n"), "\n")), #> "\n", "\n", list("\n", "# The type of signal depends on the class. If the condition\n", #> "# inherits from \"warning\", a warning is issued:\n", #> "cnd <- warning_cnd(\"my_warning_class\", message = \"This is a warning\")\n", #> "cnd_signal(cnd)\n", "\n", "# If it inherits from \"error\", an error is raised:\n", #> "cnd <- error_cnd(\"my_error_class\", message = \"This is an error\")\n", #> "try(cnd_signal(cnd))\n"), "\n", list("\n", list( #> list("abort()")), ", ", list(list("warn()")), #> " and ", list(list("inform()")), " for creating and\n", #> "signalling structured R conditions. See ", list( #> list("with_handlers()")), " for\n", "establishing condition handlers.\n"), #> "\n"), cnd_type.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd.R", "\n", #> list("cnd_type"), "\n", list("cnd_type"), "\n", list( #> "What type is a condition?"), "\n", list("\n", #> "cnd_type(cnd)\n"), "\n", list("\n", list(list( #> "cnd"), list("A condition object.")), "\n"), #> "\n", list("\n", "A string, either ", list("\"condition\""), #> ", ", list("\"message\""), ", ", list("\"warning\""), #> ",\n", list("\"error\""), " or ", list("\"interrupt\""), #> ".\n"), "\n", list("\n", "Use ", list("cnd_type()"), #> " to check what type a condition is.\n"), "\n", #> list("\n", "cnd_type(catch_cnd(abort(\"Abort!\")))\n", #> "cnd_type(catch_cnd(interrupt()))\n"), "\n"), #> done.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/s3.R", "\n", #> list("done"), "\n", list("done"), "\n", list("is_done_box"), #> "\n", list("Box a final value for early termination"), #> "\n", list("\n", "done(x)\n", "\n", "is_done_box(x, empty = NULL)\n"), #> "\n", list("\n", list(list("x"), list("For ", list( #> "done()"), ", a value to box. For ", list("is_done_box()"), #> ", a\n", "value to test.")), "\n", "\n", list( #> list("empty"), list("Whether the box is empty. If ", #> list("NULL"), ", ", list("is_done_box()"), #> "\n", "returns ", list("TRUE"), " for all done boxes. If ", #> list("TRUE"), ", it returns ", list("TRUE"), #> "\n", "only for empty boxes. Otherwise it returns ", #> list("TRUE"), " only for\n", "non-empty boxes.")), #> "\n"), "\n", list("\n", "A ", list("boxed"), #> " value.\n"), "\n", list("\n", "A value boxed with ", #> list("done()"), " signals to its caller that it\n", #> "should stop iterating. Use it to shortcircuit a loop.\n"), #> "\n", list("\n", "done(3)\n", "\n", "x <- done(3)\n", #> "is_done_box(x)\n"), "\n"), dots_definitions.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/dots.R", "\n", #> list("dots_definitions"), "\n", list("dots_definitions"), #> "\n", list("Capture definition objects"), "\n", list( #> "\n", "dots_definitions(..., .named = FALSE, .ignore_empty = c(\"trailing\",\n", #> " \"none\", \"all\"))\n"), "\n", list("\n", #> list(list("..."), list("For ", list("enexprs()"), #> ", ", list("ensyms()"), " and ", list("enquos()"), #> ", names of\n", "arguments to capture without evaluation (including ", #> list("..."), "). For\n", list("exprs()"), " and ", #> list("quos()"), ", the expressions to capture unevaluated\n", #> "(including expressions contained in ", list( #> "..."), ").")), "\n", "\n", list(list(".named"), #> list("Whether to ensure all dots are named. Unnamed\n", #> "elements are processed with ", list(list( #> "quo_name()")), " to build a default\n", #> "name. See also ", list(list("quos_auto_name()")), #> ".")), "\n", "\n", list(list(".ignore_empty"), #> list("Whether to ignore empty arguments. Can be one\n", #> "of ", list("\"trailing\""), ", ", list("\"none\""), #> ", ", list("\"all\""), ". If ", list("\"trailing\""), #> ", only the\n", "last argument is ignored if it is empty. Note that ", #> list("\"trailing\""), "\n", "applies only to arguments passed in ", #> list("..."), ", not to named\n", "arguments. On the other hand, ", #> list("\"all\""), " also applies to named\n", #> "arguments.")), "\n"), "\n", list("\n", "Capture definition objects\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> list("dots_definitions()"), " is experimental. Expect API changes.\n")), #> "\n", "\n", list("internal"), "\n"), dots_n.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/dots.R", "\n", #> list("dots_n"), "\n", list("dots_n"), "\n", list( #> "How many arguments are currently forwarded in dots?"), #> "\n", list("\n", "dots_n(...)\n"), "\n", list("\n", #> list(list("..."), list("Forwarded arguments.")), #> "\n"), "\n", list("\n", "This returns the number of arguments currently forwarded in ", #> list("..."), "\n", "as an integer.\n"), "\n", #> list("\n", "fn <- function(...) dots_n(..., baz)\n", #> "fn(foo, bar)\n"), "\n"), dots_values.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/dots.R", "\n", #> list("dots_values"), "\n", list("dots_values"), "\n", #> list("Evaluate dots with preliminary splicing"), #> "\n", list("\n", "dots_values(..., .ignore_empty = c(\"trailing\", \"none\", \"all\"),\n", #> " .preserve_empty = FALSE, .homonyms = c(\"keep\", \"first\", \"last\",\n", #> " \"error\"), .check_assign = FALSE)\n"), "\n", #> list("\n", list(list("..."), list("Arguments to evaluate and process splicing operators.")), #> "\n", "\n", list(list(".ignore_empty"), list( #> "Whether to ignore empty arguments. Can be one\n", #> "of ", list("\"trailing\""), ", ", list("\"none\""), #> ", ", list("\"all\""), ". If ", list("\"trailing\""), #> ", only the\n", "last argument is ignored if it is empty.")), #> "\n", "\n", list(list(".preserve_empty"), list( #> "Whether to preserve the empty arguments that\n", #> "were not ignored. If ", list("TRUE"), ", empty arguments are stored with\n", #> list(list("missing_arg()")), " values. If ", #> list("FALSE"), " (the default) an error is\n", #> "thrown when an empty argument is detected.")), #> "\n", "\n", list(list(".homonyms"), list("How to treat arguments with the same name. The\n", #> "default, ", list("\"keep\""), ", preserves these arguments. Set ", #> list(".homonyms"), " to\n", list("\"first\""), #> " to only keep the first occurrences, to ", #> list("\"last\""), " to keep\n", "the last occurrences, and to ", #> list("\"error\""), " to raise an informative\n", #> "error and indicate what arguments have duplicated names.")), #> "\n", "\n", list(list(".check_assign"), list( #> "Whether to check for ", list("<-"), " calls passed in\n", #> "dots. When ", list("TRUE"), " and a ", list( #> "<-"), " call is detected, a warning is\n", #> "issued to advise users to use ", list("="), #> " if they meant to match a\n", "function parameter, or wrap the ", #> list("<-"), " call in braces otherwise.\n", #> "This ensures assignments are explicit.")), #> "\n"), "\n", list("\n", "This is a tool for advanced users. It captures dots, processes\n", #> "unquoting and splicing operators, and evaluates them. Unlike\n", #> list(list("dots_list()")), ", it does not flatten spliced objects, instead they\n", #> "are attributed a ", list("spliced"), " class (see ", #> list(list("splice()")), "). You can process\n", #> "spliced objects manually, perhaps with a custom predicate (see\n", #> list(list("flatten_if()")), ").\n"), "\n", list( #> "\n", "dots <- dots_values(!!! list(1, 2), 3)\n", #> "dots\n", "\n", "# Flatten the objects marked as spliced:\n", #> "flatten_if(dots, is_spliced)\n"), "\n"), duplicate.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/sexp.R", "\n", #> list("duplicate"), "\n", list("duplicate"), "\n", #> list("Duplicate an R object"), "\n", list("\n", "duplicate(x, shallow = FALSE)\n"), #> "\n", list("\n", list(list("x"), list("Any R object. However, uncopyable types like symbols and\n", #> "environments are returned as is (just like with ", #> list("<-"), ").")), "\n", "\n", list(list("shallow"), #> list("This is relevant for recursive data structures like\n", #> "lists, calls and pairlists. A shallow copy only duplicates the\n", #> "top-level data structure. The objects contained in the list are\n", #> "still the same.")), "\n"), "\n", list("\n", #> "In R semantics, objects are copied by value. This means that\n", #> "modifying the copy leaves the original object intact. Since\n", #> "copying data in memory is an expensive operation, copies in R are\n", #> "as lazy as possible. They only happen when the new object is\n", #> "actually modified. However, some operations (like ", #> list(list("node_poke_car()")), "\n", "or ", list( #> list("node_poke_cdr()")), ") do not support copy-on-write. In those cases,\n", #> "it is necessary to duplicate the object manually in order to\n", #> "preserve copy-by-value semantics.\n"), "\n", #> list("\n", "Some objects are not duplicable, like symbols and environments.\n", #> list("duplicate()"), " returns its input for these unique objects.\n"), #> "\n", list("\n", "pairlist\n"), "\n", list("internal"), #> "\n"), empty_env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("empty_env"), "\n", list("empty_env"), #> "\n", list("Get the empty environment"), "\n", list( #> "\n", "empty_env()\n"), "\n", list("\n", "The empty environment is the only one that does not have a parent.\n", #> "It is always used as the tail of an environment chain such as the\n", #> "search path (see ", list(list("search_envs()")), #> ").\n"), "\n", list("\n", "# Create environments with nothing in scope:\n", #> "child_env(empty_env())\n"), "\n"), entrace.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-entrace.R", #> "\n", list("entrace"), "\n", list("entrace"), "\n", #> list("cnd_entrace"), "\n", list("Add backtrace from error handler"), #> "\n", list("\n", "entrace(cnd, ..., top = NULL, bottom = NULL)\n", #> "\n", "cnd_entrace(cnd, ..., top = NULL, bottom = NULL)\n"), #> "\n", list("\n", list(list("cnd"), list("When ", #> list("entrace()"), " is used as a calling handler, ", #> list("cnd"), " is\n", "the condition to handle.")), #> "\n", "\n", list(list("..."), list("Unused. These dots are for future extensions.")), #> "\n", "\n", list(list("top"), list("The first frame environment to be included in the\n", #> "backtrace. This becomes the top of the backtrace tree and\n", #> "represents the oldest call in the backtrace.\n", #> "\n", "This is needed in particular when you call ", #> list("trace_back()"), "\n", "indirectly or from a larger context, for example in tests or\n", #> "inside an RMarkdown document where you don't want all of the\n", #> "knitr evaluation mechanisms to appear in the backtrace.")), #> "\n", "\n", list(list("bottom"), list("The last frame environment to be included in the\n", #> "backtrace. This becomes the rightmost leaf of the backtrace tree\n", #> "and represents the youngest call in the backtrace.\n", #> "\n", "Set this when you would like to capture a backtrace without the\n", #> "capture context.\n", "\n", "Can also be an integer that will be passed to ", #> list(list("caller_env()")), ".")), "\n"), "\n", #> list("\n", list("entrace()"), " interrupts an error throw to add an ", #> list("rlang backtrace"), " to the error. The error throw is\n", #> "immediately resumed. ", list("cnd_entrace()"), #> " adds a backtrace to a\n", "condition object, without any other effect. Both functions should\n", #> "be called directly from an error handler.\n", #> "\n", "Set the ", list("error"), " global option to ", #> list("quote(rlang::entrace())"), " to\n", "transform base errors to rlang errors. These enriched errors\n", #> "include a backtrace. The RProfile is a good place to set the\n", #> "handler. See ", list("rlang_backtrace_on_error"), #> " for details.\n", "\n", list("entrace()"), " also works as a ", #> list("calling"), " handler, though it\n", "is often more practical to use the higher-level function\n", #> list(list("with_abort()")), ".\n"), "\n", list( #> "\n", "if (FALSE) { # Not run\n", "\n", "# Set the error handler in your RProfile like this:\n", #> "if (requireNamespace(\"rlang\", quietly = TRUE)) {\n", #> " options(error = rlang::entrace)\n", "}\n", #> "\n", "}\n"), "\n", list("\n", list(list("with_abort()")), #> " to promote conditions to rlang errors.\n", #> list(list("cnd_entrace()")), " to manually add a backtrace to a condition.\n"), #> "\n"), env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env"), "\n", list("env"), "\n", list("child_env"), #> "\n", list("new_environment"), "\n", list("Create a new environment"), #> "\n", list("\n", "env(...)\n", "\n", "child_env(.parent, ...)\n", #> "\n", "new_environment(data = list(), parent = empty_env())\n"), #> "\n", list("\n", list(list("..., data"), list("Named values. You can supply one unnamed to specify\n", #> "a custom parent, otherwise it defaults to the current\n", #> "environment. These dots support ", list("tidy dots"), #> "\n", "features.")), "\n", "\n", list(list(".parent, parent"), #> list("A parent environment. Can be an object\n", #> "supported by ", list(list("as_environment()")), #> ".")), "\n"), "\n", list("\n", "These functions create new environments.\n", #> list("\n", list(), " ", list("env()"), " creates a child of the current environment by default\n", #> "and takes a variable number of named objects to populate it.\n", #> list(), " ", list("new_environment()"), " creates a child of the empty environment by\n", #> "default and takes a named list of objects to populate it.\n"), #> "\n"), "\n", list(list("Environments as objects"), #> list("\n", "\n", "\n", "Environments are containers of uniquely named objects. Their most\n", #> "common use is to provide a scope for the evaluation of R\n", #> "expressions. Not all languages have first class environments,\n", #> "i.e. can manipulate scope as regular objects. Reification of scope\n", #> "is one of the most powerful features of R as it allows you to change\n", #> "what objects a function or expression sees when it is evaluated.\n", #> "\n", "Environments also constitute a data structure in their own\n", #> "right. They are a collection of uniquely named objects, subsettable\n", #> "by name and modifiable by reference. This latter property (see\n", #> "section on reference semantics) is especially useful for creating\n", #> "mutable OO systems (cf the ", list(list("https://github.com/wch/R6"), #> list("R6 package")), "\n", "and the ", list( #> list("http://ggplot2.tidyverse.org/articles/extending-ggplot2.html"), #> list("ggproto system")), "\n", "for extending ggplot2).\n")), #> "\n", "\n", list(list("Inheritance"), list("\n", #> "\n", "\n", "All R environments (except the ", #> list("empty environment"), ") are\n", "defined with a parent environment. An environment and its\n", #> "grandparents thus form a linear hierarchy that is the basis for\n", #> list(list("https://en.wikipedia.org/wiki/Scope_(computer_science)"), #> list("lexical scoping")), " in\n", "R. When R evaluates an expression, it looks up symbols in a given\n", #> "environment. If it cannot find these symbols there, it keeps\n", #> "looking them up in parent environments. This way, objects defined\n", #> "in child environments have precedence over objects defined in\n", #> "parent environments.\n", "\n", "The ability of overriding specific definitions is used in the\n", #> "tidyeval framework to create powerful domain-specific grammars. A\n", #> "common use of masking is to put data frame columns in scope. See\n", #> "for example ", list(list("as_data_mask()")), #> ".\n")), "\n", "\n", list(list("Reference semantics"), #> list("\n", "\n", "\n", "Unlike regular objects such as vectors, environments are an\n", #> list("uncopyable"), " object type. This means that if you\n", #> "have multiple references to a given environment (by assigning the\n", #> "environment to another symbol with ", list( #> "<-"), " or passing the environment\n", "as argument to a function), modifying the bindings of one of those\n", #> "references changes all other references as well.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> list("\n", list(), " ", list("child_env()"), #> " is in the questioning stage. It is redundant now\n", #> "that ", list("env()"), " accepts parent environments.\n"), #> "\n")), "\n", "\n", list("\n", "# env() creates a new environment which has the current environment\n", #> "# as parent\n", "env <- env(a = 1, b = \"foo\")\n", #> "env$b\n", "identical(env_parent(env), current_env())\n", #> "\n", "# Supply one unnamed argument to override the default:\n", #> "env <- env(base_env(), a = 1, b = \"foo\")\n", #> "identical(env_parent(env), base_env())\n", "\n", #> "\n", "# child_env() lets you specify a parent:\n", #> "child <- child_env(env, c = \"bar\")\n", "identical(env_parent(child), env)\n", #> "\n", "# This child environment owns `c` but inherits `a` and `b` from `env`:\n", #> "env_has(child, c(\"a\", \"b\", \"c\", \"d\"))\n", #> "env_has(child, c(\"a\", \"b\", \"c\", \"d\"), inherit = TRUE)\n", #> "\n", "# `parent` is passed to as_environment() to provide handy\n", #> "# shortcuts. Pass a string to create a child of a package\n", #> "# environment:\n", "child_env(\"rlang\")\n", #> "env_parent(child_env(\"rlang\"))\n", "\n", "# Or `NULL` to create a child of the empty environment:\n", #> "child_env(NULL)\n", "env_parent(child_env(NULL))\n", #> "\n", "# The base package environment is often a good default choice for a\n", #> "# parent environment because it contains all standard base\n", #> "# functions. Also note that it will never inherit from other loaded\n", #> "# package environments since R keeps the base package at the tail\n", #> "# of the search path:\n", "base_child <- child_env(\"base\")\n", #> "env_has(base_child, c(\"lapply\", \"(\"), inherit = TRUE)\n", #> "\n", "# On the other hand, a child of the empty environment doesn't even\n", #> "# see a definition for `(`\n", "empty_child <- child_env(NULL)\n", #> "env_has(empty_child, c(\"lapply\", \"(\"), inherit = TRUE)\n", #> "\n", "# Note that all other package environments inherit from base_env()\n", #> "# as well:\n", "rlang_child <- child_env(\"rlang\")\n", #> "env_has(rlang_child, \"env\", inherit = TRUE) # rlang function\n", #> "env_has(rlang_child, \"lapply\", inherit = TRUE) # base function\n", #> "\n", "\n", "# Both env() and child_env() support tidy dots features:\n", #> "objs <- list(b = \"foo\", c = \"bar\")\n", "env <- env(a = 1, !!! objs)\n", #> "env$c\n", "\n", "# You can also unquote names with the definition operator `:=`\n", #> "var <- \"a\"\n", "env <- env(!!var := \"A\")\n", #> "env$a\n", "\n", "\n", "# Use new_environment() to create containers with the empty\n", #> "# environment as parent:\n", "env <- new_environment()\n", #> "env_parent(env)\n", "\n", "# Like other new_ constructors, it takes an object rather than dots:\n", #> "new_environment(list(a = \"foo\", b = \"bar\"))\n"), #> "\n", list("\n", list(list("env_has()")), ", ", list( #> list("env_bind()")), ".\n"), "\n"), env_bind.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_bind"), "\n", list("env_bind"), "\n", #> list("env_bind_lazy"), "\n", list("env_bind_active"), #> "\n", list("Bind symbols to objects in an environment"), #> "\n", list("\n", "env_bind(.env, ...)\n", "\n", "env_bind_lazy(.env, ..., .eval_env = caller_env())\n", #> "\n", "env_bind_active(.env, ...)\n"), "\n", #> list("\n", list(list(".env"), list("An environment.")), #> "\n", "\n", list(list("..."), list("Pairs of names and expressions, values or functions.\n", #> "Pass ", list(list("zap()")), " objects to remove bindings.\n", #> "\n", "These dots support ", list("tidy dots"), #> " features.")), "\n", "\n", list(list(".eval_env"), #> list("The environment where the expressions will be\n", #> "evaluated when the symbols are forced.")), #> "\n"), "\n", list("\n", "The input object ", #> list(".env"), ", with its associated environment\n", #> "modified in place, invisibly.\n"), "\n", list( #> "\n", "These functions create bindings in an environment. The bindings are\n", #> "supplied through ", list("..."), " as pairs of names and values or expressions.\n", #> list("env_bind()"), " is equivalent to evaluating a ", #> list("<-"), " expression within\n", "the given environment. This function should take care of the\n", #> "majority of use cases but the other variants can be useful for\n", #> "specific problems.\n", list("\n", list(), " ", #> list("env_bind()"), " takes named ", list("values"), #> " which are bound in ", list(".env"), ".\n", #> list("env_bind()"), " is equivalent to ", list( #> list("base::assign()")), ".\n", list(), " ", #> list("env_bind_active()"), " takes named ", #> list("functions"), " and creates active\n", #> "bindings in ", list(".env"), ". This is equivalent to\n", #> list(list("base::makeActiveBinding()")), ". An active binding executes a\n", #> "function each time it is evaluated. The arguments are passed to\n", #> list(list("as_function()")), " so you can supply formulas instead of functions.\n", #> "\n", "Remember that functions are scoped in their own environment.\n", #> "These functions can thus refer to symbols from this enclosure\n", #> "that are not actually in scope in the dynamic environment where\n", #> "the active bindings are invoked. This allows creative solutions\n", #> "to difficult problems (see the implementations of ", #> list("dplyr::do()"), "\n", "methods for an example).\n", #> list(), " ", list("env_bind_lazy()"), " takes named ", #> list("expressions"), ". This is equivalent\n", #> "to ", list(list("base::delayedAssign()")), #> ". The arguments are captured with\n", list( #> list("exprs()")), " (and thus support call-splicing and unquoting) and\n", #> "assigned to symbols in ", list(".env"), ". These expressions are not\n", #> "evaluated immediately but lazily. Once a symbol is evaluated, the\n", #> "corresponding expression is evaluated in turn and its value is\n", #> "bound to the symbol (the expressions are thus evaluated only\n", #> "once, if at all).\n"), "\n"), "\n", list(list( #> "Side effects"), list("\n", "\n", "\n", "Since environments have reference semantics (see relevant section\n", #> "in ", list(list("env()")), " documentation), modifying the bindings of an environment\n", #> "produces effects in all other references to that environment. In\n", #> "other words, ", list("env_bind()"), " and its variants have side effects.\n", #> "\n", "Like other side-effecty functions like ", #> list("par()"), " and ", list("options()"), ",\n", #> list("env_bind()"), " and variants return the old values invisibly.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> "\n", "Passing an environment wrapper like a formula or a function instead\n", #> "of an environment is soft-deprecated as of rlang 0.3.0. This\n", #> "internal genericity was causing confusion (see issue #427). You\n", #> "should now extract the environment separately before calling these\n", #> "functions.\n")), "\n", "\n", list("\n", "# env_bind() is a programmatic way of assigning values to symbols\n", #> "# with `<-`. We can add bindings in the current environment:\n", #> "env_bind(current_env(), foo = \"bar\")\n", "foo\n", #> "\n", "# Or modify those bindings:\n", "bar <- \"bar\"\n", #> "env_bind(current_env(), bar = \"BAR\")\n", "bar\n", #> "\n", "# You can remove bindings by supplying zap sentinels:\n", #> "env_bind(current_env(), foo = zap())\n", "try(foo)\n", #> "\n", "# Unquote-splice a named list of zaps\n", #> "zaps <- rep_named(c(\"foo\", \"bar\"), list(zap()))\n", #> "env_bind(current_env(), !!!zaps)\n", "try(bar)\n", #> "\n", "# It is most useful to change other environments:\n", #> "my_env <- env()\n", "env_bind(my_env, foo = \"foo\")\n", #> "my_env$foo\n", "\n", "# A useful feature is to splice lists of named values:\n", #> "vals <- list(a = 10, b = 20)\n", "env_bind(my_env, !!!vals, c = 30)\n", #> "my_env$b\n", "my_env$c\n", "\n", "# You can also unquote a variable referring to a symbol or a string\n", #> "# as binding name:\n", "var <- \"baz\"\n", "env_bind(my_env, !!var := \"BAZ\")\n", #> "my_env$baz\n", "\n", "\n", "# The old values of the bindings are returned invisibly:\n", #> "old <- env_bind(my_env, a = 1, b = 2, baz = \"baz\")\n", #> "old\n", "\n", "# You can restore the original environment state by supplying the\n", #> "# old values back:\n", "env_bind(my_env, !!!old)\n", #> "\n", "# env_bind_lazy() assigns expressions lazily:\n", #> "env <- env()\n", "env_bind_lazy(env, name = { cat(\"forced!\\n\"); \"value\" })\n", #> "\n", "# Referring to the binding will cause evaluation:\n", #> "env$name\n", "\n", "# But only once, subsequent references yield the final value:\n", #> "env$name\n", "\n", "# You can unquote expressions:\n", #> "expr <- quote(message(\"forced!\"))\n", "env_bind_lazy(env, name = !!expr)\n", #> "env$name\n", "\n", "\n", "# By default the expressions are evaluated in the current\n", #> "# environment. For instance we can create a local binding and refer\n", #> "# to it, even though the variable is bound in a different\n", #> "# environment:\n", "who <- \"mickey\"\n", "env_bind_lazy(env, name = paste(who, \"mouse\"))\n", #> "env$name\n", "\n", "# You can specify another evaluation environment with `.eval_env`:\n", #> "eval_env <- env(who = \"minnie\")\n", "env_bind_lazy(env, name = paste(who, \"mouse\"), .eval_env = eval_env)\n", #> "env$name\n", "\n", "# Or by unquoting a quosure:\n", #> "quo <- local({\n", " who <- \"fievel\"\n", #> " quo(paste(who, \"mouse\"))\n", "})\n", "env_bind_lazy(env, name = !!quo)\n", #> "env$name\n", "\n", "# You can create active bindings with env_bind_active(). Active\n", #> "# bindings execute a function each time they are evaluated:\n", #> "fn <- function() {\n", " cat(\"I have been called\\n\")\n", #> " rnorm(1)\n", "}\n", "\n", "env <- env()\n", #> "env_bind_active(env, symbol = fn)\n", "\n", #> "# `fn` is executed each time `symbol` is evaluated or retrieved:\n", #> "env$symbol\n", "env$symbol\n", "eval_bare(quote(symbol), env)\n", #> "eval_bare(quote(symbol), env)\n", "\n", "# All arguments are passed to as_function() so you can use the\n", #> "# formula shortcut:\n", "env_bind_active(env, foo = ~ runif(1))\n", #> "env$foo\n", "env$foo\n"), "\n"), env_bind_exprs.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("env_bind_exprs"), "\n", list("env_bind_exprs"), #> "\n", list("env_bind_fns"), "\n", list("Bind a promise or active binding"), #> "\n", list("\n", "env_bind_exprs(.env, ..., .eval_env = caller_env())\n", #> "\n", "env_bind_fns(.env, ...)\n"), "\n", list( #> "\n", list(list(".env"), list("An environment.")), #> "\n", "\n", list(list("..."), list("Pairs of names and expressions, values or functions.\n", #> "Pass ", list(list("zap()")), " objects to remove bindings.\n", #> "\n", "These dots support ", list("tidy dots"), #> " features.")), "\n", "\n", list(list(".eval_env"), #> list("The environment where the expressions will be\n", #> "evaluated when the symbols are forced.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "As of rlang 0.3.0, ", list("env_bind_exprs()"), #> " and ", list("env_bind_fns()"), " have\n", "been renamed to ", #> list(list("env_bind_lazy()")), " and ", list( #> list("env_bind_active()")), " for\n", "consistency.\n"), #> "\n", list("internal"), "\n"), env_binding_are_active.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_binding_are_active"), "\n", list( #> "env_binding_are_active"), "\n", list("env_binding_are_lazy"), #> "\n", list("What kind of environment binding?"), #> "\n", list("\n", "env_binding_are_active(env, nms = NULL)\n", #> "\n", "env_binding_are_lazy(env, nms = NULL)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("Names of bindings. Defaults to all bindings in ", #> list("env"), ".")), "\n"), "\n", list("\n", #> "A logical vector as long as ", list("nms"), #> " and named after it.\n"), "\n", list("\n", list( #> "rlang:::lifecycle(\"experimental\")"), "\n"), #> "\n", list("internal"), "\n"), env_binding_lock.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_binding_lock"), "\n", list("env_binding_lock"), #> "\n", list("env_binding_unlock"), "\n", list("env_binding_are_locked"), #> "\n", list("Lock or unlock environment bindings"), #> "\n", list("\n", "env_binding_lock(env, nms = NULL)\n", #> "\n", "env_binding_unlock(env, nms = NULL)\n", #> "\n", "env_binding_are_locked(env, nms = NULL)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("Names of bindings. Defaults to all bindings in ", #> list("env"), ".")), "\n"), "\n", list("\n", #> list("env_binding_are_unlocked()"), " returns a logical vector as\n", #> "long as ", list("nms"), " and named after it. ", #> list("env_binding_lock()"), " and\n", list("env_binding_unlock()"), #> " return the old value of\n", list("env_binding_are_unlocked()"), #> " invisibly.\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "Locked environment bindings trigger an error when an attempt is\n", #> "made to redefine the binding.\n"), "\n", list( #> "\n", "# Bindings are unlocked by default:\n", #> "env <- env(a = \"A\", b = \"B\")\n", "env_binding_are_locked(env)\n", #> "\n", "# But can optionally be locked:\n", "env_binding_lock(env, \"a\")\n", #> "env_binding_are_locked(env)\n", "\n", "# If run, the following would now return an error because `a` is locked:\n", #> "# env_bind(env, a = \"foo\")\n", "# with_env(env, a <- \"bar\")\n", #> "\n", "# Let's unlock it. Note that the return value indicate which\n", #> "# bindings were locked:\n", "were_locked <- env_binding_unlock(env)\n", #> "were_locked\n", "\n", "# Now that it is unlocked we can modify it again:\n", #> "env_bind(env, a = \"foo\")\n", "with_env(env, a <- \"bar\")\n", #> "env$a\n"), "\n", list("\n", list(list("env_lock()")), #> " for locking an environment.\n"), "\n", list( #> "internal"), "\n"), env_bury.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-binding.R", #> "\n", list("env_bury"), "\n", list("env_bury"), "\n", #> list("Mask bindings by defining symbols deeper in a scope"), #> "\n", list("\n", "env_bury(.env, ...)\n"), "\n", #> list("\n", list(list(".env"), list("An environment.")), #> "\n", "\n", list(list("..."), list("Pairs of names and expressions, values or functions.\n", #> "Pass ", list(list("zap()")), " objects to remove bindings.\n", #> "\n", "These dots support ", list("tidy dots"), #> " features.")), "\n"), "\n", list("\n", "A copy of ", #> list(".env"), " enclosing the new environment containing\n", #> "bindings to ", list("..."), " arguments.\n"), #> "\n", list("\n", list("env_bury()"), " is like ", #> list(list("env_bind()")), " but it creates the bindings in a\n", #> "new child environment. This makes sure the new bindings have\n", #> "precedence over old ones, without altering existing environments.\n", #> "Unlike ", list("env_bind()"), ", this function does not have side effects and\n", #> "returns a new environment (or object wrapping that environment).\n"), #> "\n", list("\n", "orig_env <- env(a = 10)\n", "fn <- set_env(function() a, orig_env)\n", #> "\n", "# fn() currently sees `a` as the value `10`:\n", #> "fn()\n", "\n", "# env_bury() will bury the current scope of fn() behind a new\n", #> "# environment:\n", "fn <- env_bury(fn, a = 1000)\n", #> "fn()\n", "\n", "# Even though the symbol `a` is still defined deeper in the scope:\n", #> "orig_env$a\n"), "\n", list("\n", list(list("env_bind()")), #> ", ", list(list("env_unbind()")), "\n"), "\n"), #> env_clone.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_clone"), "\n", list("env_clone"), "\n", #> list("Clone an environment"), "\n", list("\n", "env_clone(env, parent = env_parent(env))\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("parent"), list("The parent of the cloned environment.")), #> "\n"), "\n", list("\n", "This creates a new environment containing exactly the same objects,\n", #> "optionally with a new parent.\n"), "\n", list( #> "\n", "env <- env(!!! mtcars)\n", "clone <- env_clone(env)\n", #> "identical(env, clone)\n", "identical(env$cyl, clone$cyl)\n"), #> "\n"), env_depth.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_depth"), "\n", list("env_depth"), "\n", #> list("Depth of an environment chain"), "\n", list( #> "\n", "env_depth(env)\n"), "\n", list("\n", list( #> list("env"), list("An environment.")), "\n"), #> "\n", list("\n", "An integer.\n"), "\n", list("\n", #> "This function returns the number of environments between ", #> list("env"), " and\n", "the ", list("empty environment"), #> ", including ", list("env"), ". The depth of\n", #> list("env"), " is also the number of parents of ", #> list("env"), " (since the empty\n", "environment counts as a parent).\n"), #> "\n", list("\n", "env_depth(empty_env())\n", "env_depth(pkg_env(\"rlang\"))\n"), #> "\n", list("\n", "The section on inheritance in ", #> list(list("env()")), " documentation.\n"), "\n"), #> env_get.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-binding.R", #> "\n", list("env_get"), "\n", list("env_get"), "\n", #> list("env_get_list"), "\n", list("Get an object in an environment"), #> "\n", list("\n", "env_get(env = caller_env(), nm, default, inherit = FALSE)\n", #> "\n", "env_get_list(env = caller_env(), nms, default, inherit = FALSE)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nm, nms"), list("Names of bindings. ", #> list("nm"), " must be a single string.")), #> "\n", "\n", list(list("default"), list("A default value in case there is no binding for ", #> list("nm"), "\n", "in ", list("env"), ".")), #> "\n", "\n", list(list("inherit"), list("Whether to look for bindings in the parent\n", #> "environments.")), "\n"), "\n", list("\n", #> "An object if it exists. Otherwise, throws an error.\n"), #> "\n", list("\n", list("env_get()"), " extracts an object from an enviroment ", #> list("env"), ". By\n", "default, it does not look in the parent environments.\n", #> list("env_get_list()"), " extracts multiple objects from an environment into\n", #> "a named list.\n"), "\n", list("\n", "parent <- child_env(NULL, foo = \"foo\")\n", #> "env <- child_env(parent, bar = \"bar\")\n", #> "\n", "# This throws an error because `foo` is not directly defined in env:\n", #> "# env_get(env, \"foo\")\n", "\n", "# However `foo` can be fetched in the parent environment:\n", #> "env_get(env, \"foo\", inherit = TRUE)\n", "\n", #> "# You can also avoid an error by supplying a default value:\n", #> "env_get(env, \"foo\", default = \"FOO\")\n"), #> "\n"), env_has.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-binding.R", #> "\n", list("env_has"), "\n", list("env_has"), "\n", #> list("Does an environment have or see bindings?"), #> "\n", list("\n", "env_has(env = caller_env(), nms, inherit = FALSE)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("A character vector containing the names of the bindings\n", #> "to remove.")), "\n", "\n", list(list("inherit"), #> list("Whether to look for bindings in the parent\n", #> "environments.")), "\n"), "\n", list("\n", #> "A named logical vector as long as ", list("nms"), #> ".\n"), "\n", list("\n", list("env_has()"), " is a vectorised predicate that queries whether an\n", #> "environment owns bindings personally (with ", #> list("inherit"), " set to\n", list("FALSE"), #> ", the default), or sees them in its own environment or in\n", #> "any of its parents (with ", list("inherit = TRUE"), #> ").\n"), "\n", list("\n", "parent <- child_env(NULL, foo = \"foo\")\n", #> "env <- child_env(parent, bar = \"bar\")\n", #> "\n", "# env does not own `foo` but sees it in its parent environment:\n", #> "env_has(env, \"foo\")\n", "env_has(env, \"foo\", inherit = TRUE)\n"), #> "\n"), env_inherits.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_inherits"), "\n", list("env_inherits"), #> "\n", list("Does environment inherit from another environment?"), #> "\n", list("\n", "env_inherits(env, ancestor)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("ancestor"), list("Another environment from which ", #> list("x"), " might inherit.")), "\n"), "\n", #> list("\n", "This returns ", list("TRUE"), " if ", #> list("x"), " has ", list("ancestor"), " among its parents.\n"), #> "\n"), env_lock.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_lock"), "\n", list("env_lock"), "\n", list( #> "env_is_locked"), "\n", list("Lock an environment"), #> "\n", list("\n", "env_lock(env)\n", "\n", "env_is_locked(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "The old value of ", #> list("env_is_locked()"), " invisibly.\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "Locked environments cannot be modified. An important example is\n", #> "namespace environments which are locked by R when loaded in a\n", #> "session. Once an environment is locked it normally cannot be\n", #> "unlocked.\n", "\n", "Note that only the environment as a container is locked, not the\n", #> "individual bindings. You can't remove or add a binding but you can\n", #> "still modify the values of existing bindings. See\n", #> list(list("env_binding_lock()")), " for locking individual bindings.\n"), #> "\n", list("\n", "# New environments are unlocked by default:\n", #> "env <- env(a = 1)\n", "env_is_locked(env)\n", #> "\n", "# Use env_lock() to lock them:\n", "env_lock(env)\n", #> "env_is_locked(env)\n", "\n", "# Now that `env` is locked, it is no longer possible to remove or\n", #> "# add bindings. If run, the following would fail:\n", #> "# env_unbind(env, \"a\")\n", "# env_bind(env, b = 2)\n", #> "\n", "# Note that even though the environment as a container is locked,\n", #> "# the individual bindings are still unlocked and can be modified:\n", #> "env$a <- 10\n"), "\n", list("\n", list(list( #> "env_binding_lock()")), "\n"), "\n"), env_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-special.R", #> "\n", list("env_name"), "\n", list("env_name"), "\n", #> list("env_label"), "\n", list("Label of an environment"), #> "\n", list("\n", "env_name(env)\n", "\n", "env_label(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "Special environments like the global environment have their own\n", #> "names. ", list("env_name()"), " returns:\n", #> list("\n", list(), " \"global\" for the global environment.\n", #> list(), " \"empty\" for the empty environment.\n", #> list(), " \"base\" for the base package environment (the last environment on\n", #> "the search path).\n", list(), " \"namespace:pkg\" if ", #> list("env"), " is the namespace of the package \"pkg\".\n", #> list(), " The ", list("name"), " attribute of ", #> list("env"), " if it exists. This is how the\n", #> list("package environments"), " and the ", #> list("imports environments"), " store their names. The name of package\n", #> "environments is typically \"package:pkg\".\n", #> list(), " The empty string ", list("\"\""), #> " otherwise.\n"), "\n", "\n", list("env_label()"), #> " is exactly like ", list("env_name()"), " but returns the memory\n", #> "address of anonymous environments as fallback.\n"), #> "\n", list("\n", "# Some environments have specific names:\n", #> "env_name(global_env())\n", "env_name(ns_env(\"rlang\"))\n", #> "\n", "# Anonymous environments don't have names but are labelled by their\n", #> "# address in memory:\n", "env_name(env())\n", #> "env_label(env())\n"), "\n"), env_names.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_names"), "\n", list("env_names"), #> "\n", list("env_length"), "\n", list("Names and numbers of symbols bound in an environment"), #> "\n", list("\n", "env_names(env)\n", "\n", "env_length(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "A character vector of object names.\n"), #> "\n", list("\n", list("env_names()"), " returns object names from an enviroment ", #> list("env"), " as a\n", "character vector. All names are returned, even those starting with\n", #> "a dot. ", list("env_length()"), " returns the number of bindings.\n"), #> "\n", list(list("Names of symbols and objects"), #> list("\n", "\n", "\n", "Technically, objects are bound to symbols rather than strings,\n", #> "since the R interpreter evaluates symbols (see ", #> list(list("is_expression()")), " for a\n", #> "discussion of symbolic objects versus literal objects). However it\n", #> "is often more convenient to work with strings. In rlang\n", #> "terminology, the string corresponding to a symbol is called the\n", #> list("name"), " of the symbol (or by extension the name of an object bound\n", #> "to a symbol).\n")), "\n", "\n", list(list( #> "Encoding"), list("\n", "\n", "\n", "There are deep encoding issues when you convert a string to symbol\n", #> "and vice versa. Symbols are ", list("always"), #> " in the native encoding. If\n", "that encoding (let's say latin1) cannot support some characters,\n", #> "these characters are serialised to ASCII. That's why you sometimes\n", #> "see strings looking like ", list("<U+1234>"), #> ", especially if you're running\n", "Windows (as R doesn't support UTF-8 as native encoding on that\n", #> "platform).\n", "\n", "To alleviate some of the encoding pain, ", #> list("env_names()"), " always\n", "returns a UTF-8 character vector (which is fine even on Windows)\n", #> "with ASCII unicode points translated back to UTF-8.\n")), #> "\n", "\n", list("\n", "env <- env(a = 1, b = 2)\n", #> "env_names(env)\n"), "\n"), env_parent.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env.R", "\n", list( #> "env_parent"), "\n", list("env_parent"), "\n", #> list("env_tail"), "\n", list("env_parents"), "\n", #> list("Get parent environments"), "\n", list("\n", #> "env_parent(env = caller_env(), n = 1)\n", "\n", #> "env_tail(env = caller_env(), last = global_env(), sentinel = NULL)\n", #> "\n", "env_parents(env = caller_env(), last = global_env())\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("n"), list("The number of generations to go up.")), #> "\n", "\n", list(list("last"), list("The environment at which to stop. Defaults to the\n", #> "global environment. The empty environment is always a stopping\n", #> "condition so it is safe to leave the default even when taking the\n", #> "tail or the parents of an environment on the search path.\n", #> "\n", list("env_tail()"), " returns the environment which has ", #> list("last"), " as parent\n", "and ", list( #> "env_parents()"), " returns the list of environments up to ", #> list("last"), ".")), "\n", "\n", list(list( #> "sentinel"), list("This argument is defunct, please use ", #> list("last"), " instead.")), "\n"), "\n", list( #> "\n", "An environment for ", list("env_parent()"), #> " and ", list("env_tail()"), ", a list\n", "of environments for ", #> list("env_parents()"), ".\n"), "\n", list("\n", #> list("\n", list(), " ", list("env_parent()"), #> " returns the parent environment of ", list( #> "env"), " if called\n", "with ", list("n = 1"), #> ", the grandparent with ", list("n = 2"), ", etc.\n", #> list(), " ", list("env_tail()"), " searches through the parents and returns the one\n", #> "which has ", list(list("empty_env()")), " as parent.\n", #> list(), " ", list("env_parents()"), " returns the list of all parents, including the\n", #> "empty environment. This list is named using ", #> list(list("env_name()")), ".\n"), "\n", "\n", #> "See the section on ", list("inheritance"), " in ", #> list(list("env()")), "'s documentation.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "The ", list("sentinel"), " argument of ", list( #> "env_tail()"), " has been deprecated in\n", #> "rlang 0.2.0 and renamed to ", list("last"), #> ". It is defunct as of rlang 0.4.0.\n")), "\n", #> "\n", list("\n", "# Get the parent environment with env_parent():\n", #> "env_parent(global_env())\n", "\n", "# Or the tail environment with env_tail():\n", #> "env_tail(global_env())\n", "\n", "# By default, env_parent() returns the parent environment of the\n", #> "# current evaluation frame. If called at top-level (the global\n", #> "# frame), the following two expressions are equivalent:\n", #> "env_parent()\n", "env_parent(base_env())\n", #> "\n", "# This default is more handy when called within a function. In this\n", #> "# case, the enclosure environment of the function is returned\n", #> "# (since it is the parent of the evaluation frame):\n", #> "enclos_env <- env()\n", "fn <- set_env(function() env_parent(), enclos_env)\n", #> "identical(enclos_env, fn())\n"), "\n"), env_poke.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_poke"), "\n", list("env_poke"), "\n", #> list("Poke an object in an environment"), "\n", list( #> "\n", "env_poke(env = caller_env(), nm, value, inherit = FALSE,\n", #> " create = !inherit)\n"), "\n", list("\n", list( #> list("env"), list("An environment.")), "\n", #> "\n", list(list("nm"), list("Names of bindings. ", #> list("nm"), " must be a single string.")), #> "\n", "\n", list(list("value"), list("The value for a new binding.")), #> "\n", "\n", list(list("inherit"), list("Whether to look for bindings in the parent\n", #> "environments.")), "\n", "\n", list(list("create"), #> list("Whether to create a binding if it does not already\n", #> "exist in the environment.")), "\n"), "\n", #> list("\n", "The old value of ", list("nm"), " or a ", #> list("zap sentinel"), " if the\n", "binding did not exist yet.\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", list("env_poke()"), " will assign or reassign a binding in ", #> list("env"), " if ", list("create"), "\n", "is ", #> list("TRUE"), ". If ", list("create"), " is ", #> list("FALSE"), " and a binding does not already\n", #> "exists, an error is issued.\n"), "\n", list( #> "\n", "If ", list("inherit"), " is ", list("TRUE"), #> ", the parents environments are checked for\n", #> "an existing binding to reassign. If not found and ", #> list("create"), " is\n", list("TRUE"), ", a new binding is created in ", #> list("env"), ". The default value for\n", list( #> "create"), " is a function of ", list("inherit"), #> ": ", list("FALSE"), " when inheriting,\n", list( #> "TRUE"), " otherwise.\n", "\n", "This default makes sense because the inheriting case is mostly\n", #> "for overriding an existing binding. If not found, something\n", #> "probably went wrong and it is safer to issue an error. Note that\n", #> "this is different to the base R operator ", #> list("<<-"), " which will create\n", "a binding in the global environment instead of the current\n", #> "environment when no existing binding is found in the parents.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> list("env_poke()"), " is experimental. We are still experimenting with\n", #> "reducing the number of redundant functions by using quasiquotation.\n", #> "It is possible ", list("env_poke()"), " will be deprecated in favour of\n", #> list("env_bind()"), " and name-unquoting with ", #> list(":="), ".\n")), "\n", "\n", list("internal"), #> "\n"), env_print.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_print"), "\n", list("env_print"), "\n", #> list("Pretty-print an environment"), "\n", list("\n", #> "env_print(env = caller_env())\n"), "\n", list( #> "\n", list(list("env"), list("An environment, or object that can be converted to an\n", #> "environment by ", list(list("get_env()")), #> ".")), "\n"), "\n", list("\n", "This prints:\n", #> list("\n", list(), " The ", list("label"), " and the parent label.\n", #> list(), " Whether the environment is ", list( #> "locked"), ".\n", list(), " The bindings in the environment (up to 20 bindings). They are\n", #> "printed succintly using ", list("pillar::type_sum()"), #> " (if available,\n", "otherwise uses an internal version of that generic). In addition\n", #> list("fancy bindings"), " (actives and promises) are\n", #> "indicated as such.\n", list(), " Locked bindings get a ", #> list("[L]"), " tag\n"), "\n"), "\n"), env_unbind.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_unbind"), "\n", list("env_unbind"), #> "\n", list("Remove bindings from an environment"), #> "\n", list("\n", "env_unbind(env = caller_env(), nms, inherit = FALSE)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("A character vector containing the names of the bindings\n", #> "to remove.")), "\n", "\n", list(list("inherit"), #> list("Whether to look for bindings in the parent\n", #> "environments.")), "\n"), "\n", list("\n", #> "The input object ", list("env"), " with its associated environment\n", #> "modified in place, invisibly.\n"), "\n", list( #> "\n", list("env_unbind()"), " is the complement of ", #> list(list("env_bind()")), ". Like ", list("env_has()"), #> ",\n", "it ignores the parent environments of ", #> list("env"), " by default. Set\n", list("inherit"), #> " to ", list("TRUE"), " to track down bindings in parent environments.\n"), #> "\n", list("\n", "data <- set_names(as.list(letters), letters)\n", #> "env_bind(environment(), !!! data)\n", "env_has(environment(), letters)\n", #> "\n", "# env_unbind() removes bindings:\n", "env_unbind(environment(), letters)\n", #> "env_has(environment(), letters)\n", "\n", "# With inherit = TRUE, it removes bindings in parent environments\n", #> "# as well:\n", "parent <- child_env(NULL, foo = \"a\")\n", #> "env <- child_env(parent, foo = \"b\")\n", "env_unbind(env, \"foo\", inherit = TRUE)\n", #> "env_has(env, \"foo\", inherit = TRUE)\n"), "\n"), #> env_unlock.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_unlock"), "\n", list("env_unlock"), "\n", #> list("Unlock an environment"), "\n", list("\n", "env_unlock(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "Whether the environment has been unlocked.\n"), #> "\n", list("\n", "This function should only be used in development tools or\n", #> "interactively.\n"), "\n", list("internal"), #> "\n"), eval_bare.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval.R", #> "\n", list("eval_bare"), "\n", list("eval_bare"), #> "\n", list("Evaluate an expression in an environment"), #> "\n", list("\n", "eval_bare(expr, env = parent.frame())\n"), #> "\n", list("\n", list(list("expr"), list("An expression to evaluate.")), #> "\n", "\n", list(list("env"), list("The environment in which to evaluate the expression.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", list("eval_bare()"), " is a lower-level version of function ", #> list(list("base::eval()")), ".\n", "Technically, it is a simple wrapper around the C function\n", #> list("Rf_eval()"), ". You generally don't need to use ", #> list("eval_bare()"), " instead\n", "of ", list( #> "eval()"), ". Its main advantage is that it handles stack-sensitive\n", #> "(calls such as ", list("return()"), ", ", list( #> "on.exit()"), " or ", list("parent.frame()"), #> ") more\n", "consistently when you pass an enviroment of a frame on the call\n", #> "stack.\n"), "\n", list("\n", "These semantics are possible because ", #> list("eval_bare()"), " creates only one\n", "frame on the call stack whereas ", #> list("eval()"), " creates two frames, the\n", #> "second of which has the user-supplied environment as frame\n", #> "environment. When you supply an existing frame environment to\n", #> list("base::eval()"), " there will be two frames on the stack with the same\n", #> "frame environment. Stack-sensitive functions only detect the\n", #> "topmost of these frames. We call these evaluation semantics\n", #> "\"stack inconsistent\".\n", "\n", "Evaluating expressions in the actual frame environment has useful\n", #> "practical implications for ", list("eval_bare()"), #> ":\n", list("\n", list(), " ", list("return()"), #> " calls are evaluated in frame environments that might\n", #> "be burried deep in the call stack. This causes a long return that\n", #> "unwinds multiple frames (triggering the ", #> list("on.exit()"), " event for\n", "each frame). By contrast ", #> list("eval()"), " only returns from the ", #> list("eval()"), "\n", "call, one level up.\n", #> list(), " ", list("on.exit()"), ", ", list( #> "parent.frame()"), ", ", list("sys.call()"), #> ", and generally all\n", "the stack inspection functions ", #> list("sys.xxx()"), " are evaluated in the\n", #> "correct frame environment. This is similar to how this type of\n", #> "calls can be evaluated deep in the call stack because of lazy\n", #> "evaluation, when you force an argument that has been passed\n", #> "around several times.\n"), "\n", "\n", "The flip side of the semantics of ", #> list("eval_bare()"), " is that it can't\n", "evaluate ", #> list("break"), " or ", list("next"), " expressions even if called within a\n", #> "loop.\n"), "\n", list("\n", "# eval_bare() works just like base::eval() but you have to create\n", #> "# the evaluation environment yourself:\n", "eval_bare(quote(foo), env(foo = \"bar\"))\n", #> "\n", "# eval() has different evaluation semantics than eval_bare(). It\n", #> "# can return from the supplied environment even if its an\n", #> "# environment that is not on the call stack (i.e. because you've\n", #> "# created it yourself). The following would trigger an error with\n", #> "# eval_bare():\n", "ret <- quote(return(\"foo\"))\n", #> "eval(ret, env())\n", "# eval_bare(ret, env()) # \"no function to return from\" error\n", #> "\n", "# Another feature of eval() is that you can control surround loops:\n", #> "bail <- quote(break)\n", "while (TRUE) {\n", #> " eval(bail)\n", " # eval_bare(bail) # \"no loop for break/next\" error\n", #> "}\n", "\n", "# To explore the consequences of stack inconsistent semantics, let's\n", #> "# create a function that evaluates `parent.frame()` deep in the call\n", #> "# stack, in an environment corresponding to a frame in the middle of\n", #> "# the stack. For consistency with R's lazy evaluation semantics, we'd\n", #> "# expect to get the caller of that frame as result:\n", #> "fn <- function(eval_fn) {\n", " list(\n", " returned_env = middle(eval_fn),\n", #> " actual_env = current_env()\n", " )\n", #> "}\n", "middle <- function(eval_fn) {\n", " deep(eval_fn, current_env())\n", #> "}\n", "deep <- function(eval_fn, eval_env) {\n", #> " expr <- quote(parent.frame())\n", " eval_fn(expr, eval_env)\n", #> "}\n", "\n", "# With eval_bare(), we do get the expected environment:\n", #> "fn(rlang::eval_bare)\n", "\n", "# But that's not the case with base::eval():\n", #> "fn(base::eval)\n"), "\n", list("\n", list(list( #> "eval_tidy()")), " for evaluation with data mask and quosure\n", #> "support.\n"), "\n"), eval_tidy.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval-tidy.R", #> "\n", list("eval_tidy"), "\n", list("eval_tidy"), #> "\n", list("Evaluate an expression with quosures and pronoun support"), #> "\n", list("\n", "eval_tidy(expr, data = NULL, env = caller_env())\n"), #> "\n", list("\n", list(list("expr"), list("An expression or quosure to evaluate.")), #> "\n", "\n", list(list("data"), list("A data frame, or named list or vector. Alternatively, a\n", #> "data mask created with ", list(list("as_data_mask()")), #> " or\n", list(list("new_data_mask()")), ". Objects in ", #> list("data"), " have priority over those in\n", #> list("env"), ". See the section about data masking.")), #> "\n", "\n", list(list("env"), list("The environment in which to evaluate ", #> list("expr"), ". This\n", "environment is not applicable for quosures because they have\n", #> "their own environments.")), "\n"), "\n", list( #> "\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", list("eval_tidy()"), " is a variant of ", #> list(list("base::eval()")), " that powers the tidy\n", #> "evaluation framework. Like ", list("eval()"), #> " it accepts user data as\n", "argument. Whereas ", #> list("eval()"), " simply transforms the data to an\n", #> "environment, ", list("eval_tidy()"), " transforms it to a ", #> list("data mask"), " with\n", list(list("as_data_mask()")), #> ". Evaluating in a data mask enables the following\n", #> "features:\n", list("\n", list(), " ", list("Quosures"), #> ". Quosures are expressions bundled with an\n", #> "environment. If ", list("data"), " is supplied, objects in the data mask\n", #> "always have precedence over the quosure environment, i.e. the\n", #> "data masks the environment.\n", list(), " ", #> list("Pronouns"), ". If ", list("data"), " is supplied, the ", #> list(".env"), " and ", list(".data"), "\n", #> "pronouns are installed in the data mask. ", #> list(".env"), " is a reference to\n", "the calling environment and ", #> list(".data"), " refers to the ", list("data"), #> " argument.\n", "These pronouns lets you be explicit about where to find\n", #> "values and throw errors if you try to access non-existent values.\n"), #> "\n"), "\n", list(list("Data masking"), list( #> "\n", "\n", "\n", "Data masking refers to how columns or objects inside ", #> list("data"), " have\n", "priority over objects defined in ", #> list("env"), " (or in the quosure\n", "environment, if applicable). If there is a column ", #> list("var"), " in ", list("data"), "\n", "and an object ", #> list("var"), " in ", list("env"), ", and ", list( #> "expr"), " refers to ", list("var"), ", the\n", #> "column has priority:", list("var <- \"this one?\"\n", #> "data <- data.frame(var = rep(\"Or that one?\", 3))\n", #> "\n", "within <- function(data, expr) {\n", #> " eval_tidy(enquo(expr), data)\n", "}\n", #> "\n", "within(data, toupper(var))\n", "#> [1] \"OR THAT ONE?\" \"OR THAT ONE?\" \"OR THAT ONE?\"\n"), #> "\n", "\n", "Because the columns or objects in ", #> list("data"), " are always found first,\n", "before objects from ", #> list("env"), ", we say that the data \"masks\" the\n", #> "environment.\n")), "\n", "\n", list(list("When should eval_tidy() be used instead of eval()?"), #> list("\n", "\n", "\n", list("base::eval()"), #> " is sufficient for simple evaluation. Use\n", #> list("eval_tidy()"), " when you'd like to support expressions referring to\n", #> "the ", list(".data"), " pronoun, or when you need to support quosures.\n", #> "\n", "If you're evaluating an expression captured with quasiquotation\n", #> "support, it is recommended to use ", list( #> "eval_tidy()"), " because users will\n", #> "likely unquote quosures.\n", "\n", "Note that unwrapping a quosure with ", #> list(list("quo_get_expr()")), " does not\n", #> "guarantee that there is no quosures inside the expression. Quosures\n", #> "might be unquoted anywhere. For instance, the following does not\n", #> "work reliably in the presence of nested quosures:", #> list("my_quoting_fn <- function(x) {\n", " x <- enquo(x)\n", #> " expr <- quo_get_expr(x)\n", " env <- quo_get_env(x)\n", #> " eval(expr, env)\n", "}\n", "\n", "# Works:\n", #> "my_quoting_fn(toupper(letters))\n", "\n", #> "# Fails because of a nested quosure:\n", #> "my_quoting_fn(toupper(!!quo(letters)))\n"), #> "\n")), "\n", "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", list("rlang 0.3.0"), "\n", #> "\n", "Passing an environment to ", list("data"), #> " is deprecated. Please construct an\n", "rlang data mask with ", #> list(list("new_data_mask()")), ".\n")), "\n", #> "\n", list("\n", "\n", "# With simple quoted expressions eval_tidy() works the same way as\n", #> "# eval():\n", "apple <- \"apple\"\n", "kiwi <- \"kiwi\"\n", #> "expr <- quote(paste(apple, kiwi))\n", "expr\n", #> "\n", "eval(expr)\n", "eval_tidy(expr)\n", "\n", #> "# Both accept a data mask as argument:\n", "data <- list(apple = \"CARROT\", kiwi = \"TOMATO\")\n", #> "eval(expr, data)\n", "eval_tidy(expr, data)\n", #> "\n", "\n", "# In addition eval_tidy() has support for quosures:\n", #> "with_data <- function(data, expr) {\n", " quo <- enquo(expr)\n", #> " eval_tidy(quo, data)\n", "}\n", "with_data(NULL, apple)\n", #> "with_data(data, apple)\n", "with_data(data, list(apple, kiwi))\n", #> "\n", "# Secondly eval_tidy() installs handy pronouns that allow users to\n", #> "# be explicit about where to find symbols:\n", #> "with_data(data, .data$apple)\n", "with_data(data, .env$apple)\n", #> "\n", "\n", "# Note that instead of using `.env` it is often equivalent and may\n", #> "# be preferred to unquote a value. There are two differences. First\n", #> "# unquoting happens earlier, when the quosure is created. Secondly,\n", #> "# subsetting `.env` with the `$` operator may be brittle because\n", #> "# `$` does not look through the parents of the environment.\n", #> "#\n", "# For instance using `.env$name` in a magrittr pipeline is an\n", #> "# instance where this poses problem, because the magrittr pipe\n", #> "# currently (as of v1.5.0) evaluates its operands in a *child* of\n", #> "# the current environment (this child environment is where it\n", #> "# defines the pronoun `.`).\n", list("\n", " data %>% with_data(!!kiwi) # \"kiwi\"\n", #> " data %>% with_data(.env$kiwi) # NULL\n"), #> "\n"), "\n", list("\n", list("quasiquotation"), #> " for the second leg of the tidy evaluation\n", #> "framework.\n"), "\n"), exec.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval.R", #> "\n", list("exec"), "\n", list("exec"), "\n", list( #> "Execute a function"), "\n", list("\n", "exec(.fn, ..., .env = caller_env())\n"), #> "\n", list("\n", list(list(".fn"), list("A function, or function name as a string.")), #> "\n", "\n", list(list("..."), list("Arguments to function.\n", #> "\n", "These dots support ", list("tidy-dots"), #> " features.")), "\n", "\n", list(list(".env"), #> list("Environment in which to evaluate the call. This will be\n", #> "most useful if ", list("f"), " is a string, or the function has side-effects.")), #> "\n"), "\n", list("\n", "This function constructs and evaluates a call to ", #> list(".fn"), ".\n", "It has two primary uses:\n", #> list("\n", list(), " To call a function with arguments stored in a list (if the function\n", #> "doesn't support ", list("tidy-dots"), ")\n", #> list(), " To call every function stored in a list (in conjunction with ", #> list("map()"), "/\n", list(list("lapply()")), #> ")\n"), "\n"), "\n", list("\n", "args <- list(x = c(1:10, 100, NA), na.rm = TRUE)\n", #> "exec(\"mean\", !!!args)\n", "exec(\"mean\", !!!args, trim = 0.2)\n", #> "\n", "fs <- list(a = function() \"a\", b = function() \"b\")\n", #> "lapply(fs, exec)\n", "\n", "# Compare to do.call it will not automatically inline expressions\n", #> "# into the evaluated call.\n", "x <- 10\n", #> "args <- exprs(x1 = x + 1, x2 = x * 2)\n", "exec(list, !!!args)\n", #> "do.call(list, args)\n", "\n", "# exec() is not designed to generate pretty function calls. This is\n", #> "# most easily seen if you call a function that captures the call:\n", #> "f <- disp ~ cyl\n", "exec(\"lm\", f, data = mtcars)\n", #> "\n", "# If you need finer control over the generated call, you'll need to\n", #> "# construct it yourself. This may require creating a new environment\n", #> "# with carefully constructed bindings\n", "data_env <- env(data = mtcars)\n", #> "eval(expr(lm(!!f, data)), data_env)\n"), "\n"), #> exiting.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("exiting"), "\n", list("exiting"), "\n", #> list("Exiting handler"), "\n", list("\n", "exiting(handler)\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", "\n", list("exiting()"), " is no longer necessary as handlers are exiting by default.\n"), #> "\n", list("internal"), "\n"), expr_interp.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quasiquotation.R", #> "\n", list("expr_interp"), "\n", list("expr_interp"), #> "\n", list("Process unquote operators in a captured expression"), #> "\n", list("\n", "expr_interp(x, env = NULL)\n"), #> "\n", list("\n", list(list("x"), list("A function, raw expression, or formula to interpolate.")), #> "\n", "\n", list(list("env"), list("The environment in which unquoted expressions should be\n", #> "evaluated. By default, the formula or closure environment if a\n", #> "formula or a function, or the current environment otherwise.")), #> "\n"), "\n", list("\n", "While all capturing functions in the tidy evaluation framework\n", #> "perform unquote on capture (most notably ", #> list(list("quo()")), "),\n", list("expr_interp()"), #> " manually processes unquoting operators in\n", #> "expressions that are already captured. ", list( #> "expr_interp()"), " should be\n", "called in all user-facing functions expecting a formula as argument\n", #> "to provide the same quasiquotation functionality as NSE functions.\n"), #> "\n", list("\n", "# All tidy NSE functions like quo() unquote on capture:\n", #> "quo(list(!!(1 + 2)))\n", "\n", "# expr_interp() is meant to provide the same functionality when you\n", #> "# have a formula or expression that might contain unquoting\n", #> "# operators:\n", "f <- ~list(!!(1 + 2))\n", #> "expr_interp(f)\n", "\n", "# Note that only the outer formula is unquoted (which is a reason\n", #> "# to use expr_interp() as early as possible in all user-facing\n", #> "# functions):\n", "f <- ~list(~!!(1 + 2), !!(1 + 2))\n", #> "expr_interp(f)\n", "\n", "\n", "# Another purpose for expr_interp() is to interpolate a closure's\n", #> "# body. This is useful to inline a function within another. The\n", #> "# important limitation is that all formal arguments of the inlined\n", #> "# function should be defined in the receiving function:\n", #> "other_fn <- function(x) toupper(x)\n", "\n", #> "fn <- expr_interp(function(x) {\n", " x <- paste0(x, \"_suffix\")\n", #> " !!! body(other_fn)\n", "})\n", "fn\n", "fn(\"foo\")\n"), #> "\n"), expr_label.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/expr.R", #> "\n", list("expr_label"), "\n", list("expr_label"), #> "\n", list("expr_name"), "\n", list("expr_text"), #> "\n", list("Turn an expression to a label"), "\n", #> list("\n", "expr_label(expr)\n", "\n", "expr_name(expr)\n", #> "\n", "expr_text(expr, width = 60L, nlines = Inf)\n"), #> "\n", list("\n", list(list("expr"), list("An expression to labellise.")), #> "\n", "\n", list(list("width"), list("Width of each line.")), #> "\n", "\n", list(list("nlines"), list("Maximum number of lines to extract.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("expr_text()"), " turns the expression into a single string, which\n", #> "might be multi-line. ", list("expr_name()"), #> " is suitable for formatting\n", "names. It works best with symbols and scalar types, but also\n", #> "accepts calls. ", list("expr_label()"), " formats the expression nicely for use\n", #> "in messages.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "These functions are in the questioning stage because they are\n", #> "redundant with the ", list("quo_"), " variants and do not handle quosures.\n")), #> "\n", "\n", list("\n", "# To labellise a function argument, first capture it with\n", #> "# substitute():\n", "fn <- function(x) expr_label(substitute(x))\n", #> "fn(x:y)\n", "\n", "# Strings are encoded\n", #> "expr_label(\"a\\nb\")\n", "\n", "# Names and expressions are quoted with ``\n", #> "expr_label(quote(x))\n", "expr_label(quote(a + b + c))\n", #> "\n", "# Long expressions are collapsed\n", "expr_label(quote(foo({\n", #> " 1 + 2\n", " print(x)\n", "})))\n"), "\n"), #> expr_print.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/expr.R", #> "\n", list("expr_print"), "\n", list("expr_print"), #> "\n", list("expr_deparse"), "\n", list("Print an expression"), #> "\n", list("\n", "expr_print(x, width = peek_option(\"width\"))\n", #> "\n", "expr_deparse(x, width = peek_option(\"width\"))\n"), #> "\n", list("\n", list(list("x"), list("An object or expression to print.")), #> "\n", "\n", list(list("width"), list("The width of the deparsed or printed expression.\n", #> "Defaults to the global option ", list("width"), #> ".")), "\n"), "\n", list("\n", list("expr_print()"), #> ", powered by ", list("expr_deparse()"), ", is an alternative\n", #> "printer for R expressions with a few improvements over the base R\n", #> "printer.\n", list("\n", list(), " It colourises ", #> list("quosures"), " according to their environment.\n", #> "Quosures from the global environment are printed normally while\n", #> "quosures from local environments are printed in unique colour (or\n", #> "in italic when all colours are taken).\n", #> list(), " It wraps inlined objects in angular brackets. For instance, an\n", #> "integer vector unquoted in a function call (e.g.\n", #> list("expr(foo(!!(1:3)))"), ") is printed like this: ", #> list("foo(<int: 1L, 2L, 3L>)"), " while by default R prints the code to create that vector:\n", #> list("foo(1:3)"), " which is ambiguous.\n", #> list(), " It respects the width boundary (from the global option ", #> list("width"), ")\n", "in more cases.\n"), #> "\n"), "\n", list("\n", "# It supports any object. Non-symbolic objects are always printed\n", #> "# within angular brackets:\n", "expr_print(1:3)\n", #> "expr_print(function() NULL)\n", "\n", "# Contrast this to how the code to create these objects is printed:\n", #> "expr_print(quote(1:3))\n", "expr_print(quote(function() NULL))\n", #> "\n", "# The main cause of non-symbolic objects in expressions is\n", #> "# quasiquotation:\n", "expr_print(expr(foo(!!(1:3))))\n", #> "\n", "\n", "# Quosures from the global environment are printed normally:\n", #> "expr_print(quo(foo))\n", "expr_print(quo(foo(!!quo(bar))))\n", #> "\n", "# Quosures from local environments are colourised according to\n", #> "# their environments (if you have crayon installed):\n", #> "local_quo <- local(quo(foo))\n", "expr_print(local_quo)\n", #> "\n", "wrapper_quo <- local(quo(bar(!!local_quo, baz)))\n", #> "expr_print(wrapper_quo)\n"), "\n"), exprs_auto_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quotation.R", "\n", #> list("exprs_auto_name"), "\n", list("exprs_auto_name"), #> "\n", list("quos_auto_name"), "\n", list("Ensure that all elements of a list of expressions are named"), #> "\n", list("\n", "exprs_auto_name(exprs, width = NULL, printer = NULL)\n", #> "\n", "quos_auto_name(quos, width = NULL)\n"), #> "\n", list("\n", list(list("exprs"), list("A list of expressions.")), #> "\n", "\n", list(list("width"), list("Deprecated. Maximum width of names.")), #> "\n", "\n", list(list("printer"), list("Deprecated. A function that takes an expression\n", #> "and converts it to a string. This function must take an\n", #> "expression as the first argument and ", list( #> "width"), " as the second\n", "argument.")), #> "\n", "\n", list(list("quos"), list("A list of quosures.")), #> "\n"), "\n", list("\n", "This gives default names to unnamed elements of a list of\n", #> "expressions (or expression wrappers such as formulas or\n", #> "quosures). ", list("exprs_auto_name()"), " deparses the expressions with\n", #> list(list("expr_name()")), " by default. ", list( #> "quos_auto_name()"), " deparses with\n", list( #> list("quo_name()")), ".\n"), "\n"), f_rhs.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/formula.R", "\n", #> list("f_rhs"), "\n", list("f_rhs"), "\n", list("f_rhs<-"), #> "\n", list("f_lhs"), "\n", list("f_lhs<-"), "\n", #> list("f_env"), "\n", list("f_env<-"), "\n", list( #> "Get or set formula components"), "\n", list( #> "\n", "f_rhs(f)\n", "\n", "f_rhs(x) <- value\n", #> "\n", "f_lhs(f)\n", "\n", "f_lhs(x) <- value\n", #> "\n", "f_env(f)\n", "\n", "f_env(x) <- value\n"), #> "\n", list("\n", list(list("f, x"), list("A formula")), #> "\n", "\n", list(list("value"), list("The value to replace with.")), #> "\n"), "\n", list("\n", list("f_rhs"), " and ", #> list("f_lhs"), " return language objects (i.e. atomic\n", #> "vectors of length 1, a name, or a call). ", #> list("f_env"), " returns an\n", "environment.\n"), #> "\n", list("\n", list("f_rhs"), " extracts the righthand side, ", #> list("f_lhs"), " extracts the lefthand\n", "side, and ", #> list("f_env"), " extracts the environment. All functions throw an\n", #> "error if ", list("f"), " is not a formula.\n"), #> "\n", list("\n", "f_rhs(~ 1 + 2 + 3)\n", "f_rhs(~ x)\n", #> "f_rhs(~ \"A\")\n", "f_rhs(1 ~ 2)\n", "\n", "f_lhs(~ y)\n", #> "f_lhs(x ~ y)\n", "\n", "f_env(~ x)\n"), "\n"), #> f_text.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/formula.R", #> "\n", list("f_text"), "\n", list("f_text"), "\n", #> list("f_name"), "\n", list("f_label"), "\n", list( #> "Turn RHS of formula into a string or label"), #> "\n", list("\n", "f_text(x, width = 60L, nlines = Inf)\n", #> "\n", "f_name(x)\n", "\n", "f_label(x)\n"), "\n", #> list("\n", list(list("x"), list("A formula.")), "\n", #> "\n", list(list("width"), list("Width of each line.")), #> "\n", "\n", list(list("nlines"), list("Maximum number of lines to extract.")), #> "\n"), "\n", list("\n", "Equivalent of ", list( #> list("expr_text()")), " and ", list(list("expr_label()")), #> " for formulas.\n"), "\n", list("\n", "f <- ~ a + b + bc\n", #> "f_text(f)\n", "f_label(f)\n", "\n", "# Names a quoted with ``\n", #> "f_label(~ x)\n", "# Strings are encoded\n", #> "f_label(~ \"a\\nb\")\n", "# Long expressions are collapsed\n", #> "f_label(~ foo({\n", " 1 + 2\n", " print(x)\n", #> "}))\n"), "\n"), flatten.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-squash.R", #> "\n", list("flatten"), "\n", list("flatten"), "\n", #> list("flatten_lgl"), "\n", list("flatten_int"), "\n", #> list("flatten_dbl"), "\n", list("flatten_cpl"), "\n", #> list("flatten_chr"), "\n", list("flatten_raw"), "\n", #> list("squash"), "\n", list("squash_lgl"), "\n", list( #> "squash_int"), "\n", list("squash_dbl"), "\n", #> list("squash_cpl"), "\n", list("squash_chr"), "\n", #> list("squash_raw"), "\n", list("flatten_if"), "\n", #> list("squash_if"), "\n", list("Flatten or squash a list of lists into a simpler vector"), #> "\n", list("\n", "flatten(x)\n", "\n", "flatten_lgl(x)\n", #> "\n", "flatten_int(x)\n", "\n", "flatten_dbl(x)\n", #> "\n", "flatten_cpl(x)\n", "\n", "flatten_chr(x)\n", #> "\n", "flatten_raw(x)\n", "\n", "squash(x)\n", #> "\n", "squash_lgl(x)\n", "\n", "squash_int(x)\n", #> "\n", "squash_dbl(x)\n", "\n", "squash_cpl(x)\n", #> "\n", "squash_chr(x)\n", "\n", "squash_raw(x)\n", #> "\n", "flatten_if(x, predicate = is_spliced)\n", #> "\n", "squash_if(x, predicate = is_spliced)\n"), #> "\n", list("\n", list(list("x"), list("A list to flatten or squash. The contents of the list can\n", #> "be anything for unsuffixed functions ", list( #> "flatten()"), " and ", list("squash()"), "\n", #> "(as a list is returned), but the contents must match the type for\n", #> "the other functions.")), "\n", "\n", list(list( #> "predicate"), list("A function of one argument returning whether it\n", #> "should be spliced.")), "\n"), "\n", list("\n", #> list("flatten()"), " returns a list, ", list( #> "flatten_lgl()"), " a logical\n", "vector, ", #> list("flatten_int()"), " an integer vector, ", #> list("flatten_dbl()"), " a\n", "double vector, and ", #> list("flatten_chr()"), " a character vector. Similarly\n", #> "for ", list("squash()"), " and the typed variants (", #> list("squash_lgl()"), " etc).\n"), "\n", list( #> "\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("flatten()"), " removes one level hierarchy from a list, while\n", #> list("squash()"), " removes all levels. These functions are similar to\n", #> list(list("unlist()")), " but they are type-stable so you always know what the\n", #> "type of the output is.\n"), "\n", list(list( #> "Life cycle"), list("\n", "\n", "\n", "These functions are in the questioning stage. They have slightly\n", #> "different semantics than the flattening functions in purrr and we\n", #> "are currently rethinking our approach to flattening with the new\n", #> "typing facilities of the vctrs package.\n")), #> "\n", "\n", list("\n", "x <- replicate(2, sample(4), simplify = FALSE)\n", #> "x\n", "\n", "flatten(x)\n", "flatten_int(x)\n", #> "\n", "# With flatten(), only one level gets removed at a time:\n", #> "deep <- list(1, list(2, list(3)))\n", "flatten(deep)\n", #> "flatten(flatten(deep))\n", "\n", "# But squash() removes all levels:\n", #> "squash(deep)\n", "squash_dbl(deep)\n", "\n", #> "# The typed flatten functions remove one level and coerce to an atomic\n", #> "# vector at the same time:\n", "flatten_dbl(list(1, list(2)))\n", #> "\n", "# Only bare lists are flattened, but you can splice S3 lists\n", #> "# explicitly:\n", "foo <- set_attrs(list(\"bar\"), class = \"foo\")\n", #> "str(flatten(list(1, foo, list(100))))\n", "str(flatten(list(1, splice(foo), list(100))))\n", #> "\n", "# Instead of splicing manually, flatten_if() and squash_if() let\n", #> "# you specify a predicate function:\n", "is_foo <- function(x) inherits(x, \"foo\") || is_bare_list(x)\n", #> "str(flatten_if(list(1, foo, list(100)), is_foo))\n", #> "\n", "# squash_if() does the same with deep lists:\n", #> "deep_foo <- list(1, list(foo, list(foo, 100)))\n", #> "str(deep_foo)\n", "\n", "str(squash(deep_foo))\n", #> "str(squash_if(deep_foo, is_foo))\n"), "\n", #> list("internal"), "\n"), fn_body.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/fn.R", "\n", #> list("fn_body"), "\n", list("fn_body"), "\n", list( #> "fn_body<-"), "\n", list("Get or set function body"), #> "\n", list("\n", "fn_body(fn = caller_fn())\n", "\n", #> "fn_body(fn) <- value\n"), "\n", list("\n", list( #> list("fn"), list("A function. It is lookep up in the calling frame if not\n", #> "supplied.")), "\n", "\n", list(list("value"), #> list("New formals or formals names for ", list( #> "fn"), ".")), "\n"), "\n", list("\n", list( #> "fn_body()"), " is a simple wrapper around ", #> list(list("base::body()")), ". It always\n", #> "returns a ", list("{"), " expression and throws an error when the input is a\n", #> "primitive function (whereas ", list("body()"), #> " returns ", list("NULL"), "). The setter\n", #> "version preserves attributes, unlike ", list( #> "body<-"), ".\n"), "\n", list("\n", "# fn_body() is like body() but always returns a block:\n", #> "fn <- function() do()\n", "body(fn)\n", "fn_body(fn)\n", #> "\n", "# It also throws an error when used on a primitive function:\n", #> "try(fn_body(base::list))\n"), "\n"), fn_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list( #> "fn_env"), "\n", list("fn_env"), "\n", list("fn_env<-"), #> "\n", list("Return the closure environment of a function"), #> "\n", list("\n", "fn_env(fn)\n", "\n", "fn_env(x) <- value\n"), #> "\n", list("\n", list(list("fn, x"), list("A function.")), #> "\n", "\n", list(list("value"), list("A new closure environment for the function.")), #> "\n"), "\n", list("\n", "Closure environments define the scope of functions (see ", #> list(list("env()")), ").\n", "When a function call is evaluated, R creates an evaluation frame\n", #> "(see ", list(list("ctxt_stack()")), ") that inherits from the closure environment.\n", #> "This makes all objects defined in the closure environment and all\n", #> "its parents available to code executed within the function.\n"), #> "\n", list("\n", list("fn_env()"), " returns the closure environment of ", #> list("fn"), ". There is also\n", "an assignment method to set a new closure environment.\n"), #> "\n", list("\n", "env <- child_env(\"base\")\n", #> "fn <- with_env(env, function() NULL)\n", "identical(fn_env(fn), env)\n", #> "\n", "other_env <- child_env(\"base\")\n", "fn_env(fn) <- other_env\n", #> "identical(fn_env(fn), other_env)\n"), "\n"), #> fn_fmls.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/fn.R", "\n", #> list("fn_fmls"), "\n", list("fn_fmls"), "\n", list( #> "fn_fmls_names"), "\n", list("fn_fmls_syms"), #> "\n", list("fn_fmls<-"), "\n", list("fn_fmls_names<-"), #> "\n", list("Extract arguments from a function"), #> "\n", list("\n", "fn_fmls(fn = caller_fn())\n", "\n", #> "fn_fmls_names(fn = caller_fn())\n", "\n", "fn_fmls_syms(fn = caller_fn())\n", #> "\n", "fn_fmls(fn) <- value\n", "\n", "fn_fmls_names(fn) <- value\n"), #> "\n", list("\n", list(list("fn"), list("A function. It is lookep up in the calling frame if not\n", #> "supplied.")), "\n", "\n", list(list("value"), #> list("New formals or formals names for ", list( #> "fn"), ".")), "\n"), "\n", list("\n", list( #> "fn_fmls()"), " returns a named list of formal arguments.\n", #> list("fn_fmls_names()"), " returns the names of the arguments.\n", #> list("fn_fmls_syms()"), " returns formals as a named list of symbols. This\n", #> "is especially useful for forwarding arguments in ", #> list("constructed calls"), ".\n"), "\n", list( #> "\n", "Unlike ", list("formals()"), ", these helpers throw an error with primitive\n", #> "functions instead of returning ", list("NULL"), #> ".\n"), "\n", list("\n", "# Extract from current call:\n", #> "fn <- function(a = 1, b = 2) fn_fmls()\n", "fn()\n", #> "\n", "# fn_fmls_syms() makes it easy to forward arguments:\n", #> "call2(\"apply\", !!! fn_fmls_syms(lapply))\n", #> "\n", "# You can also change the formals:\n", #> "fn_fmls(fn) <- list(A = 10, B = 20)\n", "fn()\n", #> "\n", "fn_fmls_names(fn) <- c(\"foo\", \"bar\")\n", #> "fn()\n"), "\n", list("\n", list(list("call_args()")), #> " and ", list(list("call_args_names()")), "\n"), #> "\n"), frame_position.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("frame_position"), "\n", list("frame_position"), #> "\n", list("Find the position or distance of a frame on the evaluation stack"), #> "\n", list("\n", "frame_position(frame, from = c(\"global\", \"current\"))\n"), #> "\n", list("\n", list(list("frame"), list("The environment of a frame. Can be any object with a\n", #> list(list("get_env()")), " method. Note that for frame objects, the position from\n", #> "the global frame is simply ", list("frame$pos"), #> ". Alternatively, ", list("frame"), "\n", "can be an integer that represents the position on the stack (and\n", #> "is thus returned as is if ", list("from"), " is \"global\".")), #> "\n", "\n", list(list("from"), list("Whether to compute distance from the global frame (the\n", #> "bottom of the evaluation stack), or from the current frame (the\n", #> "top of the evaluation stack).")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "The frame position on the stack can be computed by counting frames\n", #> "from the global frame (the bottom of the stack, the default) or\n", #> "from the current frame (the top of the stack).\n"), #> "\n", list("\n", "While this function returns the position of the frame on the\n", #> "evaluation stack, it can safely be called with intervening frames\n", #> "as those will be discarded.\n"), "\n", list( #> list("Life cycle"), list("\n", "\n", "\n", "These functions are deprecated and replaced by ", #> list(list("trace_back()")), ".\n")), "\n", #> "\n", list("\n", "fn <- function() g(environment())\n", #> "g <- function(env) frame_position(env)\n", "\n", #> "# frame_position() returns the position of the frame on the evaluation stack:\n", #> "fn()\n", "identity(identity(fn()))\n", "\n", #> "# Note that it trims off intervening calls before counting so you\n", #> "# can safely nest it within other calls:\n", #> "g <- function(env) identity(identity(frame_position(env)))\n", #> "fn()\n", "\n", "# You can also ask for the position from the current frame rather\n", #> "# than the global frame:\n", "fn <- function() g(environment())\n", #> "g <- function(env) h(env)\n", "h <- function(env) frame_position(env, from = \"current\")\n", #> "fn()\n"), "\n", list("internal"), "\n"), friendly_type.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("friendly_type"), "\n", list("friendly_type"), #> "\n", list("Format a type for error messages"), "\n", #> list("\n", "friendly_type(type)\n"), "\n", list("\n", #> list(list("type"), list("A type as returned by ", #> list(list("typeof()")), ".")), "\n"), "\n", #> list("\n", "A string of the prettified type, qualified with an\n", #> "indefinite article.\n"), "\n", list("\n", "Format a type for error messages\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", list( #> "\n", list(), " ", list("friendly_type()"), " is experimental.\n"), #> "\n")), "\n", "\n", list("\n", "friendly_type(\"logical\")\n", #> "friendly_type(\"integer\")\n", "friendly_type(\"string\")\n"), #> "\n", list("internal"), "\n"), get_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env.R", "\n", list( #> "get_env"), "\n", list("get_env"), "\n", list( #> "set_env"), "\n", list("env_poke_parent"), "\n", #> list("Get or set the environment of an object"), #> "\n", list("\n", "get_env(env, default = NULL)\n", #> "\n", "set_env(env, new_env = caller_env())\n", #> "\n", "env_poke_parent(env, new_env)\n"), "\n", #> list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("default"), list("The default environment in case ", #> list("env"), " does not wrap\n", "an environment. If ", #> list("NULL"), " and no environment could be extracted,\n", #> "an error is issued.")), "\n", "\n", list(list( #> "new_env"), list("An environment to replace ", #> list("env"), " with.")), "\n"), "\n", list( #> "\n", "These functions dispatch internally with methods for functions,\n", #> "formulas and frames. If called with a missing argument, the\n", #> "environment of the current evaluation frame (see ", #> list(list("ctxt_stack()")), ") is\n", "returned. If you call ", #> list("get_env()"), " with an environment, it acts as\n", #> "the identity function and the environment is simply returned (this\n", #> "helps simplifying code when writing generic functions for\n", #> "environments).\n"), "\n", list("\n", "While ", #> list("set_env()"), " returns a modified copy and does not have side\n", #> "effects, ", list("env_poke_parent()"), " operates changes the environment by\n", #> "side effect. This is because environments are\n", #> list("uncopyable"), ". Be careful not to change environments\n", #> "that you don't own, e.g. a parent environment of a function from a\n", #> "package.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", list("\n", list(), " Using ", #> list("get_env()"), " without supplying ", list( #> "env"), " is deprecated as\n", "of rlang 0.3.0. Please use ", #> list(list("current_env()")), " to retrieve the\n", #> "current environment.\n", list(), " Passing environment wrappers like formulas or functions instead\n", #> "of bare environments is deprecated as of rlang 0.3.0. This\n", #> "internal genericity was causing confusion (see issue #427). You\n", #> "should now extract the environment separately before calling\n", #> "these functions.\n"), "\n")), "\n", "\n", #> list("\n", "# Environment of closure functions:\n", #> "fn <- function() \"foo\"\n", "get_env(fn)\n", #> "\n", "# Or of quosures or formulas:\n", "get_env(~foo)\n", #> "get_env(quo(foo))\n", "\n", "\n", "# Provide a default in case the object doesn't bundle an environment.\n", #> "# Let's create an unevaluated formula:\n", "f <- quote(~foo)\n", #> "\n", "# The following line would fail if run because unevaluated formulas\n", #> "# don't bundle an environment (they didn't have the chance to\n", #> "# record one yet):\n", "# get_env(f)\n", "\n", #> "# It is often useful to provide a default when you're writing\n", #> "# functions accepting formulas as input:\n", #> "default <- env()\n", "identical(get_env(f, default), default)\n", #> "\n", "# set_env() can be used to set the enclosure of functions and\n", #> "# formulas. Let's create a function with a particular environment:\n", #> "env <- child_env(\"base\")\n", "fn <- set_env(function() NULL, env)\n", #> "\n", "# That function now has `env` as enclosure:\n", #> "identical(get_env(fn), env)\n", "identical(get_env(fn), current_env())\n", #> "\n", "# set_env() does not work by side effect. Setting a new environment\n", #> "# for fn has no effect on the original function:\n", #> "other_env <- child_env(NULL)\n", "set_env(fn, other_env)\n", #> "identical(get_env(fn), other_env)\n", "\n", #> "# Since set_env() returns a new function with a different\n", #> "# environment, you'll need to reassign the result:\n", #> "fn <- set_env(fn, other_env)\n", "identical(get_env(fn), other_env)\n"), #> "\n", list("\n", list(list("quo_get_env()")), " and ", #> list(list("quo_set_env()")), " for versions of\n", #> list(list("get_env()")), " and ", list(list("set_env()")), #> " that only work on quosures.\n"), "\n"), has_length.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/attr.R", "\n", #> list("has_length"), "\n", list("has_length"), "\n", #> list("How long is an object?"), "\n", list("\n", #> "has_length(x, n = NULL)\n"), "\n", list("\n", #> list(list("x"), list("A R object.")), "\n", "\n", #> list(list("n"), list("A specific length to test ", #> list("x"), " with. If ", list("NULL"), ",\n", #> list("has_length()"), " returns ", list("TRUE"), #> " if ", list("x"), " has length greater than\n", #> "zero, and ", list("FALSE"), " otherwise.")), #> "\n"), "\n", list("\n", "This is a function for the common task of testing the length of an\n", #> "object. It checks the length of an object in a non-generic way:\n", #> list(list("base::length()")), " methods are ignored.\n"), #> "\n", list("\n", "has_length(list())\n", "has_length(list(), 0)\n", #> "\n", "has_length(letters)\n", "has_length(letters, 20)\n", #> "has_length(letters, 26)\n"), "\n"), has_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/attr.R", "\n", #> list("has_name"), "\n", list("has_name"), "\n", list( #> "Does an object have an element with this name?"), #> "\n", list("\n", "has_name(x, name)\n"), "\n", list( #> "\n", list(list("x"), list("A data frame or another named object")), #> "\n", "\n", list(list("name"), list("Element name(s) to check")), #> "\n"), "\n", list("\n", "A logical vector of the same length as ", #> list("name"), "\n"), "\n", list("\n", "This function returns a logical value that indicates if a data\n", #> "frame or another named object contains an element with a specific\n", #> "name. Note that ", list("has_name()"), " only works with vectors. For instance,\n", #> "environments need the specialised function ", #> list(list("env_has()")), ".\n"), "\n", list("\n", #> "Unnamed objects are treated as if all names are empty strings. ", #> list("NA"), "\n", "input gives ", list("FALSE"), #> " as output.\n"), "\n", list("\n", "has_name(iris, \"Species\")\n", #> "has_name(mtcars, \"gears\")\n"), "\n"), inherits_any.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/s3.R", "\n", list( #> "inherits_any"), "\n", list("inherits_any"), #> "\n", list("inherits_all"), "\n", list("inherits_only"), #> "\n", list("Does an object inherit from a set of classes?"), #> "\n", list("\n", "inherits_any(x, class)\n", "\n", #> "inherits_all(x, class)\n", "\n", "inherits_only(x, class)\n"), #> "\n", list("\n", list(list("x"), list("An object to test for inheritance.")), #> "\n", "\n", list(list("class"), list("A character vector of classes.")), #> "\n"), "\n", list("\n", list("\n", list(), " ", #> list("inherits_any()"), " is like ", list(list( #> "base::inherits()")), " but is more explicit\n", #> "about its behaviour with multiple classes. If ", #> list("classes"), " contains\n", "several elements and the object inherits from at least one of\n", #> "them, ", list("inherits_any()"), " returns ", #> list("TRUE"), ".\n", list(), " ", list("inherits_all()"), #> " tests that an object inherits from all of the\n", #> "classes in the supplied order. This is usually the best way to\n", #> "test for inheritance of multiple classes.\n", #> list(), " ", list("inherits_only()"), " tests that the class vectors are identical. It\n", #> "is a shortcut for ", list("identical(class(x), class)"), #> ".\n"), "\n"), "\n", list("\n", "obj <- structure(list(), class = c(\"foo\", \"bar\", \"baz\"))\n", #> "\n", "# With the _any variant only one class must match:\n", #> "inherits_any(obj, c(\"foobar\", \"bazbaz\"))\n", #> "inherits_any(obj, c(\"foo\", \"bazbaz\"))\n", #> "\n", "# With the _all variant all classes must match:\n", #> "inherits_all(obj, c(\"foo\", \"bazbaz\"))\n", #> "inherits_all(obj, c(\"foo\", \"baz\"))\n", "\n", #> "# The order of classes must match as well:\n", #> "inherits_all(obj, c(\"baz\", \"foo\"))\n", "\n", #> "# inherits_only() checks that the class vectors are identical:\n", #> "inherits_only(obj, c(\"foo\", \"baz\"))\n", #> "inherits_only(obj, c(\"foo\", \"bar\", \"baz\"))\n"), #> "\n"), invoke.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval.R", #> "\n", list("invoke"), "\n", list("invoke"), "\n", #> list("Invoke a function with a list of arguments"), #> "\n", list("\n", "invoke(.fn, .args = list(), ..., .env = caller_env(),\n", #> " .bury = c(\".fn\", \"\"))\n"), "\n", list( #> "\n", list(list(".fn"), list("A function to invoke. Can be a function object or the\n", #> "name of a function in scope of ", list(".env"), #> ".")), "\n", "\n", list(list(".args, ..."), #> list("List of arguments (possibly named) to be passed to\n", #> list(".fn"), ".")), "\n", "\n", list(list( #> ".env"), list("The environment in which to call ", #> list(".fn"), ".")), "\n", "\n", list(list(".bury"), #> list("A character vector of length 2. The first string\n", #> "specifies which name should the function have in the call\n", #> "recorded in the evaluation stack. The second string specifies a\n", #> "prefix for the argument names. Set ", list( #> ".bury"), " to ", list("NULL"), " if you\n", #> "prefer to inline the function and its arguments in the call.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", "\n", "Normally, you invoke a R function by typing arguments manually. A\n", #> "powerful alternative is to call a function with a list of arguments\n", #> "assembled programmatically. This is the purpose of ", #> list("invoke()"), ".\n"), "\n", list("\n", "Technically, ", #> list("invoke()"), " is basically a version of ", #> list(list("base::do.call()")), "\n", "that creates cleaner call traces because it does not inline the\n", #> "function and the arguments in the call (see examples). To achieve\n", #> "this, ", list("invoke()"), " creates a child environment of ", #> list(".env"), " with ", list(".fn"), "\n", "and all arguments bound to new symbols (see ", #> list(list("env_bury()")), "). It then\n", "uses the same strategy as ", #> list(list("eval_bare()")), " to evaluate with minimal\n", #> "noise.\n"), "\n", list(list("Life cycle"), list( #> "\n", "\n", "\n", list("invoke()"), " is soft-deprecated in favour of ", #> list(list("exec()")), ". Now that we\n", "understand better the interaction between unquoting and dots\n", #> "capture, we can take a simpler approach in ", #> list("exec()"), ".\n", "\n", "If you need finer control over the generated call, you should construct\n", #> "an environment and call yourself, manually burying large objects\n", #> "or complex expressions.\n")), "\n", "\n", list( #> "\n", "# invoke() has the same purpose as do.call():\n", #> "invoke(paste, letters)\n", "\n", "# But it creates much cleaner calls:\n", #> "invoke(call_inspect, mtcars)\n", "\n", "# and stacktraces:\n", #> "fn <- function(...) sys.calls()\n", "invoke(fn, list(mtcars))\n", #> "\n", "# Compare to do.call():\n", "do.call(call_inspect, mtcars)\n", #> "do.call(fn, list(mtcars))\n", "\n", "\n", "# Specify the function name either by supplying a string\n", #> "# identifying the function (it should be visible in .env):\n", #> "invoke(\"call_inspect\", letters)\n", "\n", #> "# Or by changing the .bury argument, with which you can also change\n", #> "# the argument prefix:\n", "invoke(call_inspect, mtcars, .bury = c(\"inspect!\", \"col\"))\n"), #> "\n", list("internal"), "\n"), is_call.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("is_call"), "\n", list("is_call"), "\n", list( #> "Is object a call?"), "\n", list("\n", "is_call(x, name = NULL, n = NULL, ns = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test. If a formula, the right-hand side is\n", #> "extracted.")), "\n", "\n", list(list("name"), #> list("An optional name that the call should match. It is\n", #> "passed to ", list(list("sym()")), " before matching. This argument is vectorised\n", #> "and you can supply a vector of names to match. In this case,\n", #> list("is_call()"), " returns ", list("TRUE"), #> " if at least one name matches.")), "\n", "\n", #> list(list("n"), list("An optional number of arguments that the call should\n", #> "match.")), "\n", "\n", list(list("ns"), list( #> "The namespace of the call. If ", list("NULL"), #> ", the namespace\n", "doesn't participate in the pattern-matching. If an empty string\n", #> list("\"\""), " and ", list("x"), " is a namespaced call, ", #> list("is_call()"), " returns\n", list("FALSE"), #> ". If any other string, ", list("is_call()"), #> " checks that ", list("x"), " is\n", "namespaced within ", #> list("ns"), ".\n", "\n", "Can be a character vector of namespaces, in which case the call\n", #> "has to match at least one of them, otherwise ", #> list("is_call()"), " returns\n", list("FALSE"), #> ".")), "\n"), "\n", list("\n", "This function tests if ", #> list("x"), " is a ", list("call"), ". This is a\n", #> "pattern-matching predicate that returns ", list( #> "FALSE"), " if ", list("name"), " and ", list( #> "n"), "\n", "are supplied and the call does not match these properties.\n", #> list("is_unary_call()"), " and ", list("is_binary_call()"), #> " hardcode ", list("n"), " to 1 and 2.\n"), "\n", #> list(list("Life cycle"), list("\n", "\n", "\n", list( #> "is_lang()"), " has been soft-deprecated and renamed to ", #> list("is_call()"), " in\n", "rlang 0.2.0 and similarly for ", #> list("is_unary_lang()"), " and\n", list("is_binary_lang()"), #> ". This renaming follows the general switch from\n", #> "\"language\" to \"call\" in the rlang type nomenclature. See lifecycle\n", #> "section in ", list(list("call2()")), ".\n")), #> "\n", "\n", list("\n", "is_call(quote(foo(bar)))\n", #> "\n", "# You can pattern-match the call with additional arguments:\n", #> "is_call(quote(foo(bar)), \"foo\")\n", "is_call(quote(foo(bar)), \"bar\")\n", #> "is_call(quote(foo(bar)), quote(foo))\n", "\n", #> "# Match the number of arguments with is_call():\n", #> "is_call(quote(foo(bar)), \"foo\", 1)\n", "is_call(quote(foo(bar)), \"foo\", 2)\n", #> "\n", "\n", "# By default, namespaced calls are tested unqualified:\n", #> "ns_expr <- quote(base::list())\n", "is_call(ns_expr, \"list\")\n", #> "\n", "# You can also specify whether the call shouldn't be namespaced by\n", #> "# supplying an empty string:\n", "is_call(ns_expr, \"list\", ns = \"\")\n", #> "\n", "# Or if it should have a namespace:\n", #> "is_call(ns_expr, \"list\", ns = \"utils\")\n", #> "is_call(ns_expr, \"list\", ns = \"base\")\n", #> "\n", "# You can supply multiple namespaces:\n", #> "is_call(ns_expr, \"list\", ns = c(\"utils\", \"base\"))\n", #> "is_call(ns_expr, \"list\", ns = c(\"utils\", \"stats\"))\n", #> "\n", "# If one of them is \"\", unnamespaced calls will match as well:\n", #> "is_call(quote(list()), \"list\", ns = \"base\")\n", #> "is_call(quote(list()), \"list\", ns = c(\"base\", \"\"))\n", #> "is_call(quote(base::list()), \"list\", ns = c(\"base\", \"\"))\n", #> "\n", "\n", "# The name argument is vectorised so you can supply a list of names\n", #> "# to match with:\n", "is_call(quote(foo(bar)), c(\"bar\", \"baz\"))\n", #> "is_call(quote(foo(bar)), c(\"bar\", \"foo\"))\n", #> "is_call(quote(base::list), c(\"::\", \":::\", \"$\", \"@\"))\n"), #> "\n", list("\n", list(list("is_expression()")), "\n"), #> "\n"), is_callable.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("is_callable"), "\n", list("is_callable"), #> "\n", list("Is an object callable?"), "\n", list( #> "\n", "is_callable(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", "A callable object is an object that can appear in the function\n", #> "position of a call (as opposed to argument position). This includes\n", #> list("symbolic objects"), " that evaluate to a function or\n", #> "literal functions embedded in the call.\n"), #> "\n", list("\n", "Note that strings may look like callable objects because\n", #> "expressions of the form ", list("\"list\"()"), #> " are valid R code. However,\n", "that's only because the R parser transforms strings to symbols. It\n", #> "is not legal to manually set language heads to strings.\n"), #> "\n", list("\n", "# Symbolic objects and functions are callable:\n", #> "is_callable(quote(foo))\n", "is_callable(base::identity)\n", #> "\n", "# node_poke_car() lets you modify calls without any checking:\n", #> "lang <- quote(foo(10))\n", "node_poke_car(lang, current_env())\n", #> "\n", "# Use is_callable() to check an input object is safe to put as CAR:\n", #> "obj <- base::identity\n", "\n", "if (is_callable(obj)) {\n", #> " lang <- node_poke_car(lang, obj)\n", "} else {\n", #> " abort(\"`obj` must be callable\")\n", "}\n", #> "\n", "eval_bare(lang)\n"), "\n"), is_condition.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd.R", "\n", list( #> "is_condition"), "\n", list("is_condition"), #> "\n", list("Is object a condition?"), "\n", list( #> "\n", "is_condition(x)\n"), "\n", list("\n", #> list(list("x"), list("An object to test.")), #> "\n"), "\n", list("\n", "Is object a condition?\n"), #> "\n"), is_copyable.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/types.R", #> "\n", list("is_copyable"), "\n", list("is_copyable"), #> "\n", list("Is an object copyable?"), "\n", list( #> "\n", "is_copyable(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", "When an object is modified, R generally copies it (sometimes\n", #> "lazily) to enforce ", list(list("https://en.wikipedia.org/wiki/Value_semantics"), #> list("value semantics")), ".\n", "However, some internal types are uncopyable. If you try to copy\n", #> "them, either with ", list("<-"), " or by argument passing, you actually create\n", #> "references to the original object rather than actual\n", #> "copies. Modifying these references can thus have far reaching side\n", #> "effects.\n"), "\n", list("\n", "# Let's add attributes with structure() to uncopyable types. Since\n", #> "# they are not copied, the attributes are changed in place:\n", #> "env <- env()\n", "structure(env, foo = \"bar\")\n", #> "env\n", "\n", "# These objects that can only be changed with side effect are not\n", #> "# copyable:\n", "is_copyable(env)\n", "\n", #> "structure(base::list, foo = \"bar\")\n", "str(base::list)\n"), #> "\n"), is_empty.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/types.R", #> "\n", list("is_empty"), "\n", list("is_empty"), "\n", #> list("Is object an empty vector or NULL?"), "\n", #> list("\n", "is_empty(x)\n"), "\n", list("\n", list( #> list("x"), list("object to test")), "\n"), "\n", #> list("\n", "Is object an empty vector or NULL?\n"), #> "\n", list("\n", "is_empty(NULL)\n", "is_empty(list())\n", #> "is_empty(list(NULL))\n"), "\n"), is_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_env"), "\n", list("is_env"), "\n", #> list("is_bare_env"), "\n", list("Is an object an environment?"), #> "\n", list("\n", "is_env(x)\n", "\n", "is_bare_env(x)\n"), #> "\n", list("\n", list(list("x"), list("object to test")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions were deprecated and renamed to ", #> list(list("is_environment()")), "\n", "and ", #> list(list("is_bare_environment()")), " in rlang 0.2.0. This is for consistency\n", #> "with other type predicates which are not abbreviated.\n"), #> "\n", list("internal"), "\n"), is_environment.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("is_environment"), "\n", list("is_environment"), #> "\n", list("is_bare_environment"), "\n", list("Is object an environment?"), #> "\n", list("\n", "is_environment(x)\n", "\n", "is_bare_environment(x)\n"), #> "\n", list("\n", list(list("x"), list("object to test")), #> "\n"), "\n", list("\n", list("is_bare_environment()"), #> " tests whether ", list("x"), " is an environment without a s3 or\n", #> "s4 class.\n"), "\n"), is_expr.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_expr"), "\n", list("is_expr"), "\n", #> list("Is an object an expression?"), "\n", list("\n", #> "is_expr(x)\n"), "\n", list("\n", list(list("x"), #> list("An object to test.")), "\n"), "\n", list( #> "\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "This function was deprecated and renamed to ", #> list(list("is_expression()")), " in\n", "rlang 0.2.0. This is for consistency with other type predicates\n", #> "which are not abbreviated.\n"), "\n", list("internal"), #> "\n"), is_expression.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/expr.R", #> "\n", list("is_expression"), "\n", list("is_expression"), #> "\n", list("is_syntactic_literal"), "\n", list("is_symbolic"), #> "\n", list("Is an object an expression?"), "\n", #> list("\n", "is_expression(x)\n", "\n", "is_syntactic_literal(x)\n", #> "\n", "is_symbolic(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", list("is_expression()"), " tests for expressions, the set of objects that can be\n", #> "obtained from parsing R code. An expression can be one of two\n", #> "things: either a symbolic object (for which ", #> list("is_symbolic()"), " returns\n", list("TRUE"), #> "), or a syntactic literal (testable with\n", #> list("is_syntactic_literal()"), "). Technically, calls can contain any R\n", #> "object, not necessarily symbolic objects or syntactic\n", #> "literals. However, this only happens in artificial\n", #> "situations. Expressions as we define them only contain numbers,\n", #> "strings, ", list("NULL"), ", symbols, and calls: this is the complete set of R\n", #> "objects that can be created when R parses source code (e.g. from\n", #> "using ", list(list("parse_expr()")), ").\n", #> "\n", "Note that we are using the term expression in its colloquial sense\n", #> "and not to refer to ", list(list("expression()")), #> " vectors, a data type that wraps\n", "expressions in a vector and which isn't used much in modern R code.\n"), #> "\n", list("\n", list("is_symbolic()"), " returns ", #> list("TRUE"), " for symbols and calls (objects with\n", #> "type ", list("language"), "). Symbolic objects are replaced by their value\n", #> "during evaluation. Literals are the complement of symbolic\n", #> "objects. They are their own value and return themselves during\n", #> "evaluation.\n", "\n", list("is_syntactic_literal()"), #> " is a predicate that returns ", list("TRUE"), #> " for the\n", "subset of literals that are created by R when parsing text (see\n", #> list(list("parse_expr()")), "): numbers, strings and ", #> list("NULL"), ". Along with symbols,\n", "these literals are the terminating nodes in an AST.\n", #> "\n", "Note that in the most general sense, a literal is any R object that\n", #> "evaluates to itself and that can be evaluated in the empty\n", #> "environment. For instance, ", list("quote(c(1, 2))"), #> " is not a literal, it is\n", "a call. However, the result of evaluating it in ", #> list(list("base_env()")), " is a\n", "literal(in this case an atomic vector).\n", #> "\n", "Pairlists are also a kind of language objects. However, since they\n", #> "are mostly an internal data structure, ", list( #> "is_expression()"), " returns ", list("FALSE"), #> "\n", "for pairlists. You can use ", list("is_pairlist()"), #> " to explicitly check for\n", "them. Pairlists are the data structure for function arguments. They\n", #> "usually do not arise from R code because subsetting a call is a\n", #> "type-preserving operation. However, you can obtain the pairlist of\n", #> "arguments by taking the CDR of the call object from C code. The\n", #> "rlang function ", list(list("node_cdr()")), #> " will do it from R. Another way in\n", "which pairlist of arguments arise is by extracting the argument\n", #> "list of a closure with ", list(list("base::formals()")), #> " or ", list(list("fn_fmls()")), ".\n"), "\n", #> list("\n", "q1 <- quote(1)\n", "is_expression(q1)\n", #> "is_syntactic_literal(q1)\n", "\n", "q2 <- quote(x)\n", #> "is_expression(q2)\n", "is_symbol(q2)\n", "\n", #> "q3 <- quote(x + 1)\n", "is_expression(q3)\n", #> "is_call(q3)\n", "\n", "\n", "# Atomic expressions are the terminating nodes of a call tree:\n", #> "# NULL or a scalar atomic vector:\n", "is_syntactic_literal(\"string\")\n", #> "is_syntactic_literal(NULL)\n", "\n", "is_syntactic_literal(letters)\n", #> "is_syntactic_literal(quote(call()))\n", "\n", #> "# Parsable literals have the property of being self-quoting:\n", #> "identical(\"foo\", quote(\"foo\"))\n", "identical(1L, quote(1L))\n", #> "identical(NULL, quote(NULL))\n", "\n", "# Like any literals, they can be evaluated within the empty\n", #> "# environment:\n", "eval_bare(quote(1L), empty_env())\n", #> "\n", "# Whereas it would fail for symbolic expressions:\n", #> "# eval_bare(quote(c(1L, 2L)), empty_env())\n", #> "\n", "\n", "# Pairlists are also language objects representing argument lists.\n", #> "# You will usually encounter them with extracted formals:\n", #> "fmls <- formals(is_expression)\n", "typeof(fmls)\n", #> "\n", "# Since they are mostly an internal data structure, is_expression()\n", #> "# returns FALSE for pairlists, so you will have to check explicitly\n", #> "# for them:\n", "is_expression(fmls)\n", "is_pairlist(fmls)\n"), #> "\n", list("\n", list(list("is_call()")), " for a call predicate.\n"), #> "\n"), is_formula.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/formula.R", #> "\n", list("is_formula"), "\n", list("is_formula"), #> "\n", list("is_bare_formula"), "\n", list("Is object a formula?"), #> "\n", list("\n", "is_formula(x, scoped = NULL, lhs = NULL)\n", #> "\n", "is_bare_formula(x, scoped = NULL, lhs = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("scoped"), list("A boolean indicating whether the quosure is scoped,\n", #> "that is, has a valid environment attribute. If ", #> list("NULL"), ", the scope\n", "is not inspected.")), #> "\n", "\n", list(list("lhs"), list("A boolean indicating whether the ", #> list("formula"), "\n", "or ", list("definition"), #> " has a left-hand side. If ", list("NULL"), #> ",\n", "the LHS is not inspected.")), "\n"), #> "\n", list("\n", list("is_formula()"), " tests if ", #> list("x"), " is a call to ", list("~"), ". ", #> list("is_bare_formula()"), "\n", "tests in addition that ", #> list("x"), " does not inherit from anything else than\n", #> list("\"formula\""), ".\n"), "\n", list("\n", #> "The ", list("scoped"), " argument patterns-match on whether the scoped bundled\n", #> "with the quosure is valid or not. Invalid scopes may happen in\n", #> "nested quotations like ", list("~~expr"), ", where the outer quosure is validly\n", #> "scoped but not the inner one. This is because ", #> list("~"), " saves the\n", "environment when it is evaluated, and quoted formulas are by\n", #> "definition not evaluated.\n"), "\n", list("\n", #> "x <- disp ~ am\n", "is_formula(x)\n", "\n", #> "is_formula(~10)\n", "is_formula(10)\n", "\n", #> "is_formula(quo(foo))\n", "is_bare_formula(quo(foo))\n", #> "\n", "# Note that unevaluated formulas are treated as bare formulas even\n", #> "# though they don't inherit from \"formula\":\n", #> "f <- quote(~foo)\n", "is_bare_formula(f)\n", #> "\n", "# However you can specify `scoped` if you need the predicate to\n", #> "# return FALSE for these unevaluated formulas:\n", #> "is_bare_formula(f, scoped = TRUE)\n", "is_bare_formula(eval(f), scoped = TRUE)\n"), #> "\n"), is_frame.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_frame"), "\n", list("is_frame"), "\n", #> list("Is object a frame?"), "\n", list("\n", "is_frame(x)\n"), #> "\n", list("\n", list(list("x"), list("Object to test")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n"), "\n", list("internal"), "\n"), is_function.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list( #> "is_function"), "\n", list("is_function"), "\n", #> list("is_closure"), "\n", list("is_primitive"), "\n", #> list("is_primitive_eager"), "\n", list("is_primitive_lazy"), #> "\n", list("Is object a function?"), "\n", list("\n", #> "is_function(x)\n", "\n", "is_closure(x)\n", #> "\n", "is_primitive(x)\n", "\n", "is_primitive_eager(x)\n", #> "\n", "is_primitive_lazy(x)\n"), "\n", list("\n", #> list(list("x"), list("Object to be tested.")), #> "\n"), "\n", list("\n", "The R language defines two different types of functions: primitive\n", #> "functions, which are low-level, and closures, which are the regular\n", #> "kind of functions.\n"), "\n", list("\n", "Closures are functions written in R, named after the way their\n", #> "arguments are scoped within nested environments (see\n", #> "https://en.wikipedia.org/wiki/Closure_(computer_programming)). The\n", #> "root environment of the closure is called the closure\n", #> "environment. When closures are evaluated, a new environment called\n", #> "the evaluation frame is created with the closure environment as\n", #> "parent. This is where the body of the closure is evaluated. These\n", #> "closure frames appear on the evaluation stack (see ", #> list(list("ctxt_stack()")), "),\n", "as opposed to primitive functions which do not necessarily have\n", #> "their own evaluation frame and never appear on the stack.\n", #> "\n", "Primitive functions are more efficient than closures for two\n", #> "reasons. First, they are written entirely in fast low-level\n", #> "code. Second, the mechanism by which they are passed arguments is\n", #> "more efficient because they often do not need the full procedure of\n", #> "argument matching (dealing with positional versus named arguments,\n", #> "partial matching, etc). One practical consequence of the special\n", #> "way in which primitives are passed arguments is that they\n", #> "technically do not have formal arguments, and ", #> list(list("formals()")), " will\n", "return ", #> list("NULL"), " if called on a primitive function. Finally, primitive\n", #> "functions can either take arguments lazily, like R closures do,\n", #> "or evaluate them eagerly before being passed on to the C code.\n", #> "The former kind of primitives are called \"special\" in R terminology,\n", #> "while the latter is referred to as \"builtin\". ", #> list("is_primitive_eager()"), "\n", "and ", list( #> "is_primitive_lazy()"), " allow you to check whether a primitive\n", #> "function evaluates arguments eagerly or lazily.\n", #> "\n", "You will also encounter the distinction between primitive and\n", #> "internal functions in technical documentation. Like primitive\n", #> "functions, internal functions are defined at a low level and\n", #> "written in C. However, internal functions have no representation in\n", #> "the R language. Instead, they are called via a call to\n", #> list(list("base::.Internal()")), " within a regular closure. This ensures that\n", #> "they appear as normal R function objects: they obey all the usual\n", #> "rules of argument passing, and they appear on the evaluation stack\n", #> "as any other closures. As a result, ", list( #> list("fn_fmls()")), " does not need to\n", #> "look in the ", list(".ArgsEnv"), " environment to obtain a representation of\n", #> "their arguments, and there is no way of querying from R whether\n", #> "they are lazy ('special' in R terminology) or eager ('builtin').\n", #> "\n", "You can call primitive functions with ", #> list(list(".Primitive()")), " and internal\n", #> "functions with ", list(list(".Internal()")), #> ". However, calling internal functions\n", "in a package is forbidden by CRAN's policy because they are\n", #> "considered part of the private API. They often assume that they\n", #> "have been called with correctly formed arguments, and may cause R\n", #> "to crash if you call them with unexpected objects.\n"), #> "\n", list("\n", "# Primitive functions are not closures:\n", #> "is_closure(base::c)\n", "is_primitive(base::c)\n", #> "\n", "# On the other hand, internal functions are wrapped in a closure\n", #> "# and appear as such from the R side:\n", "is_closure(base::eval)\n", #> "\n", "# Both closures and primitives are functions:\n", #> "is_function(base::c)\n", "is_function(base::eval)\n", #> "\n", "# Primitive functions never appear in evaluation stacks:\n", #> "is_primitive(base::`[[`)\n", "is_primitive(base::list)\n", #> "list(ctxt_stack())[[1]]\n", "\n", "# While closures do:\n", #> "identity(identity(ctxt_stack()))\n", "\n", "# Many primitive functions evaluate arguments eagerly:\n", #> "is_primitive_eager(base::c)\n", "is_primitive_eager(base::list)\n", #> "is_primitive_eager(base::`+`)\n", "\n", "# However, primitives that operate on expressions, like quote() or\n", #> "# substitute(), are lazy:\n", "is_primitive_lazy(base::quote)\n", #> "is_primitive_lazy(base::substitute)\n"), "\n"), #> is_installed.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("is_installed"), "\n", list("is_installed"), #> "\n", list("Is a package installed in the library?"), #> "\n", list("\n", "is_installed(pkg)\n"), "\n", list( #> "\n", list(list("pkg"), list("The name of a package.")), #> "\n"), "\n", list("\n", list("TRUE"), " if the package is installed, ", #> list("FALSE"), " otherwise.\n"), "\n", list("\n", #> "This checks that a package is installed with minimal side effects.\n", #> "If installed, the package will be loaded but not attached.\n"), #> "\n", list("\n", "is_installed(\"utils\")\n", "is_installed(\"ggplot5\")\n"), #> "\n"), is_integerish.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/types.R", #> "\n", list("is_integerish"), "\n", list("is_integerish"), #> "\n", list("is_bare_integerish"), "\n", list("is_scalar_integerish"), #> "\n", list("Is a vector integer-like?"), "\n", list( #> "\n", "is_integerish(x, n = NULL, finite = NULL)\n", #> "\n", "is_bare_integerish(x, n = NULL, finite = NULL)\n", #> "\n", "is_scalar_integerish(x, finite = NULL)\n"), #> "\n", list("\n", list(list("x"), list("Object to be tested.")), #> "\n", "\n", list(list("n"), list("Expected length of a vector.")), #> "\n", "\n", list(list("finite"), list("Whether all values of the vector are finite. The\n", #> "non-finite values are ", list("NA"), ", ", #> list("Inf"), ", ", list("-Inf"), " and ", list( #> "NaN"), ". Setting this\n", "to something other than ", #> list("NULL"), " can be expensive because the whole\n", #> "vector needs to be traversed and checked.")), #> "\n"), "\n", list("\n", "These predicates check whether R considers a number vector to be\n", #> "integer-like, according to its own tolerance check (which is in\n", #> "fact delegated to the C library). This function is not adapted to\n", #> "data analysis, see the help for ", list(list( #> "base::is.integer()")), " for examples\n", #> "of how to check for whole numbers.\n", "\n", #> "Things to consider when checking for integer-like doubles:\n", #> list("\n", list(), " This check can be expensive because the whole double vector has\n", #> "to be traversed and checked.\n", list(), " Large double values may be integerish but may still not be\n", #> "coercible to integer. This is because integers in R only support\n", #> "values up to ", list("2^31 - 1"), " while numbers stored as double can be\n", #> "much larger.\n"), "\n"), "\n", list("\n", #> "is_integerish(10L)\n", "is_integerish(10.0)\n", #> "is_integerish(10.0, n = 2)\n", "is_integerish(10.000001)\n", #> "is_integerish(TRUE)\n"), "\n", list("\n", list( #> list("is_bare_numeric()")), " for testing whether an object is a\n", #> "base numeric type (a bare double or integer vector).\n"), #> "\n"), is_interactive.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/state.R", #> "\n", list("is_interactive"), "\n", list("is_interactive"), #> "\n", list("scoped_interactive"), "\n", list("with_interactive"), #> "\n", list("Is R running interactively?"), "\n", #> list("\n", "is_interactive()\n", "\n", "scoped_interactive(value = TRUE, frame = caller_env())\n", #> "\n", "with_interactive(expr, value = TRUE)\n"), #> "\n", list("\n", list(list("value"), list("A single ", #> list("TRUE"), " or ", list("FALSE"), ". This overrides the return\n", #> "value of ", list("is_interactive()"), ".")), #> "\n", "\n", list(list("frame"), list("The environment of a running function which defines\n", #> "the scope of the temporary options. When the function returns,\n", #> "the options are reset to their original values.")), #> "\n", "\n", list(list("expr"), list("An expression to evaluate with interactivity set to\n", #> list("value"), ".")), "\n"), "\n", list("\n", #> "Like ", list(list("base::interactive()")), ", ", #> list("is_interactive()"), " returns ", list("TRUE"), #> " when\n", "the function runs interactively and ", #> list("FALSE"), " when it runs in batch\n", "mode. It also checks, in this order:\n", #> list("\n", list(), " The ", list("rlang_interactive"), #> " global option. If set to a single ", list( #> "TRUE"), "\n", "or ", list("FALSE"), ", ", #> list("is_interactive()"), " returns that value immediately. This\n", #> "escape hatch is useful in unit tests or to manually turn on\n", #> "interactive features in RMarkdown outputs.\n", #> list(), " Whether knitr, an RStudio notebook, or testthat is in progress.\n"), #> "\n", "\n", list("with_interactive()"), " and ", #> list("scoped_interactive()"), " set the global\n", #> "option conveniently.\n"), "\n"), is_lang.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_lang"), "\n", list("is_lang"), "\n", #> list("is_unary_lang"), "\n", list("is_binary_lang"), #> "\n", list("quo_is_lang"), "\n", list("Is object a call?"), #> "\n", list("\n", "is_lang(x, name = NULL, n = NULL, ns = NULL)\n", #> "\n", "is_unary_lang(x, name = NULL, ns = NULL)\n", #> "\n", "is_binary_lang(x, name = NULL, ns = NULL)\n", #> "\n", "quo_is_lang(quo)\n"), "\n", list("\n", #> list(list("x"), list("An object to test. If a formula, the right-hand side is\n", #> "extracted.")), "\n", "\n", list(list("name"), #> list("An optional name that the call should match. It is\n", #> "passed to ", list(list("sym()")), " before matching. This argument is vectorised\n", #> "and you can supply a vector of names to match. In this case,\n", #> list("is_call()"), " returns ", list("TRUE"), #> " if at least one name matches.")), "\n", #> "\n", list(list("n"), list("An optional number of arguments that the call should\n", #> "match.")), "\n", "\n", list(list("ns"), list( #> "The namespace of the call. If ", list("NULL"), #> ", the namespace\n", "doesn't participate in the pattern-matching. If an empty string\n", #> list("\"\""), " and ", list("x"), " is a namespaced call, ", #> list("is_call()"), " returns\n", list("FALSE"), #> ". If any other string, ", list("is_call()"), #> " checks that ", list("x"), " is\n", "namespaced within ", #> list("ns"), ".\n", "\n", "Can be a character vector of namespaces, in which case the call\n", #> "has to match at least one of them, otherwise ", #> list("is_call()"), " returns\n", list("FALSE"), #> ".")), "\n", "\n", list(list("quo"), list("A quosure to test.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions are deprecated, please use ", #> list(list("is_call()")), " and its ", list("n"), #> "\n", "argument instead.\n"), "\n", list("internal"), #> "\n"), is_named.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/attr.R", #> "\n", list("is_named"), "\n", list("is_named"), "\n", #> list("is_dictionaryish"), "\n", list("have_name"), #> "\n", list("Is object named?"), "\n", list("\n", #> "is_named(x)\n", "\n", "is_dictionaryish(x)\n", #> "\n", "have_name(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", list("is_named()"), " and ", list( #> "is_dictionaryish()"), " are scalar predicates\n", #> "and return ", list("TRUE"), " or ", list("FALSE"), #> ". ", list("have_name()"), " is vectorised and\n", #> "returns a logical vector as long as the input.\n"), #> "\n", list("\n", list("is_named()"), " checks that ", #> list("x"), " has names attributes, and that none of\n", #> "the names are missing or empty (", list("NA"), #> " or ", list("\"\""), "). ", list("is_dictionaryish()"), #> "\n", "checks that an object is a dictionary: that it has actual names and\n", #> "in addition that there are no duplicated names. ", #> list("have_name()"), "\n", "is a vectorised version of ", #> list("is_named()"), ".\n"), "\n", list("\n", #> "# A data frame usually has valid, unique names\n", #> "is_named(mtcars)\n", "have_name(mtcars)\n", #> "is_dictionaryish(mtcars)\n", "\n", "# But data frames can also have duplicated columns:\n", #> "dups <- cbind(mtcars, cyl = seq_len(nrow(mtcars)))\n", #> "is_dictionaryish(dups)\n", "\n", "# The names are still valid:\n", #> "is_named(dups)\n", "have_name(dups)\n", "\n", #> "\n", "# For empty objects the semantics are slightly different.\n", #> "# is_dictionaryish() returns TRUE for empty objects:\n", #> "is_dictionaryish(list())\n", "\n", "# But is_named() will only return TRUE if there is a names\n", #> "# attribute (a zero-length character vector in this case):\n", #> "x <- set_names(list(), character(0))\n", "is_named(x)\n", #> "\n", "\n", "# Empty and missing names are invalid:\n", #> "invalid <- dups\n", "names(invalid)[2] <- \"\"\n", #> "names(invalid)[5] <- NA\n", "\n", "# is_named() performs a global check while have_name() can show you\n", #> "# where the problem is:\n", "is_named(invalid)\n", #> "have_name(invalid)\n", "\n", "# have_name() will work even with vectors that don't have a names\n", #> "# attribute:\n", "have_name(letters)\n"), "\n"), #> is_namespace.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("is_namespace"), "\n", list("is_namespace"), #> "\n", list("Is an object a namespace environment?"), #> "\n", list("\n", "is_namespace(x)\n"), "\n", list( #> "\n", list(list("x"), list("An object to test.")), #> "\n"), "\n", list("\n", "Is an object a namespace environment?\n"), #> "\n"), is_pairlist.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/node.R", #> "\n", list("is_pairlist"), "\n", list("is_pairlist"), #> "\n", list("is_node"), "\n", list("is_node_list"), #> "\n", list("Is object a node or pairlist?"), "\n", #> list("\n", "is_pairlist(x)\n", "\n", "is_node(x)\n", #> "\n", "is_node_list(x)\n"), "\n", list("\n", #> list(list("x"), list("Object to test.")), "\n"), #> "\n", list("\n", list("\n", list(), " ", list("is_pairlist()"), #> " checks that ", list("x"), " has type ", list( #> "pairlist"), ".\n", list(), " ", list("is_node()"), #> " checks that ", list("x"), " has type ", list( #> "pairlist"), " or ", list("language"), ".\n", #> "It tests whether ", list("x"), " is a node that has a CAR and a CDR,\n", #> "including callable nodes (language objects).\n", #> list(), " ", list("is_node_list()"), " checks that ", #> list("x"), " has type ", list("pairlist"), " or ", #> list("NULL"), ".\n", list("NULL"), " is the empty node list.\n"), #> "\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "These functions are experimental. We are still figuring out a good\n", #> "naming convention to refer to the different lisp-like lists in R.\n")), #> "\n", "\n", list("\n", list(list("is_call()")), " tests for language nodes.\n"), #> "\n", list("internal"), "\n"), is_reference.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("is_reference"), "\n", list("is_reference"), #> "\n", list("Is an object referencing another?"), #> "\n", list("\n", "is_reference(x, y)\n"), "\n", list( #> "\n", list(list("x, y"), list("R objects.")), #> "\n"), "\n", list("\n", "There are typically two situations where two symbols may refer to\n", #> "the same object.\n", list("\n", list(), " R objects usually have copy-on-write semantics. This is an\n", #> "optimisation that ensures that objects are only copied if\n", #> "needed. When you copy a vector, no memory is actually copied\n", #> "until you modify either the original object or the copy is\n", #> "modified.\n", "\n", "Note that the copy-on-write optimisation is an implementation\n", #> "detail that is not guaranteed by the specification of the R\n", #> "language.\n", list(), " Assigning an ", list( #> "uncopyable"), " object (like an\n", "environment) creates a reference. These objects are never copied\n", #> "even if you modify one of the references.\n"), #> "\n"), "\n", list("\n", "# Reassigning an uncopyable object such as an environment creates a\n", #> "# reference:\n", "env <- env()\n", "ref <- env\n", #> "is_reference(ref, env)\n", "\n", "# Due to copy-on-write optimisation, a copied vector can\n", #> "# temporarily reference the original vector:\n", #> "vec <- 1:10\n", "copy <- vec\n", "is_reference(copy, vec)\n", #> "\n", "# Once you modify on of them, the copy is triggered in the\n", #> "# background and the objects cease to reference each other:\n", #> "vec[[1]] <- 100\n", "is_reference(copy, vec)\n"), #> "\n"), is_stack.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_stack"), "\n", list("is_stack"), "\n", #> list("is_eval_stack"), "\n", list("is_call_stack"), #> "\n", list("Is object a stack?"), "\n", list("\n", #> "is_stack(x)\n", "\n", "is_eval_stack(x)\n", #> "\n", "is_call_stack(x)\n"), "\n", list("\n", #> list(list("x"), list("An object to test")), "\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n"), "\n"), is_symbol.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/sym.R", "\n", #> list("is_symbol"), "\n", list("is_symbol"), "\n", #> list("Is object a symbol?"), "\n", list("\n", "is_symbol(x, name = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("name"), list("An optional name or vector of names that the symbol\n", #> "should match.")), "\n"), "\n", list("\n", #> "Is object a symbol?\n"), "\n"), is_true.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("is_true"), "\n", list("is_true"), "\n", list( #> "is_false"), "\n", list("Is object identical to TRUE or FALSE?"), #> "\n", list("\n", "is_true(x)\n", "\n", "is_false(x)\n"), #> "\n", list("\n", list(list("x"), list("object to test")), #> "\n"), "\n", list("\n", "These functions bypass R's automatic conversion rules and check\n", #> "that ", list("x"), " is literally ", list("TRUE"), #> " or ", list("FALSE"), ".\n"), "\n", list("\n", #> "is_true(TRUE)\n", "is_true(1)\n", "\n", "is_false(FALSE)\n", #> "is_false(0)\n"), "\n"), is_weakref.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/weakref.R", "\n", #> list("is_weakref"), "\n", list("is_weakref"), "\n", #> list("Is object a weak reference?"), "\n", list("\n", #> "is_weakref(x)\n"), "\n", list("\n", list(list( #> "x"), list("An object to test.")), "\n"), "\n", #> list("\n", "Is object a weak reference?\n"), "\n"), #> lang.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("lang"), "\n", list("lang"), "\n", list( #> "new_language"), "\n", list("Create a call"), #> "\n", list("\n", "lang(.fn, ..., .ns = NULL)\n", #> "\n", "new_language(head, tail = NULL)\n"), "\n", #> list("\n", list(list(".fn"), list("Function to call. Must be a callable object: a string,\n", #> "symbol, call, or a function.")), "\n", "\n", #> list(list("..."), list("Arguments to the call either in or out of a list. These dots\n", #> "support ", list("tidy dots"), " features. Empty arguments are preserved.")), #> "\n", "\n", list(list(".ns"), list("Namespace with which to prefix ", #> list(".fn"), ". Must be a string\n", "or symbol.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions are deprecated, please use ", #> list(list("call2()")), " and\n", list(list("new_call()")), #> " instead.\n"), "\n", list("internal"), "\n"), #> lang_head.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("lang_head"), "\n", list("lang_head"), #> "\n", list("lang_tail"), "\n", list("Return the head or tail of a call"), #> "\n", list("\n", "lang_head(lang)\n", "\n", "lang_tail(lang)\n"), #> "\n", list("\n", list(list("lang"), list("A call.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "As of rlang 0.2.0 these functions are retired (deprecated for now)\n", #> "because they are low level accessors that are rarely needed for end\n", #> "users.\n"), "\n"), lang_modify.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("lang_modify"), "\n", list("lang_modify"), #> "\n", list("lang_standardise"), "\n", list("lang_fn"), #> "\n", list("lang_name"), "\n", list("lang_args"), #> "\n", list("lang_args_names"), "\n", list("Manipulate or access a call"), #> "\n", list("\n", "lang_modify(.lang, ..., .standardise = FALSE)\n", #> "\n", "lang_standardise(lang)\n", "\n", "lang_fn(lang)\n", #> "\n", "lang_name(lang)\n", "\n", "lang_args(lang)\n", #> "\n", "lang_args_names(lang)\n"), "\n", list( #> "\n", list(list("..."), list("Named or unnamed expressions (constants, names or calls)\n", #> "used to modify the call. Use ", list(list( #> "zap()")), " to remove arguments. These\n", #> "dots support ", list("tidy dots"), " features. Empty arguments are\n", #> "allowed and preserved.")), "\n", "\n", list( #> list(".standardise"), list("Soft-deprecated as of rlang 0.3.0. Please\n", #> "call ", list(list("call_standardise()")), #> " manually.")), "\n", "\n", list(list("lang, .lang"), #> list("The ", list("call"), " or ", list(".call"), #> " argument of the renamed\n", "functions.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions are deprecated, please use ", #> list(list("call_modify()")), ",\n", list(list( #> "call_standardise()")), ", or ", list(list( #> "call_fn()")), " instead.\n"), "\n", list("internal"), #> "\n"), last_error.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-abort.R", #> "\n", list("last_error"), "\n", list("last_error"), #> "\n", list("last_trace"), "\n", list("Last ", list( #> "abort()"), " error"), "\n", list("\n", "last_error()\n", #> "\n", "last_trace()\n"), "\n", list("\n", list( #> "\n", list(), " ", list("last_error()"), " returns the last error thrown with ", #> list(list("abort()")), ". The\n", "error is printed with a backtrace in simplified form.\n", #> list(), " ", list("last_trace()"), " is a shortcut to return the backtrace stored in\n", #> "the last error. This backtrace is printed in full form.\n"), #> "\n"), "\n"), lifecycle.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle.R", #> "\n", list("lifecycle"), "\n", list("lifecycle"), #> "\n", list("Life cycle of the rlang package"), "\n", #> list("\n", list("rlang:::lifecycle(\"maturing\")"), #> "\n", "\n", "The rlang package is currently maturing. Unless otherwise stated,\n", #> "this applies to all its exported functions. Maturing functions are\n", #> "susceptible to API changes. Only use these in packages if you're\n", #> "prepared to make changes as the package evolves. See sections below\n", #> "for a list of functions marked as stable.\n", #> "\n", "The documentation pages of retired functions contain life cycle\n", #> "sections that explain the reasons for their retirements.\n"), #> "\n", list(list("Stable functions"), list("\n", "\n", #> "\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", list("\n", list(), " ", list(list("eval_tidy()")), #> "\n", list(), " ", list("!!"), ", ", list("!!!"), #> "\n", list(), " ", list(list("enquo()")), ", ", #> list(list("quo()")), ", ", list(list("quos()")), #> "\n", list(), " ", list(list("enexpr()")), #> ", ", list(list("expr()")), ", ", list(list( #> "exprs()")), "\n", list(), " ", list(list( #> "sym()")), ", ", list(list("syms()")), "\n", #> list(), " ", list(list("new_quosure()")), ", ", #> list(list("is_quosure()")), "\n", list(), " ", #> list(list("missing_arg()")), ", ", list(list( #> "is_missing()")), "\n", list(), " ", list( #> list("quo_get_expr()")), ", ", list(list( #> "quo_set_expr()")), "\n", list(), " ", list( #> list("quo_get_env()")), ", ", list(list("quo_set_env()")), #> "\n", list(), " ", list(list("eval_bare()")), #> "\n", list(), " ", list(list("set_names()")), #> ", ", list(list("names2()")), "\n", list(), #> " ", list(list("as_function()")), ", ", list( #> list("new_function()")), "\n"), "\n")), "\n", #> "\n", list(list("Experimental functions"), list("\n", #> "\n", "\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "These functions are not yet part of the rlang API. Expect breaking\n", #> "changes.\n", list("\n", list(), " ", list(list( #> "with_env()")), ", ", list(list("locally()")), #> ", ", list(list("env_poke()")), "\n", list(), #> " ", list(list("pkg_env()")), ", ", list(list( #> "pkg_env_name()")), ", ", list(list("ns_env()")), #> ", ", list(list("ns_imports_env()")), ", ", #> list(list("ns_env_name()")), "\n", list(), #> " ", list(list("is_pairlist()")), ", ", list( #> list("as_pairlist()")), ", ", list(list("is_node()")), #> ", ", list(list("is_node_list()")), "\n", list(), #> " ", list(list("is_definition()")), ", ", list( #> list("new_definition()")), ", ", list(list( #> "is_formulaish()")), ",\n", list(list("dots_definitions()")), #> "\n", list(), " ", list(list("scoped_options()")), #> ", ", list(list("with_options()")), ", ", list( #> list("push_options()")), ",\n", list(list( #> "peek_options()")), ", ", list(list("peek_option()")), #> "\n", list(), " ", list(list("as_bytes()")), #> ", ", list(list("chr_unserialise_unicode()")), #> "\n", list(), " ", list(list("caller_fn()")), #> ", ", list(list("current_fn()")), "\n"), "\n")), #> "\n", "\n", list(list("Questioning stage"), list( #> "\n", "\n", "\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("In the questioning stage as of rlang 0.4.0"), #> "\n", "\n", "These functions are likely to be moved to the vctrs package:\n", #> list("\n", list(), " ", list(list("lgl()")), #> ", ", list(list("int()")), ", etc.\n", list(), #> " ", list(list("new_logical()")), ", ", list( #> list("new_integer()")), ", etc.\n", list(), #> " ", list("na_lgl"), ", ", list("na_int"), #> ", ", list(list("is_lgl_na()")), ", ", list( #> list("is_int_na()")), ", etc.\n"), "\n", #> "\n", list("In the questioning stage as of rlang 0.3.0"), #> "\n", list("\n", list(), " ", list(list("child_env()")), #> "\n", list(), " ", list(list("flatten()")), #> ", ", list(list("squash()")), ", and their atomic vector variants\n", #> list(), " ", list(list("modify()")), " and ", #> list(list("prepend()")), "\n", list(), " ", #> list(list("with_restarts()")), ", ", list(list( #> "rst_list()")), ", ", list(list("rst_exists()")), #> ", ", list(list("rst_jump()")), ",\n", list( #> list("rst_maybe_jump()")), ", ", list(list( #> "rst_abort()")), ". It is not clear yet whether we\n", #> "want to recommend restarts as a style of programming in R.\n", #> list(), " ", list(list("return_from()")), " and ", #> list(list("return_to()")), ".\n", list(), " ", #> list(list("expr_label()")), ", ", list(list( #> "expr_name()")), ", and ", list(list("expr_text()")), #> ".\n"), "\n", "\n", list("In the questioning stage as of rlang 0.2.0"), #> "\n", list("\n", list(), " ", list(list("UQ()")), #> ", ", list(list("UQS()")), "\n", list(), " ", #> list(list("dots_splice()")), ", ", list(list( #> "splice()")), "\n"), "\n")), "\n", "\n", #> list(list("Soft-deprecated functions and arguments"), #> list("\n", "\n", "\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", "\n", list("Soft-deprecated in rlang 0.4.0"), #> "\n", list("\n", list(), " ", list(list("exiting()")), #> ": Handlers are now treated as exiting by default.\n", #> list(), " ", list(list("invoke()")), ": Use the simpler ", #> list(list("exec()")), " instead.\n", list(), #> " ", list(list("as_logical()")), ", ", list( #> list("as_integer()")), ", etc. => ", list( #> "vctrs::vec_cast()"), ".\n", list(), " ", #> list(list("type_of()")), ", ", list(list( #> "switch_type()")), ", ", list(list("coerce_type()")), #> ", ", list(list("switch_class()")), ",\n", #> list(list("coerce_class()")), "\n"), "\n")), #> "\n", "\n", list(list("Deprecated functions and arguments"), #> list("\n", "\n", "\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", list("Bumped to deprecated in rlang 0.4.0"), #> "\n", list("\n", list(), " ", list(list("modify()")), #> " and ", list(list("prepend()")), ".\n", #> list(), " ", list("new_logical_along()"), #> ", ", list("new_integer_along()"), ",\n", #> list("new_double_along()"), ", ", list("new_complex_along()"), #> ",\n", list("new_character_along()"), ", ", #> list("new_raw_along()"), ", ", list("new_list_along()"), #> ".\n", list(), " ", list(list("lang_modify()")), #> " => ", list(list("call_modify()")), "\n", #> list(), " ", list(list("lang_standardise()")), #> " => ", list(list("call_standardise()")), #> "\n", list(), " ", list(list("lang_fn()")), #> " => ", list(list("call_fn()")), "\n", list(), #> " ", list(list("lang_name()")), " => ", list( #> list("call_name()")), "\n", list(), " ", #> list(list("lang_args()")), " => ", list(list( #> "call_args()")), "\n", list(), " ", list( #> list("lang_args_names()")), " => ", list( #> list("call_args_names()")), "\n", list(), #> " ", list(list("lang_head()")), ", ", list( #> list("lang_tail()")), "\n", list(), " ", #> list(list("lang()")), " => ", list(list("call2()")), #> "\n", list(), " ", list(list("new_language()")), #> " => ", list(list("new_call()")), "\n", list(), #> " ", list(list("is_lang()")), " => ", list( #> list("is_call()")), "\n", list(), " ", #> list(list("is_unary_lang()")), " => Use the ", #> list("n"), " argument of ", list(list("is_call()")), #> "\n", list(), " ", list(list("is_binary_lang()")), #> " => Use the ", list("n"), " argument of ", #> list(list("is_call()")), "\n", list(), " ", #> list(list("quo_is_lang()")), " => ", list( #> list("quo_is_call()")), "\n", list(), " ", #> list(list("call_modify()")), ": ", list(".standardise"), #> " and ", list(".env"), " arguments.\n", list(), #> " ", list(list("is_expr()")), " => ", list( #> list("is_expression()")), "\n", list(), #> " ", list("quo_expr()"), " => ", list(list( #> "quo_squash()")), "\n", list(), " ", list( #> list("parse_quosure()")), " => ", list( #> list("parse_quo()")), "\n", list(), " ", #> list(list("parse_quosures()")), " => ", list( #> list("parse_quos()")), "\n", list(), " Assigning non-quosure objects to quosure lists.\n", #> list(), " ", list("as.character()"), " on quosures.\n", #> list(), " ", list(list("cnd_signal()")), #> ": ", list(".cnd"), " => ", list("cnd"), #> "\n", list(), " ", list(list("cnd_signal()")), #> ": The ", list(".mufflable"), " argument no longer has any effect\n", #> list(), " ", list("scoped_names()"), " => ", #> list(list("base::search()")), "\n", list(), #> " ", list("is_scoped()"), " => ", list(list( #> "is_attached()")), "\n", list(), " ", list( #> "scoped_env()"), " => ", list(list("search_env()")), #> "\n", list(), " ", list("scoped_envs()"), #> " => ", list(list("search_envs()")), "\n", #> list(), " ", list("env_bind_exprs()"), " => ", #> list(list("env_bind_lazy()")), "\n", list(), #> " ", list("env_bind_fns()"), " => ", list( #> list("env_bind_active()")), "\n", list(), #> " Passing a function or formula to ", list( #> "env_depth()"), ",\n", list("env_poke_parent()"), #> ", ", list("env_parent<-"), ", ", list("env_tail()"), #> ", ", list("set_env()"), ",\n", list("env_clone()"), #> ", ", list("env_inherits()"), ", ", list( #> "env_bind()"), ",\n", list("scoped_bindings()"), #> ", ", list("with_bindings()"), ", ", list( #> "env_poke()"), ",\n", list("env_has()"), #> ", ", list("env_get()"), ", ", list("env_names()"), #> ", ", list("env_bind_exprs()"), " and\n", #> list("env_bind_fns()"), ". This internal genericity was causing confusion\n", #> "(see issue #427). You should now extract the environment\n", #> "separately before calling these functions.\n", #> list(), " ", list(list("get_env()")), ": The ", #> list("env"), " argument no longer has a default and must be supplied\n", #> list(), " ", list(list("is_frame()")), ", ", #> list(list("global_frame()")), ", ", list( #> list("current_frame()")), ",\n", list(list( #> "ctxt_frame()")), ", ", list(list("call_frame()")), #> ", ", list(list("frame_position()")), ",\n", #> list(list("caller_frame()")), "\n", list(), #> " ", list(list("ctxt_depth()")), ", ", list( #> list("call_depth()")), ", ", list(list( #> "ctxt_stack()")), ", ", list(list("call_stack()")), #> ",\n", list(list("stack_trim()")), "\n", #> list(), " ", list(list("set_attrs()")), ", ", #> list(list("mut_attrs()")), "\n", list(), #> " The ", list("width"), " and ", list("printer"), #> " arguments of ", list(list("exprs_auto_name()")), #> " and\n", list(list("quos_auto_name()")), #> " no longer have any effect. For the same\n", #> "reason, passing a width as ", list(".named"), #> " argument of dots collectors\n", "like ", #> list("quos()"), " is deprecated.\n", list(), #> " ", list("as_overscope()"), " => ", list( #> list("as_data_mask()")), "\n", list(), #> " ", list("new_overscope()"), " => ", list( #> list("new_data_mask()")), "\n", list(), #> " ", list("overscope_eval_next()"), " => ", #> list(list("eval_tidy()")), "\n", list(), #> " ", list("overscope_clean()"), "\n"), "\n")), #> "\n", "\n", list(list("Defunct functions and arguments"), #> list("\n", "\n", "\n", list("rlang:::lifecycle(\"defunct\")"), #> "\n", "\n", list("Defunct as of rlang 0.4.0"), #> "\n", list("\n", list(), " ", list("length()"), #> " and ", list("names()"), " on tidy eval ", #> list(".data"), " pronouns.\n", list(), " Supplying a named ", #> list("!!!"), " call.\n", list(), " ", list( #> list("as_data_mask()")), ": ", list("parent"), #> " argument\n", list(), " ", list(list("new_data_mask()")), #> ": ", list("parent"), " argument\n", list(), #> " ", list(list("env_tail()")), ": ", list( #> "sentinel"), " => ", list("last"), "\n", #> list(), " ", list(list("abort()")), ", ", #> list(list("warn()")), ", ", list(list("inform()")), #> ": ", list("msg"), ", ", list("type"), " => ", #> list(".msg"), ", ", list(".type"), "\n", #> list(), " ", list(list("abort()")), ", ", #> list(list("warn()")), ", ", list(list("inform()")), #> ", ", list(list("cnd()")), ", ", list(list( #> "error_cnd()")), ",\n", list(list("warning_cnd()")), #> ", ", list(list("message_cnd()")), ": ", #> list("call"), " argument.\n", list(), " ", #> list(list("is_character()")), ", ", list( #> list("is_string()")), ", and variants: The ", #> list("encoding"), "\n", "argument.\n"), "\n")), #> "\n", "\n", list(list("Archived"), list("\n", "\n", #> "\n", list("rlang:::lifecycle(\"archived\")"), #> "\n", "\n", "These functions were entirely removed from the package. You will\n", #> "find them in the commit history and previous releases.\n", #> "\n", list("Archived as of rlang 0.4.0"), "\n", #> list("\n", list(), " ", list("UQE()"), "\n", #> list(), " ", list("as_dictionary()"), ", ", #> list("is_dictionary()"), "\n", list(), " ", #> list("as_quosureish()"), ", ", list("is_quosureish()"), #> "\n", list(), " ", list("eval_tidy_()"), "\n", #> list(), " ", list("mut_utf8_locale()"), ", ", #> list("mut_latin1_locale()"), ", ", list("mut_mbcs_locale()"), #> "\n", list(), " ", list("set_chr_encoding()"), #> ", ", list("chr_encoding()"), ", ", list("set_str_encoding()"), #> ", ", list("str_encoding()"), "\n", list(), #> " ", list("as_native_character()"), ", ", list( #> "as_utf8_string()"), ", ", list("as_native_string()"), #> "\n", list(), " ", list("lang_type_of()"), #> ", ", list("switch_lang()"), ", ", list("coerce_lang()"), #> "\n"), "\n", "\n", list("Archived as of rlang 0.3.0:"), #> "\n", list("\n", list(), " ", list("cnd_inform()"), #> ", ", list("cnd_warn()"), " and ", list("cnd_abort()"), #> "\n", list(), " ", list("new_cnd()"), " => ", #> list(list("cnd()")), "\n", list(), " ", list( #> "cnd_message()"), " => ", list(list("message_cnd()")), #> "\n", list(), " ", list("cnd_warning()"), " => ", #> list(list("warning_cnd()")), "\n", list(), #> " ", list("cnd_error()"), " => ", list(list( #> "error_cnd()")), "\n", list(), " ", list( #> "rst_muffle()"), " => ", list(list("cnd_muffle()")), #> "\n", list(), " ", list("inplace()"), " => ", #> list(list("calling()")), ". The ", list("muffle"), #> " argument of ", list("inplace()"), "\n", "has not been implemented in ", #> list("calling()"), " and is now defunct.\n", #> list(), " ", list(list("cnd_signal()")), ": ", #> list(".msg"), " and ", list(".call"), ".\n", #> list(), " ", list(list("cnd()")), ", ", list( #> list("error_cnd()")), ", ", list(list("warning_cnd()")), #> " and ", list(list("message_cnd()")), ":\n", #> list(".msg"), " => ", list("message"), ".\n"), #> "\n")), "\n", "\n"), missing.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-na.R", #> "\n", list("data"), "\n", list("missing"), "\n", #> list("missing"), "\n", list("na_lgl"), "\n", list( #> "na_int"), "\n", list("na_dbl"), "\n", list("na_chr"), #> "\n", list("na_cpl"), "\n", list("Missing values"), #> "\n", list("An object of class ", list("logical"), #> " of length 1."), "\n", list("\n", "na_lgl\n", #> "\n", "na_int\n", "\n", "na_dbl\n", "\n", "na_chr\n", #> "\n", "na_cpl\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "Missing values are represented in R with the general symbol\n", #> list("NA"), ". They can be inserted in almost all data containers: all\n", #> "atomic vectors except raw vectors can contain missing values. To\n", #> "achieve this, R automatically converts the general ", #> list("NA"), " symbol to a\n", "typed missing value appropriate for the target vector. The objects\n", #> "provided here are aliases for those typed ", #> list("NA"), " objects.\n"), "\n", list("\n", #> "Typed missing values are necessary because R needs sentinel values\n", #> "of the same type (i.e. the same machine representation of the data)\n", #> "as the containers into which they are inserted. The official typed\n", #> "missing values are ", list("NA_integer_"), ", ", #> list("NA_real_"), ", ", list("NA_character_"), #> " and\n", list("NA_complex_"), ". The missing value for logical vectors is simply the\n", #> "default ", list("NA"), ". The aliases provided in rlang are consistently named\n", #> "and thus simpler to remember. Also, ", list( #> "na_lgl"), " is provided as an\n", "alias to ", #> list("NA"), " that makes intent clearer.\n", #> "\n", "Since ", list("na_lgl"), " is the default ", #> list("NA"), ", expressions such as ", list("c(NA, NA)"), #> "\n", "yield logical vectors as no data is available to give a clue of the\n", #> "target type. In the same way, since lists and environments can\n", #> "contain any types, expressions like ", list( #> "list(NA)"), " store a logical\n", list("NA"), #> ".\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "These shortcuts might be moved to the vctrs package at some\n", #> "point. This is why they are marked as questioning.\n")), #> "\n", "\n", list("\n", "typeof(NA)\n", "typeof(na_lgl)\n", #> "typeof(na_int)\n", "\n", "# Note that while the base R missing symbols cannot be overwritten,\n", #> "# that's not the case for rlang's aliases:\n", #> "na_dbl <- NA\n", "typeof(na_dbl)\n"), "\n", #> list("datasets"), "\n"), missing_arg.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/arg.R", "\n", #> list("missing_arg"), "\n", list("missing_arg"), "\n", #> list("is_missing"), "\n", list("maybe_missing"), #> "\n", list("Generate or handle a missing argument"), #> "\n", list("\n", "missing_arg()\n", "\n", "is_missing(x)\n", #> "\n", "maybe_missing(x, default = missing_arg())\n"), #> "\n", list("\n", list(list("x"), list("An object that might be the missing argument.")), #> "\n", "\n", list(list("default"), list("The object to return if the input is missing,\n", #> "defaults to ", list("missing_arg()"), ".")), #> "\n"), "\n", list("\n", "These functions help using the missing argument as a regular R\n", #> "object.\n", list("\n", list(), " ", list("missing_arg()"), #> " generates a missing argument.\n", list(), #> " ", list("is_missing()"), " is like ", list( #> list("base::missing()")), " but also supports\n", #> "testing for missing arguments contained in other objects like\n", #> "lists.\n", list(), " ", list("maybe_missing()"), #> " is useful to pass down an input that might be\n", #> "missing to another function, potentially substituting by a\n", #> "default value. It avoids triggering an \"argument is missing\" error.\n"), #> "\n"), "\n", list(list("Other ways to reify the missing argument"), #> list("\n", "\n", list("\n", list(), " ", list( #> "base::quote(expr = )"), " is the canonical way to create a missing\n", #> "argument object.\n", list(), " ", list("expr()"), #> " called without argument creates a missing argument.\n", #> list(), " ", list("quo()"), " called without argument creates an empty quosure, i.e. a\n", #> "quosure containing the missing argument object.\n"), #> "\n")), "\n", "\n", list(list("Fragility of the missing argument object"), #> list("\n", "\n", "\n", "The missing argument is an object that triggers an error if and\n", #> "only if it is the result of evaluating a symbol. No error is\n", #> "produced when a function call evaluates to the missing argument\n", #> "object. This means that expressions like ", #> list("x[[1]] <- missing_arg()"), "\n", "are perfectly safe. Likewise, ", #> list("x[[1]]"), " is safe even if the result\n", #> "is the missing object.\n", "\n", "However, as soon as the missing argument is passed down between\n", #> "functions through an argument, you're at risk of triggering a\n", #> "missing error. This is because arguments are passed through\n", #> "symbols. To work around this, ", list("is_missing()"), #> " and ", list("maybe_missing(x)"), "\n", "use a bit of magic to determine if the input is the missing\n", #> "argument without triggering a missing error.\n", #> "\n", list("maybe_missing()"), " is particularly useful for prototyping\n", #> "meta-programming algorithms in R. The missing argument is a likely\n", #> "input when computing on the language because it is a standard\n", #> "object in formals lists. While C functions are always allowed to\n", #> "return the missing argument and pass it to other C functions, this\n", #> "is not the case on the R side. If you're implementing your\n", #> "meta-programming algorithm in R, use ", list( #> "maybe_missing()"), " when an\n", "input might be the missing argument object.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> list("\n", list(), " ", list("missing_arg()"), #> " and ", list("is_missing()"), " are stable.\n", #> list(), " Like the rest of rlang, ", list("maybe_missing()"), #> " is maturing.\n"), "\n")), "\n", "\n", list( #> "\n", "# The missing argument usually arises inside a function when the\n", #> "# user omits an argument that does not have a default:\n", #> "fn <- function(x) is_missing(x)\n", "fn()\n", #> "\n", "# Creating a missing argument can also be useful to generate calls\n", #> "args <- list(1, missing_arg(), 3, missing_arg())\n", #> "quo(fn(!!! args))\n", "\n", "# Other ways to create that object include:\n", #> "quote(expr = )\n", "expr()\n", "\n", "# It is perfectly valid to generate and assign the missing\n", #> "# argument in a list.\n", "x <- missing_arg()\n", #> "l <- list(missing_arg())\n", "\n", "# Just don't evaluate a symbol that contains the empty argument.\n", #> "# Evaluating the object `x` that we created above would trigger an\n", #> "# error.\n", "# x # Not run\n", "\n", "# On the other hand accessing a missing argument contained in a\n", #> "# list does not trigger an error because subsetting is a function\n", #> "# call:\n", "l[[1]]\n", "is.null(l[[1]])\n", #> "\n", "# In case you really need to access a symbol that might contain the\n", #> "# empty argument object, use maybe_missing():\n", #> "maybe_missing(x)\n", "is.null(maybe_missing(x))\n", #> "is_missing(maybe_missing(x))\n", "\n", "\n", #> "# Note that base::missing() only works on symbols and does not\n", #> "# support complex expressions. For this reason the following lines\n", #> "# would throw an error:\n", "\n", "#> missing(missing_arg())\n", #> "#> missing(l[[1]])\n", "\n", "# while is_missing() will work as expected:\n", #> "is_missing(missing_arg())\n", "is_missing(l[[1]])\n"), #> "\n"), mut_node_car.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("mut_node_car"), "\n", list("mut_node_car"), #> "\n", list("mut_node_cdr"), "\n", list("mut_node_caar"), #> "\n", list("mut_node_cadr"), "\n", list("mut_node_cdar"), #> "\n", list("mut_node_cddr"), "\n", list("mut_node_tag"), #> "\n", list("Mutate node components"), "\n", list( #> "\n", "mut_node_car(x, newcar)\n", "\n", "mut_node_cdr(x, newcdr)\n", #> "\n", "mut_node_caar(x, newcar)\n", "\n", "mut_node_cadr(x, newcar)\n", #> "\n", "mut_node_cdar(x, newcdr)\n", "\n", "mut_node_cddr(x, newcdr)\n", #> "\n", "mut_node_tag(x, newtag)\n"), "\n", list( #> "\n", list(list("x"), list("A language or pairlist node. Note that these functions are\n", #> "barebones and do not perform any type checking.")), #> "\n", "\n", list(list("newcar"), list("The new CAR or CDR for the node. These\n", #> "can be any R objects.")), "\n", "\n", list( #> list("newcdr"), list("The new CAR or CDR for the node. These\n", #> "can be any R objects.")), "\n", "\n", list( #> list("newtag"), list("The new tag for the node. This should be a symbol.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions were deprecated and renamed with ", #> list("node_poke_"), "\n", "prefix in rlang 0.2.0. This change follows a new naming convention\n", #> "where mutation is referred to as \"poking\".\n"), #> "\n", list("internal"), "\n"), names2.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/attr.R", #> "\n", list("names2"), "\n", list("names2"), "\n", #> list("Get names of a vector"), "\n", list("\n", "names2(x)\n"), #> "\n", list("\n", list(list("x"), list("A vector.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", "This names getter always returns a character vector, even when an\n", #> "object does not have a ", list("names"), " attribute. In this case, it returns\n", #> "a vector of empty names ", list("\"\""), ". It also standardises missing names to\n", #> list("\"\""), ".\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", list("names2()"), " is stable.\n")), #> "\n", "\n", list("\n", "names2(letters)\n", "\n", #> "# It also takes care of standardising missing names:\n", #> "x <- set_names(1:3, c(\"a\", NA, \"b\"))\n", #> "names2(x)\n"), "\n"), `new-vector-along-retired.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("new-vector-along-retired"), "\n", list( #> "new-vector-along-retired"), "\n", list("new_logical_along"), #> "\n", list("new_integer_along"), "\n", list("new_double_along"), #> "\n", list("new_character_along"), "\n", list("new_complex_along"), #> "\n", list("new_raw_along"), "\n", list("new_list_along"), #> "\n", list("Create vectors matching the length of a given vector"), #> "\n", list("\n", "new_logical_along(x, names = base::names(x))\n", #> "\n", "new_integer_along(x, names = base::names(x))\n", #> "\n", "new_double_along(x, names = base::names(x))\n", #> "\n", "new_character_along(x, names = base::names(x))\n", #> "\n", "new_complex_along(x, names = base::names(x))\n", #> "\n", "new_raw_along(x, names = base::names(x))\n", #> "\n", "new_list_along(x, names = base::names(x))\n"), #> "\n", list("\n", list(list("x"), list("A vector.")), #> "\n", "\n", list(list("names"), list("Names for the new vector.")), #> "\n"), "\n", list("\n", "These functions are deprecated as of rlang 0.3.0 because they\n", #> "are longer to type than the equivalent ", list( #> list("rep_along()")), " or\n", list(list("rep_named()")), #> " calls without added clarity.\n"), "\n"), `new-vector.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/vec-new.R", "\n", #> list("new-vector"), "\n", list("new-vector"), "\n", #> list("new_logical"), "\n", list("new_integer"), "\n", #> list("new_double"), "\n", list("new_character"), #> "\n", list("new_complex"), "\n", list("new_raw"), #> "\n", list("new_list"), "\n", list("Create vectors matching a given length"), #> "\n", list("\n", "new_logical(n, names = NULL)\n", #> "\n", "new_integer(n, names = NULL)\n", "\n", #> "new_double(n, names = NULL)\n", "\n", "new_character(n, names = NULL)\n", #> "\n", "new_complex(n, names = NULL)\n", "\n", #> "new_raw(n, names = NULL)\n", "\n", "new_list(n, names = NULL)\n"), #> "\n", list("\n", list(list("n"), list("The vector length.")), #> "\n", "\n", list(list("names"), list("Names for the new vector.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "These functions construct vectors of a given length, with attributes\n", #> "specified via dots. Except for ", list("new_list()"), #> " and ", list("new_raw()"), ", the\n", "empty vectors are filled with typed ", #> list("missing"), " values. This is in\n", "contrast to the base function ", #> list(list("base::vector()")), " which creates\n", #> "zero-filled vectors.\n"), "\n", list(list("Lifecycle"), #> list("\n", "\n", "\n", "These functions are likely to be replaced by a vctrs equivalent in\n", #> "the future. They are in the questioning lifecycle stage.\n")), #> "\n", "\n", list("\n", "new_list(10)\n", "new_logical(10)\n"), #> "\n", list("\n", "rep_along\n"), "\n"), new_call.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/node.R", "\n", #> list("new_call"), "\n", list("new_call"), "\n", list( #> "Create a new call from components"), "\n", list( #> "\n", "new_call(car, cdr = NULL)\n"), "\n", list( #> "\n", list(list("car"), list("The head of the call. It should be a\n", #> list("callable"), " object: a symbol, call, or literal\n", #> "function.")), "\n", "\n", list(list("cdr"), #> list("The tail of the call, i.e. a ", list( #> "node list"), " of\n", "arguments.")), "\n"), #> "\n", list("\n", "Create a new call from components\n"), #> "\n", list("internal"), "\n"), new_formula.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/formula.R", "\n", #> list("new_formula"), "\n", list("new_formula"), "\n", #> list("Create a formula"), "\n", list("\n", "new_formula(lhs, rhs, env = caller_env())\n"), #> "\n", list("\n", list(list("lhs, rhs"), list("A call, name, or atomic vector.")), #> "\n", "\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "A formula object.\n"), #> "\n", list("\n", "Create a formula\n"), "\n", list( #> "\n", "new_formula(quote(a), quote(b))\n", "new_formula(NULL, quote(b))\n"), #> "\n", list("\n", list(list("new_quosure()")), "\n"), #> "\n"), new_function.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/fn.R", "\n", #> list("new_function"), "\n", list("new_function"), #> "\n", list("Create a function"), "\n", list("\n", #> "new_function(args, body, env = caller_env())\n"), #> "\n", list("\n", list(list("args"), list("A named list or pairlist of default arguments. Note\n", #> "that if you want arguments that don't have defaults, you'll need\n", #> "to use the special function ", list(list("pairlist2()")), #> ". If you need quoted\n", "defaults, use ", list( #> list("exprs()")), ".")), "\n", "\n", list(list( #> "body"), list("A language object representing the code inside the\n", #> "function. Usually this will be most easily generated with\n", #> list(list("base::quote()")))), "\n", "\n", list( #> list("env"), list("The parent environment of the function, defaults to the\n", #> "calling environment of ", list("new_function()"))), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", "This constructs a new function given its three components:\n", #> "list of arguments, body code and parent environment.\n"), #> "\n", list("\n", "f <- function() letters\n", "g <- new_function(NULL, quote(letters))\n", #> "identical(f, g)\n", "\n", "# Pass a list or pairlist of named arguments to create a function\n", #> "# with parameters. The name becomes the parameter name and the\n", #> "# argument the default value for this parameter:\n", #> "new_function(list(x = 10), quote(x))\n", "new_function(pairlist2(x = 10), quote(x))\n", #> "\n", "# Use `exprs()` to create quoted defaults. Compare:\n", #> "new_function(pairlist2(x = 5 + 5), quote(x))\n", #> "new_function(exprs(x = 5 + 5), quote(x))\n", #> "\n", "# Pass empty arguments to omit defaults. `list()` doesn't allow\n", #> "# empty arguments but `pairlist2()` does:\n", #> "new_function(pairlist2(x = , y = 5 + 5), quote(x + y))\n", #> "new_function(exprs(x = , y = 5 + 5), quote(x + y))\n"), #> "\n"), new_node.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/node.R", #> "\n", list("new_node"), "\n", list("new_node"), "\n", #> list("node_car"), "\n", list("node_cdr"), "\n", list( #> "node_caar"), "\n", list("node_cadr"), "\n", #> list("node_cdar"), "\n", list("node_cddr"), "\n", #> list("node_poke_car"), "\n", list("node_poke_cdr"), #> "\n", list("node_poke_caar"), "\n", list("node_poke_cadr"), #> "\n", list("node_poke_cdar"), "\n", list("node_poke_cddr"), #> "\n", list("node_tag"), "\n", list("node_poke_tag"), #> "\n", list("Helpers for pairlist and language nodes"), #> "\n", list("\n", "new_node(car, cdr = NULL)\n", "\n", #> "node_car(x)\n", "\n", "node_cdr(x)\n", "\n", #> "node_caar(x)\n", "\n", "node_cadr(x)\n", "\n", #> "node_cdar(x)\n", "\n", "node_cddr(x)\n", "\n", #> "node_poke_car(x, newcar)\n", "\n", "node_poke_cdr(x, newcdr)\n", #> "\n", "node_poke_caar(x, newcar)\n", "\n", "node_poke_cadr(x, newcar)\n", #> "\n", "node_poke_cdar(x, newcdr)\n", "\n", "node_poke_cddr(x, newcdr)\n", #> "\n", "node_tag(x)\n", "\n", "node_poke_tag(x, newtag)\n"), #> "\n", list("\n", list(list("car, newcar, cdr, newcdr"), #> list("The new CAR or CDR for the node. These\n", #> "can be any R objects.")), "\n", "\n", list( #> list("x"), list("A language or pairlist node. Note that these functions are\n", #> "barebones and do not perform any type checking.")), #> "\n", "\n", list(list("newtag"), list("The new tag for the node. This should be a symbol.")), #> "\n"), "\n", list("\n", "Setters like ", list( #> "node_poke_car()"), " invisibly return ", list( #> "x"), " modified\n", "in place. Getters return the requested node component.\n"), #> "\n", list("\n", list("Important"), ": These functions are for expert R programmers only.\n", #> "You should only use them if you feel comfortable manipulating low\n", #> "level R data structures at the C level. We export them at the R level\n", #> "in order to make it easy to prototype C code. They don't perform\n", #> "any type checking and can crash R very easily (try to take the CAR\n", #> "of an integer vector --- save any important objects beforehand!).\n"), #> "\n", list("\n", list(list("duplicate()")), " for creating copy-safe objects and\n", #> list(list("base::pairlist()")), " for an easier way of creating a linked list of\n", #> "nodes.\n"), "\n", list("internal"), "\n"), new_quosures.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "new_quosures"), "\n", list("new_quosures"), #> "\n", list("as_quosures"), "\n", list("is_quosures"), #> "\n", list("Create a list of quosures"), "\n", list( #> "\n", "new_quosures(x)\n", "\n", "as_quosures(x, env, named = FALSE)\n", #> "\n", "is_quosures(x)\n"), "\n", list("\n", list( #> list("x"), list("A list of quosures or objects to coerce to quosures.")), #> "\n", "\n", list(list("env"), list("The default environment for the new quosures.")), #> "\n", "\n", list(list("named"), list("Whether to name the list with ", #> list(list("quos_auto_name()")), ".")), "\n"), #> "\n", list("\n", "This small S3 class provides methods for ", #> list("["), " and ", list("c()"), " and ensures\n", #> "the following invariants:\n", list("\n", list(), #> " The list only contains quosures.\n", list(), #> " It is always named, possibly with a vector of empty strings.\n"), #> "\n", "\n", list("new_quosures()"), " takes a list of quosures and adds the ", #> list("quosures"), "\n", "class and a vector of empty names if needed. ", #> list("as_quosures()"), " calls\n", list(list( #> "as_quosure()")), " on all elements before creating the ", #> list("quosures"), "\n", "object.\n"), "\n"), #> new_weakref.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/weakref.R", #> "\n", list("new_weakref"), "\n", list("new_weakref"), #> "\n", list("Create a weak reference"), "\n", list( #> "\n", "new_weakref(key, value = NULL, finalizer = NULL, on_quit = FALSE)\n"), #> "\n", list("\n", list(list("key"), list("The key for the weak reference. Must be a reference object -- that\n", #> "is, an environment or external pointer.")), #> "\n", "\n", list(list("value"), list("The value for the weak reference. This can be ", #> list("NULL"), ", if you\n", "want to use the weak reference like a weak pointer.")), #> "\n", "\n", list(list("finalizer"), list("A function that is run after the key becomes unreachable.")), #> "\n", "\n", list(list("on_quit"), list("Should the finalizer be run when R exits?")), #> "\n"), "\n", list("\n", "A weak reference is a special R object which makes it possible to keep a\n", #> "reference to an object without preventing garbage collection of that object.\n", #> "It can also be used to keep data about an object without preventing GC of the\n", #> "object, similar to WeakMaps in JavaScript.\n", #> "\n", "Objects in R are considered ", list("reachable"), #> " if they can be accessed by following\n", "a chain of references, starting from a ", #> list("root node"), "; root nodes are\n", "specially-designated R objects, and include the global environment and base\n", #> "environment. As long as the key is reachable, the value will not be garbage\n", #> "collected. This is true even if the weak reference object becomes\n", #> "unreachable. The key effectively prevents the weak reference and its value\n", #> "from being collected, according to the following chain of ownership:\n", #> list("weakref <- key -> value"), ".\n", "\n", #> "When the key becomes unreachable, the key and value in the weak reference\n", #> "object are replaced by ", list("NULL"), ", and the finalizer is scheduled to execute.\n"), #> "\n", list("\n", "e <- env()\n", "\n", "# Create a weak reference to e\n", #> "w <- new_weakref(e, finalizer = function(e) message(\"finalized\"))\n", #> "\n", "# Get the key object from the weak reference\n", #> "identical(wref_key(w), e)\n", "\n", "# When the regular reference (the `e` binding) is removed and a GC occurs,\n", #> "# the weak reference will not keep the object alive.\n", #> "rm(e)\n", "gc()\n", "identical(wref_key(w), NULL)\n", #> "\n", "\n", "# A weak reference with a key and value. The value contains data about the\n", #> "# key.\n", "k <- env()\n", "v <- list(1, 2, 3)\n", #> "w <- new_weakref(k, v)\n", "\n", "identical(wref_key(w), k)\n", #> "identical(wref_value(w), v)\n", "\n", "# When v is removed, the weak ref keeps it alive because k is still reachable.\n", #> "rm(v)\n", "gc()\n", "identical(wref_value(w), list(1, 2, 3))\n", #> "\n", "# When k is removed, the weak ref does not keep k or v alive.\n", #> "rm(k)\n", "gc()\n", "identical(wref_key(w), NULL)\n", #> "identical(wref_value(w), NULL)\n"), "\n", list( #> "\n", list(list("is_weakref()")), ", ", list( #> list("wref_key()")), " and ", list(list("wref_value()")), #> ".\n"), "\n", list("experimental"), "\n"), ns_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-special.R", #> "\n", list("ns_env"), "\n", list("ns_env"), "\n", #> list("ns_imports_env"), "\n", list("ns_env_name"), #> "\n", list("Get the namespace of a package"), "\n", #> list("\n", "ns_env(x = caller_env())\n", "\n", "ns_imports_env(x = caller_env())\n", #> "\n", "ns_env_name(x = caller_env())\n"), "\n", #> list("\n", list(list("x"), list(list("\n", list(), #> " For ", list("ns_env()"), ", the name of a package or an environment as a\n", #> "string.\n", list("\n", list(), " An environment (the current environment by default).\n", #> list(), " A function.\n"), "\n", "\n", "In the latter two cases, the environment ancestry is searched for\n", #> "a namespace with ", list(list("base::topenv()")), #> ". If the environment doesn't\n", "inherit from a namespace, this is an error.\n"))), #> "\n", "\n", list(list("env"), list("A namespace environment.")), #> "\n"), "\n", list("\n", "Namespaces are the environment where all the functions of a package\n", #> "live. The parent environments of namespaces are the ", #> list("imports"), "\n", "environments, which contain all the functions imported from other\n", #> "packages.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "These functions are experimental and may not belong to the rlang\n", #> "package. Expect API changes.\n")), "\n", "\n", #> list("\n", list(list("pkg_env()")), "\n"), "\n", #> list("internal"), "\n"), `op-definition.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/operators.R", "\n", #> list("op-definition"), "\n", list("op-definition"), #> "\n", list("is_definition"), "\n", list("new_definition"), #> "\n", list("is_formulaish"), "\n", list("Definition operator"), #> "\n", list("\n", "is_definition(x)\n", "\n", "new_definition(lhs, rhs, env = caller_env())\n", #> "\n", "is_formulaish(x, scoped = NULL, lhs = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("lhs, rhs"), list("Expressions for the LHS and RHS of the definition.")), #> "\n", "\n", list(list("env"), list("The evaluation environment bundled with the definition.")), #> "\n"), "\n", list("\n", "The definition operator is typically used in DSL packages like\n", #> list("ggvis"), " and ", list("data.table"), ". It is also used in the tidyverse as a way\n", #> "of unquoting names (see ", list("quasiquotation"), #> ").\n", list("\n", list(), " ", list("is_definition()"), #> " returns ", list("TRUE"), " for calls to ", #> list(":="), ".\n", list(), " ", list("is_formulaish()"), #> " returns ", list("TRUE"), " for both formulas and\n", #> "colon-equals operators.\n"), "\n"), "\n", #> list("\n", "The recommended way to use it is to capture arguments as\n", #> "expressions or quosures. You can then give a special function\n", #> "definition for the ", list(":="), " symbol in an overscope. Note that if you\n", #> "capture dots with ", list(list("exprs()")), #> " or ", list(list("quos()")), ", you need to disable\n", #> "interpretation of ", list(":="), " by setting ", #> list(".unquote_names"), " to ", list("FALSE"), #> ".\n", "\n", "From rlang and data.table perspectives, this operator is not meant\n", #> "to be evaluated directly at top-level which is why the exported\n", #> "definitions issue an error.\n"), "\n", list( #> list("Life cycle"), list("\n", "\n", "\n", "These functions are experimental.\n")), #> "\n", "\n", list("\n", "\n", "# A predicate is provided to distinguish formulas from the\n", #> "# colon-equals operator:\n", "is_definition(quote(a := b))\n", #> "is_definition(a ~ b)\n", "\n", "\n", "# is_formulaish() tests for both definitions and formulas:\n", #> "is_formulaish(a ~ b)\n", "is_formulaish(quote(a := b))\n"), #> "\n", list("internal"), "\n"), `op-get-attr.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/operators.R", "\n", #> list("op-get-attr"), "\n", list("op-get-attr"), "\n", #> list("%@%"), "\n", list("%@%<-"), "\n", list("Infix attribute accessor and setter"), #> "\n", list("\n", "x %@% name\n", "\n", "x %@% name <- value\n"), #> "\n", list("\n", list(list("x"), list("Object")), #> "\n", "\n", list(list("name"), list("Attribute name")), #> "\n", "\n", list(list("value"), list("New value for attribute ", #> list("name"), ".")), "\n"), "\n", list("\n", #> "This operator extracts or sets attributes for regular objects and\n", #> "S4 fields for S4 objects.\n"), "\n", list("\n", #> "# Unlike `@`, this operator extracts attributes for any kind of\n", #> "# objects:\n", "factor(1:3) %@% \"levels\"\n", #> "mtcars %@% class\n", "\n", "mtcars %@% class <- NULL\n", #> "mtcars\n", "\n", "# It also works on S4 objects:\n", #> ".Person <- setClass(\"Person\", slots = c(name = \"character\", species = \"character\"))\n", #> "fievel <- .Person(name = \"Fievel\", species = \"mouse\")\n", #> "fievel %@% name\n"), "\n"), `op-na-default.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/operators.R", "\n", #> list("op-na-default"), "\n", list("op-na-default"), #> "\n", list("%|%"), "\n", list("Replace missing values"), #> "\n", list("\n", "x %|% y\n"), "\n", list("\n", list( #> list("x"), list("The original values.")), "\n", #> "\n", list(list("y"), list("The replacement values. Must be of length 1 or the same length as ", #> list("x"), ".")), "\n"), "\n", list("\n", "This infix function is similar to ", #> list("%||%"), " but is vectorised\n", "and provides a default value for missing elements. It is faster\n", #> "than using ", list(list("base::ifelse()")), #> " and does not perform type conversions.\n"), #> "\n", list("\n", "c(\"a\", \"b\", NA, \"c\") %|% \"default\"\n", #> "c(1L, NA, 3L, NA, NA) %|% (6L:10L)\n"), "\n", #> list("\n", list("op-null-default"), "\n"), "\n"), #> `op-null-default.Rd` = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/operators.R", #> "\n", list("op-null-default"), "\n", list("op-null-default"), #> "\n", list("%||%"), "\n", list("Default value for ", #> list("NULL")), "\n", list("\n", "x %||% y\n"), #> "\n", list("\n", list(list("x, y"), list("If ", list( #> "x"), " is NULL, will return ", list("y"), "; otherwise returns ", #> list("x"), ".")), "\n"), "\n", list("\n", "This infix function makes it easy to replace ", #> list("NULL"), "s with a default\n", "value. It's inspired by the way that Ruby's or operation (", #> list("||"), ")\n", "works.\n"), "\n", list("\n", #> "1 %||% 2\n", "NULL %||% 2\n"), "\n"), overscope_eval_next.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("overscope_eval_next"), "\n", list("overscope_eval_next"), #> "\n", list("Evaluate next quosure in a data mask"), #> "\n", list("\n", "overscope_eval_next(overscope, quo, env = base_env())\n"), #> "\n", list("\n", list(list("overscope"), list("A valid overscope containing bindings for ", #> list("~"), ",\n", list(".top_env"), " and ", #> list("_F"), " and whose parents contain overscoped bindings\n", #> "for tidy evaluation.")), "\n", "\n", list(list( #> "quo"), list("A quosure.")), "\n", "\n", list( #> list("env"), list("The lexical enclosure in case ", #> list("quo"), " is not a validly\n", "scoped quosure. This is the ", #> list("base environment"), " by\n", "default.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", list("overscope_eval_next()"), " is deprecated as of rlang 0.2.0. Please use\n", #> list("eval_tidy()"), " to which you can now supply an overscope.\n"), #> "\n", list("internal"), "\n"), pairlist2.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("pairlist2"), "\n", list("pairlist2"), "\n", #> list("Create pairlists with splicing support"), "\n", #> list("\n", "pairlist2(...)\n"), "\n", list("\n", #> list(list("..."), list("Arguments stored in the pairlist. Empty arguments are\n", #> "preserved.")), "\n"), "\n", list("\n", "This pairlist constructor supports ", #> list("tidy dots"), " features\n", "like ", list( #> "!!!"), ". Use it to manually create argument lists for calls or\n", #> "parameter lists for functions.\n"), "\n", list( #> "\n", "# Unlike `exprs()`, `pairlist2()` evaluates its arguments.\n", #> "new_function(pairlist2(x = 1, y = 3 * 6), quote(x * y))\n", #> "new_function(exprs(x = 1, y = 3 * 6), quote(x * y))\n", #> "\n", "# It preserves missing arguments, which is useful for creating\n", #> "# parameters without defaults:\n", "new_function(pairlist2(x = , y = 3 * 6), quote(x * y))\n"), #> "\n"), parse_expr.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/parse.R", #> "\n", list("parse_expr"), "\n", list("parse_expr"), #> "\n", list("parse_exprs"), "\n", list("parse_quo"), #> "\n", list("parse_quos"), "\n", list("Parse R code"), #> "\n", list("\n", "parse_expr(x)\n", "\n", "parse_exprs(x)\n", #> "\n", "parse_quo(x, env)\n", "\n", "parse_quos(x, env)\n"), #> "\n", list("\n", list(list("x"), list("Text containing expressions to parse_expr for\n", #> list("parse_expr()"), " and ", list("parse_exprs()"), #> ". Can also be an R connection,\n", "for instance to a file. If the supplied connection is not open,\n", #> "it will be automatically closed and destroyed.")), #> "\n", "\n", list(list("env"), list("The environment for the quosures. Depending on the use\n", #> "case, a good default might be the ", list( #> "global environment"), " but you might also want to evaluate the\n", #> "R code in an isolated context (perhaps a child of the global\n", #> "environment or of the ", list("base environment"), #> ").")), "\n"), "\n", list("\n", list("parse_expr()"), #> " returns an ", list("expression"), ",\n", list( #> "parse_exprs()"), " returns a list of expressions. Note that for the\n", #> "plural variants the length of the output may be greater than the\n", #> "length of the input. This would happen is one of the strings\n", #> "contain several expressions (such as ", list( #> "\"foo; bar\""), ").\n"), "\n", list("\n", #> "These functions parse and transform text into R expressions. This\n", #> "is the first step to interpret or evaluate a piece of R code\n", #> "written by a programmer.\n"), "\n", list("\n", #> list("parse_expr()"), " returns one expression. If the text contains more\n", #> "than one expression (separated by semicolons or new lines), an error is\n", #> "issued. On the other hand ", list("parse_exprs()"), #> " can handle multiple\n", "expressions. It always returns a list of expressions (compare to\n", #> list(list("base::parse()")), " which returns a base::expression vector). All\n", #> "functions also support R connections.\n", "\n", #> "The versions suffixed with ", list("_quo"), #> " and ", list("_quos"), " return\n", list("quosures"), #> " rather than raw expressions.\n"), "\n", list( #> list("Life cycle"), list("\n", "\n", list("\n", #> list(), " ", list("parse_quosure()"), " and ", #> list("parse_quosures()"), " were soft-deprecated in\n", #> "rlang 0.2.0 and renamed to ", list("parse_quo()"), #> " and ", list("parse_quos()"), ". This\n", #> "is consistent with the rule that abbreviated suffixes indicate\n", #> "the return type of a function.\n"), "\n")), #> "\n", "\n", list("\n", "# parse_expr() can parse any R expression:\n", #> "parse_expr(\"mtcars %>% dplyr::mutate(cyl_prime = cyl / sd(cyl))\")\n", #> "\n", "# A string can contain several expressions separated by ; or \\n\n", #> "parse_exprs(\"NULL; list()\\n foo(bar)\")\n", #> "\n", "# You can also parse source files by passing a R connection. Let's\n", #> "# create a file containing R code:\n", "path <- tempfile(\"my-file.R\")\n", #> "cat(\"1; 2; mtcars\", file = path)\n", "\n", #> "# We can now parse it by supplying a connection:\n", #> "parse_exprs(file(path))\n"), "\n", list("\n", #> list(list("base::parse()")), "\n"), "\n"), parse_quosure.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("parse_quosure"), "\n", list("parse_quosure"), #> "\n", list("parse_quosures"), "\n", list("Parse text into a quosure"), #> "\n", list("\n", "parse_quosure(x, env = caller_env())\n", #> "\n", "parse_quosures(x, env = caller_env())\n"), #> "\n", list("\n", list(list("x"), list("Text containing expressions to parse_expr for\n", #> list("parse_expr()"), " and ", list("parse_exprs()"), #> ". Can also be an R connection,\n", "for instance to a file. If the supplied connection is not open,\n", #> "it will be automatically closed and destroyed.")), #> "\n", "\n", list(list("env"), list("The environment for the quosures. Depending on the use\n", #> "case, a good default might be the ", list( #> "global environment"), " but you might also want to evaluate the\n", #> "R code in an isolated context (perhaps a child of the global\n", #> "environment or of the ", list("base environment"), #> ").")), "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions were deprecated and renamed to ", #> list(list("parse_quo()")), "\n", "and ", list( #> list("parse_quos()")), " in rlang 0.2.0. This is for consistency with the\n", #> "convention that suffixes indicating return types are not\n", #> "abbreviated.\n"), "\n", list("internal"), "\n"), #> prepend.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("prepend"), "\n", list("prepend"), "\n", #> list("modify"), "\n", list("Prepend a vector"), "\n", #> list("\n", "prepend(x, values, before = 1)\n", "\n", #> "modify(.x, ...)\n"), "\n", list("\n", list(list( #> "x"), list("the vector to be modified.")), "\n", #> "\n", list(list("values"), list("to be included in the modified vector.")), #> "\n", "\n", list(list("before"), list("a subscript, before which the values are to be appended.")), #> "\n", "\n", list(list(".x"), list("A vector to modify.")), #> "\n", "\n", list(list("..."), list("List of elements to merge into ", #> list(".x"), ". Named elements\n", "already existing in ", #> list(".x"), " are used as replacements. Elements that\n", #> "have new or no names are inserted at the end. These dots support\n", #> list("tidy dots"), " features.")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "Vector functions are now out of scope for rlang. They might be\n", #> "revived in the vctrs or funs packages.\n"), #> "\n", list("internal"), "\n"), prim_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list( #> "prim_name"), "\n", list("prim_name"), "\n", #> list("Name of a primitive function"), "\n", list( #> "\n", "prim_name(prim)\n"), "\n", list("\n", #> list(list("prim"), list("A primitive function such as ", #> list(list("base::c()")), ".")), "\n"), "\n", #> list("\n", "Name of a primitive function\n"), "\n"), #> quasiquotation.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/quasiquotation.R", #> "\n", list("quasiquotation"), "\n", list("quasiquotation"), #> "\n", list("UQ"), "\n", list("UQS"), "\n", list("!!"), #> "\n", list("!!!"), "\n", list(":="), "\n", list("qq_show"), #> "\n", list("Quasiquotation of an expression"), "\n", #> list("\n", "qq_show(expr)\n"), "\n", list("\n", list( #> list("expr"), list("An expression to be quasiquoted.")), #> "\n"), "\n", list("\n", "Quasiquotation is the mechanism that makes it possible to program\n", #> "flexibly with tidy evaluation grammars like dplyr. It is enabled in\n", #> "all functions quoting their arguments with ", #> list("enquo()"), ", ", list("enexpr()"), ",\n", #> "or the plural variants.\n", "\n", "Quasiquotation is the combination of quoting an expression while\n", #> "allowing immediate evaluation (unquoting) of part of that\n", #> "expression. We provide both syntactic operators and functional\n", #> "forms for unquoting.\n", list("\n", list(), #> " The ", list("!!"), " operator unquotes its argument. It gets evaluated\n", #> "immediately in the surrounding context.\n", #> list(), " The ", list("!!!"), " operator unquotes and splices its argument. The\n", #> "argument should represent a list or a vector. Each element will\n", #> "be embedded in the surrounding call, i.e. each element is\n", #> "inserted as an argument. If the vector is named, the names are\n", #> "used as argument names.\n", "\n", "If the vector is a classed object (like a factor), it is\n", #> "converted to a list with ", list(list("base::as.list()")), #> " to ensure proper\n", "dispatch. If it is an S4 objects, it is converted to a list with\n", #> list(list("methods::as()")), ".\n", list(), #> " The ", list("{{ }}"), " operator quotes and unquotes its argument in one\n", #> "go, a pattern that we call ", list("interpolation"), #> ". It is an alias for\n", list("!!enquo(arg)"), #> ".\n", "\n", "Like ", list("enquo()"), ", ", #> list("{{ }}"), " is used in functions to capture an\n", #> "argument as a quoted expression. This expression is immediately\n", #> "unquoted in place.\n"), "\n", "\n", "Use ", #> list("qq_show()"), " to experiment with quasiquotation or debug the\n", #> "effect of unquoting operators. ", list("qq_show()"), #> " quotes its input,\n", "processes unquoted parts, and prints the result with\n", #> list(list("expr_print()")), ". This expression printer has a clearer output than\n", #> "the base R printer (see the ", list("documentation topic"), #> ").\n"), "\n", list(list("Unquoting names"), #> list("\n", "\n", "\n", "When a function takes multiple named arguments\n", #> "(e.g. ", list("dplyr::mutate()"), "), it is difficult to supply a variable as\n", #> "name. Since the LHS of ", list("="), " is quoted, giving the name of a variable\n", #> "results in the argument having the name of the variable rather than\n", #> "the name stored in that variable. This problem is right up the\n", #> "alley for the unquoting operator ", list("!!"), #> ". If you were able to unquote\n", "the variable when supplying the name, the argument would be named\n", #> "after the content of that variable.\n", "\n", #> "Unfortunately R is very strict about the kind of expressions\n", #> "supported on the LHS of ", list("="), ". This is why we have made the more\n", #> "flexible ", list(":="), " operator an alias of ", #> list("="), ". You can use it to supply\n", #> "names, e.g. ", list("a := b"), " is equivalent to ", #> list("a = b"), ". Since its syntax is\n", "more flexible you can unquote on the LHS:", #> list("name <- \"Jane\"\n", "\n", "list2(!!name := 1 + 2)\n", #> "exprs(!!name := 1 + 2)\n", "quos(!!name := 1 + 2)\n"), #> "\n", "\n", "Like ", list("="), ", the ", list( #> ":="), " operator expects strings or symbols on its LHS.\n", #> "\n", "Note that unquoting on the LHS of ", #> list(":="), " only works in top level\n", "expressions. These are all valid:", #> list("exprs(!!nm := x)\n", "tibble(!!nm := x)\n", #> "list2(!!nm := x)\n"), "\n", "\n", "But deep-unquoting names isn't supported:", #> list("expr(foo(!!nm := x))\n", "exprs(foo(!!nm := x))\n"), #> "\n")), "\n", "\n", list(list("Theory"), list( #> "\n", "\n", "\n", "Formally, ", list("quo()"), #> " and ", list("expr()"), " are quasiquote functions, ", #> list("!!"), " is\n", "the unquote operator, and ", #> list("!!!"), " is the unquote-splice operator.\n", #> "These terms have a rich history in Lisp languages, and live on in\n", #> "modern languages like\n", list(list("https://docs.julialang.org/en/v1/manual/metaprogramming/"), #> list("Julia")), "\n", "and\n", list(list("https://docs.racket-lang.org/reference/quasiquote.html"), #> list("Racket")), ".\n")), "\n", "\n", list( #> list("Life cycle"), list("\n", "\n", list("\n", #> list(), " Calling ", list("UQ()"), " and ", #> list("UQS()"), " with the rlang namespace qualifier is\n", #> "deprecated as of rlang 0.3.0. Just use the unqualified forms\n", #> "instead:", list("# Bad\n", "rlang::expr(mean(rlang::UQ(var) * 100))\n", #> "\n", "# Ok\n", "rlang::expr(mean(UQ(var) * 100))\n", #> "\n", "# Good\n", "rlang::expr(mean(!!var * 100))\n"), #> "\n", "\n", "Supporting namespace qualifiers complicates the implementation of\n", #> "unquotation and is misleading as to the nature of unquoting\n", #> "operators (which are syntactic operators that operates at\n", #> "quotation-time rather than function calls at evaluation-time).\n", #> list(), " ", list("UQ()"), " and ", list("UQS()"), #> " were soft-deprecated in rlang 0.2.0 in order\n", #> "to make the syntax of quasiquotation more consistent. The prefix\n", #> "forms are now ", list("`!!`()"), " and ", #> list("`!!!`()"), " which is\n", "consistent with other R operators (e.g. ", #> list("`+`(a, b)"), " is the\n", "prefix form of ", #> list("a + b"), ").\n", "\n", "Note that the prefix forms are not as relevant as before because\n", #> list("!!"), " now has the right operator precedence, i.e. the same as\n", #> "unary ", list("-"), " or ", list("+"), ". It is thus safe to mingle it with other\n", #> "operators, e.g. ", list("!!a + !!b"), " does the right thing. In addition the\n", #> "parser now strips one level of parentheses around unquoted\n", #> "expressions. This way ", list("(!!\"foo\")(...)"), #> " expands to ", list("foo(...)"), ".\n", "These changes make the prefix forms less useful.\n", #> "\n", "Finally, the named functional forms ", #> list("UQ()"), " and ", list("UQS()"), " were\n", #> "misleading because they suggested that existing knowledge about\n", #> "functions is applicable to quasiquotation. This was reinforced by\n", #> "the visible definitions of these functions exported by rlang and\n", #> "by the tidy eval parser interpreting ", list( #> "rlang::UQ()"), " as ", list("!!"), ". In\n", #> "reality unquoting is ", list("not"), " a function call, it is a syntactic\n", #> "operation. The operator form makes it clearer that unquoting is\n", #> "special.\n"), "\n")), "\n", "\n", list("\n", #> "# Interpolation with {{ }} is the easiest way to forward\n", #> "# arguments to tidy eval functions:\n", "if (is_attached(\"package:dplyr\")) {\n", #> "\n", "# Forward all arguments involving data frame columns by\n", #> "# interpolating them within other data masked arguments.\n", #> "# Here we interpolate `arg` in a `summarise()` call:\n", #> "my_function <- function(data, arg) {\n", " summarise(data, avg = mean({{ arg }}, na.rm = TRUE))\n", #> "}\n", "\n", "my_function(mtcars, cyl)\n", "my_function(mtcars, cyl * 10)\n", #> "\n", "# The operator is just a shortcut for `!!enquo()`:\n", #> "my_function <- function(data, arg) {\n", " summarise(data, avg = mean(!!enquo(arg), na.rm = TRUE))\n", #> "}\n", "\n", "my_function(mtcars, cyl)\n", "\n", #> "}\n", "\n", "# Quasiquotation functions quote expressions like base::quote()\n", #> "quote(how_many(this))\n", "expr(how_many(this))\n", #> "quo(how_many(this))\n", "\n", "# In addition, they support unquoting. Let's store symbols\n", #> "# (i.e. object names) in variables:\n", "this <- sym(\"apples\")\n", #> "that <- sym(\"oranges\")\n", "\n", "# With unquotation you can insert the contents of these variables\n", #> "# inside the quoted expression:\n", "expr(how_many(!!this))\n", #> "expr(how_many(!!that))\n", "\n", "# You can also insert values:\n", #> "expr(how_many(!!(1 + 2)))\n", "quo(how_many(!!(1 + 2)))\n", #> "\n", "\n", "# Note that when you unquote complex objects into an expression,\n", #> "# the base R printer may be a bit misleading. For instance compare\n", #> "# the output of `expr()` and `quo()` (which uses a custom printer)\n", #> "# when we unquote an integer vector:\n", "expr(how_many(!!(1:10)))\n", #> "quo(how_many(!!(1:10)))\n", "\n", "# This is why it's often useful to use qq_show() to examine the\n", #> "# result of unquotation operators. It uses the same printer as\n", #> "# quosures but does not return anything:\n", #> "qq_show(how_many(!!(1:10)))\n", "\n", "\n", #> "# Use `!!!` to add multiple arguments to a function. Its argument\n", #> "# should evaluate to a list or vector:\n", "args <- list(1:3, na.rm = TRUE)\n", #> "quo(mean(!!!args))\n", "\n", "# You can combine the two\n", #> "var <- quote(xyz)\n", "extra_args <- list(trim = 0.9, na.rm = TRUE)\n", #> "quo(mean(!!var , !!!extra_args))\n", "\n", "\n", #> "# The plural versions have support for the `:=` operator.\n", #> "# Like `=`, `:=` creates named arguments:\n", #> "quos(mouse1 := bernard, mouse2 = bianca)\n", #> "\n", "# The `:=` is mainly useful to unquote names. Unlike `=` it\n", #> "# supports `!!` on its LHS:\n", "var <- \"unquote me!\"\n", #> "quos(!!var := bernard, mouse2 = bianca)\n", #> "\n", "\n", "# All these features apply to dots captured by enquos():\n", #> "fn <- function(...) enquos(...)\n", "fn(!!!args, !!var := penny)\n", #> "\n", "\n", "# Unquoting is especially useful for building an expression by\n", #> "# expanding around a variable part (the unquoted part):\n", #> "quo1 <- quo(toupper(foo))\n", "quo1\n", "\n", #> "quo2 <- quo(paste(!!quo1, bar))\n", "quo2\n", #> "\n", "quo3 <- quo(list(!!quo2, !!!syms(letters[1:5])))\n", #> "quo3\n"), "\n"), quo_expr.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("quo_expr"), "\n", list("quo_expr"), "\n", #> list("Squash a quosure"), "\n", list("\n", "quo_expr(quo, warn = FALSE)\n"), #> "\n", list("\n", list(list("quo"), list("A quosure or expression.")), #> "\n", "\n", list(list("warn"), list("Whether to warn if the quosure contains other quosures\n", #> "(those will be collapsed). This is useful when you use\n", #> list("quo_squash()"), " in order to make a non-tidyeval API compatible\n", #> "with quosures. In that case, getting rid of the nested quosures\n", #> "is likely to cause subtle bugs and it is good practice to warn\n", #> "the user about it.")), "\n"), "\n", list("\n", #> list("rlang:::lifecycle(\"deprecated\")"), "\n", #> "\n", "This function is deprecated, please use ", #> list(list("quo_squash()")), " instead.\n"), "\n", #> list("internal"), "\n"), quo_label.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/quo.R", "\n", #> list("quo_label"), "\n", list("quo_label"), "\n", #> list("quo_text"), "\n", list("quo_name"), "\n", list( #> "Format quosures for printing or labelling"), #> "\n", list("\n", "quo_label(quo)\n", "\n", "quo_text(quo, width = 60L, nlines = Inf)\n", #> "\n", "quo_name(quo)\n"), "\n", list("\n", list( #> list("quo"), list("A quosure or expression.")), #> "\n", "\n", list(list("width"), list("Width of each line.")), #> "\n", "\n", list(list("nlines"), list("Maximum number of lines to extract.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("Note:"), " You should now use ", #> list(list("as_label()")), " or ", list(list("as_name()")), #> " instead\n", "of ", list("quo_name()"), ". See life cycle section below.\n", #> "\n", "These functions take an arbitrary R object, typically an\n", #> list("expression"), ", and represent it as a string.\n", #> list("\n", list(), " ", list("quo_name()"), " returns an abbreviated representation of the object\n", #> "as a single line string. It is suitable for default names.\n", #> list(), " ", list("quo_text()"), " returns a multiline string. For instance block\n", #> "expressions like ", list("{ foo; bar }"), #> " are represented on 4 lines (one\n", "for each symbol, and the curly braces on their own lines).\n"), #> "\n", "\n", "These deparsers are only suitable for creating default names or\n", #> "printing output at the console. The behaviour of your functions\n", #> "should not depend on deparsed objects. If you are looking for a way\n", #> "of transforming symbols to strings, use ", list( #> list("as_string()")), " instead of\n", list( #> "quo_name()"), ". Unlike deparsing, the transformation between symbols\n", #> "and strings is non-lossy and well defined.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "These functions are in the questioning life cycle stage.\n", #> list("\n", list(), " ", list(list("as_label()")), #> " and ", list(list("as_name()")), " should be used instead of\n", #> list("quo_name()"), ". ", list("as_label()"), #> " transforms any R object to a string\n", "but should only be used to create a default name. Labelisation is\n", #> "not a well defined operation and no assumption should be made\n", #> "about the label. On the other hand, ", list( #> "as_name()"), " only works with\n", "(possibly quosured) symbols, but is a well defined and\n", #> "deterministic operation.\n", list(), " We don't have a good replacement for ", #> list("quo_text()"), " yet. See\n", list("https://github.com/r-lib/rlang/issues/636"), #> " to follow discussions\n", "about a new deparsing API.\n"), #> "\n")), "\n", "\n", list("\n", "# Quosures can contain nested quosures:\n", #> "quo <- quo(foo(!! quo(bar)))\n", "quo\n", "\n", #> "# quo_squash() unwraps all quosures and returns a raw expression:\n", #> "quo_squash(quo)\n", "\n", "# This is used by quo_text() and quo_label():\n", #> "quo_text(quo)\n", "\n", "# Compare to the unwrapped expression:\n", #> "expr_text(quo)\n", "\n", "# quo_name() is helpful when you need really short labels:\n", #> "quo_name(quo(sym))\n", "quo_name(quo(!! sym))\n"), #> "\n", list("\n", list(list("expr_label()")), ", ", #> list(list("f_label()")), "\n"), "\n"), quo_squash.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "quo_squash"), "\n", list("quo_squash"), "\n", #> list("Squash a quosure"), "\n", list("\n", "quo_squash(quo, warn = FALSE)\n"), #> "\n", list("\n", list(list("quo"), list("A quosure or expression.")), #> "\n", "\n", list(list("warn"), list("Whether to warn if the quosure contains other quosures\n", #> "(those will be collapsed). This is useful when you use\n", #> list("quo_squash()"), " in order to make a non-tidyeval API compatible\n", #> "with quosures. In that case, getting rid of the nested quosures\n", #> "is likely to cause subtle bugs and it is good practice to warn\n", #> "the user about it.")), "\n"), "\n", list("\n", #> list("quo_squash()"), " flattens all nested quosures within an expression.\n", #> "For example it transforms ", list("^foo(^bar(), ^baz)"), #> " to the bare\n", "expression ", list("foo(bar(), baz)"), #> ".\n", "\n", "This operation is safe if the squashed quosure is used for\n", #> "labelling or printing (see ", list(list("quo_label()")), #> " or ", list(list("quo_name()")), "). However\n", #> "if the squashed quosure is evaluated, all expressions of the\n", #> "flattened quosures are resolved in a single environment. This is a\n", #> "source of bugs so it is good practice to set ", #> list("warn"), " to ", list("TRUE"), " to\n", #> "let the user know about the lossy squashing.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "This function replaces ", list("quo_expr()"), #> " which was deprecated in\n", "rlang 0.2.0. ", #> list("quo_expr()"), " was a misnomer because it implied that it\n", #> "was a mere expression acccessor for quosures whereas it was really\n", #> "a lossy operation that squashed all nested quosures.\n")), #> "\n", "\n", list("\n", "# Quosures can contain nested quosures:\n", #> "quo <- quo(wrapper(!!quo(wrappee)))\n", "quo\n", #> "\n", "# quo_squash() flattens all the quosures and returns a simple expression:\n", #> "quo_squash(quo)\n"), "\n"), quosure.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "quosure"), "\n", list("quosure"), "\n", list( #> "is_quosure"), "\n", list("quo_is_missing"), #> "\n", list("quo_is_symbol"), "\n", list("quo_is_call"), #> "\n", list("quo_is_symbolic"), "\n", list("quo_is_null"), #> "\n", list("quo_get_expr"), "\n", list("quo_get_env"), #> "\n", list("quo_set_expr"), "\n", list("quo_set_env"), #> "\n", list("Quosure getters, setters and testers"), #> "\n", list("\n", "is_quosure(x)\n", "\n", "quo_is_missing(quo)\n", #> "\n", "quo_is_symbol(quo, name = NULL)\n", "\n", #> "quo_is_call(quo, name = NULL, n = NULL, ns = NULL)\n", #> "\n", "quo_is_symbolic(quo)\n", "\n", "quo_is_null(quo)\n", #> "\n", "quo_get_expr(quo)\n", "\n", "quo_get_env(quo)\n", #> "\n", "quo_set_expr(quo, expr)\n", "\n", "quo_set_env(quo, env)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("quo"), list("A quosure to test.")), #> "\n", "\n", list(list("name"), list("The name of the symbol or function call. If ", #> list("NULL"), " the\n", "name is not tested.")), #> "\n", "\n", list(list("n"), list("An optional number of arguments that the call should\n", #> "match.")), "\n", "\n", list(list("ns"), list( #> "The namespace of the call. If ", list("NULL"), #> ", the namespace\n", "doesn't participate in the pattern-matching. If an empty string\n", #> list("\"\""), " and ", list("x"), " is a namespaced call, ", #> list("is_call()"), " returns\n", list("FALSE"), #> ". If any other string, ", list("is_call()"), #> " checks that ", list("x"), " is\n", "namespaced within ", #> list("ns"), ".\n", "\n", "Can be a character vector of namespaces, in which case the call\n", #> "has to match at least one of them, otherwise ", #> list("is_call()"), " returns\n", list("FALSE"), #> ".")), "\n", "\n", list(list("expr"), list( #> "A new expression for the quosure.")), "\n", #> "\n", list(list("env"), list("A new environment for the quosure.")), #> "\n"), "\n", list("\n", "A quosure is a type of ", #> list("quoted expression"), " that includes\n", #> "a reference to the context where it was created. A quosure is thus\n", #> "guaranteed to evaluate in its original environment and can refer to\n", #> "local objects.\n", "\n", "You can access the quosure components (its expression and its\n", #> "environment) with:\n", list("\n", list(), " ", #> list(list("get_expr()")), " and ", list(list( #> "get_env()")), ". These getters also support other\n", #> "kinds of objects such as formulas.\n", list(), #> " ", list("quo_get_expr()"), " and ", list( #> "quo_get_env()"), ". These getters only work\n", #> "with quosures and throw an error with other types of input.\n"), #> "\n", "\n", "Test if an object is a quosure with ", #> list("is_quosure()"), ". If you know an\n", "object is a quosure, use the ", #> list("quo_"), " prefixed predicates to check\n", #> "its contents, ", list("quo_is_missing()"), ", ", #> list("quo_is_symbol()"), ", etc.\n"), "\n", list( #> list("Quosured constants"), list("\n", "\n", #> "\n", "A quosure usually does not carry environments for ", #> list("constant objects"), " like strings or numbers. ", #> list(list("quo()")), " and\n", list(list("enquo()")), #> " only capture an environment for ", list("symbolic expressions"), #> ". For instance, all of these return the\n", #> list("empty environment"), ":", list("quo_get_env(quo(\"constant\"))\n", #> "quo_get_env(quo(100))\n", "quo_get_env(quo(NA))\n"), #> "\n", "\n", "On the other hand, quosures capture the environment of symbolic\n", #> "expressions, i.e. expressions whose meaning depends on the\n", #> "environment in which they are evaluated and what objects are\n", #> "defined there:", list("quo_get_env(quo(some_object))\n", #> "quo_get_env(quo(some_function()))\n"), "\n")), #> "\n", "\n", list(list("Empty quosures"), list("\n", #> "\n", "\n", "When missing arguments are captured as quosures, either through\n", #> list(list("enquo()")), " or ", list(list("quos()")), #> ", they are returned as an empty quosure. These\n", #> "quosures contain the ", list("missing argument"), #> " and typically\n", "have the ", list("empty environment"), #> " as enclosure.\n")), "\n", "\n", list(list("Life cycle"), #> list("\n", "\n", list("\n", list(), " ", list( #> "is_quosure()"), " is stable.\n", list(), " ", #> list("quo_get_expr()"), " and ", list("quo_get_env()"), #> " are stable.\n"), "\n")), "\n", "\n", list( #> "\n", "quo <- quo(my_quosure)\n", "quo\n", "\n", #> "\n", "# Access and set the components of a quosure:\n", #> "quo_get_expr(quo)\n", "quo_get_env(quo)\n", #> "\n", "quo <- quo_set_expr(quo, quote(baz))\n", #> "quo <- quo_set_env(quo, empty_env())\n", "quo\n", #> "\n", "# Test wether an object is a quosure:\n", #> "is_quosure(quo)\n", "\n", "# If it is a quosure, you can use the specialised type predicates\n", #> "# to check what is inside it:\n", "quo_is_symbol(quo)\n", #> "quo_is_call(quo)\n", "quo_is_null(quo)\n", "\n", #> "# quo_is_missing() checks for a special kind of quosure, the one\n", #> "# that contains the missing argument:\n", "quo()\n", #> "quo_is_missing(quo())\n", "\n", "fn <- function(arg) enquo(arg)\n", #> "fn()\n", "quo_is_missing(fn())\n"), "\n", list( #> "\n", list(list("quo()")), " for creating quosures by quotation; ", #> list(list("as_quosure()")), "\n", "and ", list( #> list("new_quosure()")), " for constructing quosures manually.\n"), #> "\n"), quotation.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/quotation.R", #> "\n", list("quotation"), "\n", list("quotation"), #> "\n", list("expr"), "\n", list("enexpr"), "\n", list( #> "exprs"), "\n", list("enexprs"), "\n", list("ensym"), #> "\n", list("ensyms"), "\n", list("quo"), "\n", list( #> "enquo"), "\n", list("quos"), "\n", list("enquos"), #> "\n", list("Quotation"), "\n", list("\n", "expr(expr)\n", #> "\n", "enexpr(arg)\n", "\n", "exprs(..., .named = FALSE, .ignore_empty = c(\"trailing\", \"none\",\n", #> " \"all\"), .unquote_names = TRUE)\n", "\n", #> "enexprs(..., .named = FALSE, .ignore_empty = c(\"trailing\", \"none\",\n", #> " \"all\"), .unquote_names = TRUE, .homonyms = c(\"keep\", \"first\", \"last\",\n", #> " \"error\"), .check_assign = FALSE)\n", "\n", #> "ensym(arg)\n", "\n", "ensyms(..., .named = FALSE, .ignore_empty = c(\"trailing\", \"none\",\n", #> " \"all\"), .unquote_names = TRUE, .homonyms = c(\"keep\", \"first\", \"last\",\n", #> " \"error\"), .check_assign = FALSE)\n", "\n", #> "quo(expr)\n", "\n", "enquo(arg)\n", "\n", "quos(..., .named = FALSE, .ignore_empty = c(\"trailing\", \"none\", \"all\"),\n", #> " .unquote_names = TRUE)\n", "\n", "enquos(..., .named = FALSE, .ignore_empty = c(\"trailing\", \"none\",\n", #> " \"all\"), .unquote_names = TRUE, .homonyms = c(\"keep\", \"first\", \"last\",\n", #> " \"error\"), .check_assign = FALSE)\n"), "\n", #> list("\n", list(list("expr"), list("An expression.")), #> "\n", "\n", list(list("arg"), list("A symbol representing an argument. The expression\n", #> "supplied to that argument will be captured instead of being\n", #> "evaluated.")), "\n", "\n", list(list("..."), #> list("For ", list("enexprs()"), ", ", list( #> "ensyms()"), " and ", list("enquos()"), ", names of\n", #> "arguments to capture without evaluation (including ", #> list("..."), "). For\n", list("exprs()"), #> " and ", list("quos()"), ", the expressions to capture unevaluated\n", #> "(including expressions contained in ", list( #> "..."), ").")), "\n", "\n", list(list(".named"), #> list("Whether to ensure all dots are named. Unnamed\n", #> "elements are processed with ", list(list( #> "quo_name()")), " to build a default\n", #> "name. See also ", list(list("quos_auto_name()")), #> ".")), "\n", "\n", list(list(".ignore_empty"), #> list("Whether to ignore empty arguments. Can be one\n", #> "of ", list("\"trailing\""), ", ", list("\"none\""), #> ", ", list("\"all\""), ". If ", list("\"trailing\""), #> ", only the\n", "last argument is ignored if it is empty. Note that ", #> list("\"trailing\""), "\n", "applies only to arguments passed in ", #> list("..."), ", not to named\n", "arguments. On the other hand, ", #> list("\"all\""), " also applies to named\n", #> "arguments.")), "\n", "\n", list(list(".unquote_names"), #> list("Whether to treat ", list(":="), " as ", #> list("="), ". Unlike ", list("="), ", the\n", #> list(":="), " syntax supports ", list("!!"), #> " unquoting on the LHS.")), "\n", "\n", list( #> list(".homonyms"), list("How to treat arguments with the same name. The\n", #> "default, ", list("\"keep\""), ", preserves these arguments. Set ", #> list(".homonyms"), " to\n", list("\"first\""), #> " to only keep the first occurrences, to ", #> list("\"last\""), " to keep\n", "the last occurrences, and to ", #> list("\"error\""), " to raise an informative\n", #> "error and indicate what arguments have duplicated names.")), #> "\n", "\n", list(list(".check_assign"), list( #> "Whether to check for ", list("<-"), " calls passed in\n", #> "dots. When ", list("TRUE"), " and a ", list( #> "<-"), " call is detected, a warning is\n", #> "issued to advise users to use ", list("="), #> " if they meant to match a\n", "function parameter, or wrap the ", #> list("<-"), " call in braces otherwise.\n", #> "This ensures assignments are explicit.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", "Quotation is a mechanism by which an expression supplied as\n", #> "argument is captured by a function. Instead of seeing the value of\n", #> "the argument, the function sees the recipe (the R code) to make\n", #> "that value. This is possible because R ", list( #> "expressions"), " are\n", "representable as regular objects in R:\n", #> list("\n", list(), " Calls represent the action of calling a function to\n", #> "compute a new value. Evaluating a call causes that value to be\n", #> "computed. Calls typically involve symbols to reference R objects.\n", #> list(), " Symbols represent the name that is given to an object in a\n", #> "particular context (an ", list("environment"), #> ").\n"), "\n", "\n", "We call objects containing calls and symbols ", #> list("expressions"), ".\n", "There are two ways to create R expressions. First you can ", #> list("build"), "\n", "calls and symbols from parts and pieces (see ", #> list(list("sym()")), ", ", list(list("syms()")), #> " and\n", list(list("call2()")), "). The other way is by ", #> list("quotation"), " or ", list("quasiquotation"), #> ",\n", "i.e. by intercepting an expression instead of evaluating it.\n"), #> "\n", list(list("User expressions versus your expressions"), #> list("\n", "\n", "\n", "There are two points of view when it comes to capturing an\n", #> "expression:\n", list("\n", list(), " You can capture the expressions supplied by ", #> list("the user"), " of your\n", "function. This is the purpose of ", #> list("ensym()"), ", ", list("enexpr()"), #> " and\n", list("enquo()"), " and their plural variants. These functions take an\n", #> "argument name and capture the expression that was supplied to\n", #> "that argument.\n", list(), " You can capture the expressions that ", #> list("you"), " supply. To this end\n", "use ", #> list("expr()"), " and ", list("quo()"), " and their plural variants ", #> list("exprs()"), " and\n", list("quos()"), #> ".\n"), "\n")), "\n", "\n", list(list("Capture raw expressions"), #> list("\n", "\n", list("\n", list(), " ", list( #> "enexpr()"), " and ", list("expr()"), " capture a single raw expression.\n", #> list(), " ", list("enexprs()"), " and ", list( #> "exprs()"), " capture a list of raw expressions\n", #> "including expressions contained in ", list( #> "..."), ".\n", list(), " ", list("ensym()"), #> " and ", list("ensyms()"), " are variants of ", #> list("enexpr()"), " and\n", list("enexprs()"), #> " that check the captured expression is either a string\n", #> "(which they convert to symbol) or a symbol. If anything else\n", #> "is supplied they throw an error.\n"), "\n", #> "\n", "In terms of base functions, ", list( #> "enexpr(arg)"), " corresponds to\n", list( #> "base::substitute(arg)"), " (though that function also features complex\n", #> "substitution semantics) and ", list("expr()"), #> " is like ", list(list("quote()")), " (and\n", #> list(list("bquote()")), " if we consider unquotation syntax). The plural variant\n", #> list("exprs()"), " is equivalent to ", list( #> list("base::alist()")), ". Finally there is no\n", #> "function in base R that is equivalent to ", #> list("enexprs()"), " but you can\n", "reproduce its behaviour with ", #> list("eval(substitute(alist(...)))"), ".\n")), #> "\n", "\n", list(list("Capture expressions in quosures"), #> list("\n", "\n", "\n", list("quo()"), " and ", #> list("enquo()"), " are similar to their ", #> list("expr"), " counterparts but\n", "capture both the expression and its environment in an object called\n", #> "a quosure. This wrapper contains a reference to the original\n", #> "environment in which that expression was captured. Keeping track of\n", #> "the environments of expressions is important because this is where\n", #> "functions and objects mentioned in the expression are defined.\n", #> "\n", "Quosures are objects that can be evaluated with ", #> list(list("eval_tidy()")), " just\n", "like symbols or function calls. Since they always evaluate in their\n", #> "original environment, quosures can be seen as vehicles that allow\n", #> "expressions to travel from function to function but that beam back\n", #> "instantly to their original environment upon evaluation.\n", #> "\n", "See the ", list("quosure"), " help topic about tools to work with quosures.\n")), #> "\n", "\n", list(list("Quasiquotation"), list("\n", #> "\n", "\n", "All quotation functions in rlang have support for ", #> list("unquoting operators"), ". The combination of quotation and\n", #> "unquotation is called ", list("quasiquotation"), #> ".\n", "\n", "Unquotation provides a way to refer to variables during quotation.\n", #> "Variables are problematic when quoting because a captured\n", #> "expression is essentially a constant, just like a string is a\n", #> "constant. For instance in all the following cases ", #> list("apple"), " is a\n", "constant: ", list( #> "~apple"), ", ", list("\"apple\""), " and ", #> list("expr(apple)"), ". Unquoting allows\n", #> "you to introduce a part of variability within a captured\n", #> "expression.\n", list("\n", list(), " In the case of ", #> list("enexpr()"), " and ", list("enquo()"), #> ", unquoting provides an\n", "escape hatch to the users of your function that allows them to\n", #> "manipulate the expression that you capture.\n", #> list(), " In the case of ", list("expr()"), #> " and ", list("quo()"), ", quasiquotation lets you\n", #> "build a complex expressions where some parts are constant (the\n", #> "parts that are captured) and some parts are variable (the parts\n", #> "that are unquoted).\n"), "\n", "\n", "See the ", #> list("quasiquotation"), " help topic for more about this as well as\n", #> list(list("https://adv-r.hadley.nz/quasiquotation.html"), #> list("the chapter in Advanced R")), ".\n")), #> "\n", "\n", list("\n", "# expr() and exprs() capture expressions that you supply:\n", #> "expr(symbol)\n", "exprs(several, such, symbols)\n", #> "\n", "# enexpr() and enexprs() capture expressions that your user supplied:\n", #> "expr_inputs <- function(arg, ...) {\n", " user_exprs <- enexprs(arg, ...)\n", #> " user_exprs\n", "}\n", "expr_inputs(hello)\n", #> "expr_inputs(hello, bonjour, ciao)\n", "\n", #> "# ensym() and ensyms() provide additional type checking to ensure\n", #> "# the user calling your function has supplied bare object names:\n", #> "sym_inputs <- function(...) {\n", " user_symbols <- ensyms(...)\n", #> " user_symbols\n", "}\n", "sym_inputs(hello, \"bonjour\")\n", #> "## sym_inputs(say(hello)) # Error: Must supply symbols or strings\n", #> "expr_inputs(say(hello))\n", "\n", "\n", "# All these quoting functions have quasiquotation support. This\n", #> "# means that you can unquote (evaluate and inline) part of the\n", #> "# captured expression:\n", "what <- sym(\"bonjour\")\n", #> "expr(say(what))\n", "expr(say(!!what))\n", "\n", #> "# This also applies to expressions supplied by the user. This is\n", #> "# like an escape hatch that allows control over the captured\n", #> "# expression:\n", "expr_inputs(say(!!what), !!what)\n", #> "\n", "\n", "# Finally, you can capture expressions as quosures. A quosure is an\n", #> "# object that contains both the expression and its environment:\n", #> "quo <- quo(letters)\n", "quo\n", "\n", "get_expr(quo)\n", #> "get_env(quo)\n", "\n", "# Quosures can be evaluated with eval_tidy():\n", #> "eval_tidy(quo)\n", "\n", "# They have the nice property that you can pass them around from\n", #> "# context to context (that is, from function to function) and they\n", #> "# still evaluate in their original environment:\n", #> "multiply_expr_by_10 <- function(expr) {\n", #> " # We capture the user expression and its environment:\n", #> " expr <- enquo(expr)\n", "\n", " # Then create an object that only exists in this function:\n", #> " local_ten <- 10\n", "\n", " # Now let's create a multiplication expression that (a) inlines\n", #> " # the user expression as LHS (still wrapped in its quosure) and\n", #> " # (b) refers to the local object in the RHS:\n", #> " quo(!!expr * local_ten)\n", "}\n", "quo <- multiply_expr_by_10(2 + 3)\n", #> "\n", "# The local parts of the quosure are printed in colour if your\n", #> "# terminal is capable of displaying colours:\n", #> "quo\n", "\n", "# All the quosures in the expression evaluate in their original\n", #> "# context. The local objects are looked up properly and we get the\n", #> "# expected result:\n", "eval_tidy(quo)\n"), #> "\n"), rep_along.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-new.R", #> "\n", list("rep_along"), "\n", list("rep_along"), #> "\n", list("rep_named"), "\n", list("Create vectors matching the length of a given vector"), #> "\n", list("\n", "rep_along(along, x)\n", "\n", "rep_named(names, x)\n"), #> "\n", list("\n", list(list("along"), list("Vector whose length determine how many times ", #> list("x"), "\n", "is repeated.")), "\n", "\n", #> list(list("x"), list("Values to repeat.")), "\n", #> "\n", list(list("names"), list("Names for the new vector. The length of ", #> list("names"), "\n", "determines how many times ", #> list("x"), " is repeated.")), "\n"), "\n", #> list("\n", "These functions take the idea of ", list( #> list("seq_along()")), " and apply it to\n", "repeating values.\n"), #> "\n", list("\n", "x <- 0:5\n", "rep_along(x, 1:2)\n", #> "rep_along(x, 1)\n", "\n", "# Create fresh vectors by repeating missing values:\n", #> "rep_along(x, na_int)\n", "rep_along(x, na_chr)\n", #> "\n", "# rep_named() repeats a value along a names vectors\n", #> "rep_named(c(\"foo\", \"bar\"), list(letters))\n"), #> "\n", list("\n", "new-vector\n"), "\n"), restarting.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-handlers.R", #> "\n", list("restarting"), "\n", list("restarting"), #> "\n", list("Create a restarting handler"), "\n", #> list("\n", "restarting(.restart, ..., .fields = NULL)\n"), #> "\n", list("\n", list(list(".restart"), list("The name of a restart.")), #> "\n", "\n", list(list("..."), list("Additional arguments passed on the restart\n", #> "function. These arguments are evaluated only once and\n", #> "immediately, when creating the restarting handler. Furthermore,\n", #> "they support ", list("tidy dots"), " features.")), #> "\n", "\n", list(list(".fields"), list("A character vector specifying the fields of the\n", #> "condition that should be passed as arguments to the restart. If\n", #> "named, the names (except empty names ", list( #> "\"\""), ") are used as\n", "argument names for calling the restart function. Otherwise the\n", #> "the fields themselves are used as argument names.")), #> "\n"), "\n", list("\n", "This constructor automates the common task of creating an\n", #> list(list("calling()")), " handler that invokes a restart.\n"), #> "\n", list("\n", "Jumping to a restart point from a calling handler has two\n", #> "effects. First, the control flow jumps to wherever the restart was\n", #> "established, and the restart function is called (with ", #> list("..."), ", or\n", list(".fields"), " as arguments). Execution resumes from the\n", #> list(list("with_restarts()")), " call. Secondly, the transfer of the control flow\n", #> "out of the function that signalled the condition means that the\n", #> "handler has dealt with the condition. Thus the condition will not\n", #> "be passed on to other potential handlers established on the stack.\n"), #> "\n", list("\n", "# This is a restart that takes a data frame and names as arguments\n", #> "rst_bar <- function(df, nms) {\n", " stats::setNames(df, nms)\n", #> "}\n", "\n", "# This restart is simpler and does not take arguments\n", #> "rst_baz <- function() \"baz\"\n", "\n", "# Signalling a condition parameterised with a data frame\n", #> "fn <- function() {\n", " with_restarts(signal(\"A foobar condition occurred\", \"foo\", foo_field = mtcars),\n", #> " rst_bar = rst_bar,\n", " rst_baz = rst_baz\n", #> " )\n", "}\n", "\n", "# Creating a restarting handler that passes arguments `nms` and\n", #> "# `df`, the latter taken from a data field of the condition object\n", #> "restart_bar <- restarting(\"rst_bar\",\n", " nms = LETTERS[1:11], .fields = c(df = \"foo_field\")\n", #> ")\n", "\n", "# The restarting handlers jumps to `rst_bar` when `foo` is signalled:\n", #> "with_handlers(fn(), foo = restart_bar)\n", "\n", #> "# The restarting() constructor is especially nice to use with\n", #> "# restarts that do not need arguments:\n", "with_handlers(fn(), foo = restarting(\"rst_baz\"))\n"), #> "\n", list("\n", list(list("calling()")), " and ", #> list(list("exiting()")), ".\n"), "\n"), return_from.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/stack.R", "\n", #> list("return_from"), "\n", list("return_from"), "\n", #> list("return_to"), "\n", list("Jump to or from a frame"), #> "\n", list("\n", "return_from(frame, value = NULL)\n", #> "\n", "return_to(frame, value = NULL)\n"), "\n", #> list("\n", list(list("frame"), list("An environment, a frame object, or any object with an\n", #> list(list("get_env()")), " method. The environment should be an evaluation\n", #> "environment currently on the stack.")), "\n", #> "\n", list(list("value"), list("The return value.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "While ", list(list("base::return()")), #> " can only return from the current local\n", #> "frame, these two functions will return from any frame on the\n", #> "current evaluation stack, between the global and the currently\n", #> "active context. They provide a way of performing arbitrary\n", #> "non-local jumps out of the function currently under evaluation.\n"), #> "\n", list("\n", list("return_from()"), " will jump out of ", #> list("frame"), ". ", list("return_to()"), " is a bit\n", #> "trickier. It will jump out of the frame located just before ", #> list("frame"), "\n", "in the evaluation stack, so that control flow ends up in ", #> list("frame"), ",\n", "at the location where the previous frame was called from.\n", #> "\n", "These functions should only be used rarely. These sort of non-local\n", #> "gotos can be hard to reason about in casual code, though they can\n", #> "sometimes be useful. Also, consider to use the condition system to\n", #> "perform non-local jumps.\n"), "\n", list(list( #> "Life cycle"), list("\n", "\n", "\n", "The support for ", #> list("frame"), " object is soft-deprecated. Please pass\n", #> "simple environments to ", list("return_from()"), #> " and ", list("return_to()"), ".\n", "\n", "These functions are in the questioning lifecycle because we are\n", #> "considering simpler alternatives.\n")), "\n", #> "\n", list("\n", "# Passing fn() evaluation frame to g():\n", #> "fn <- function() {\n", " val <- g(current_env())\n", #> " cat(\"g returned:\", val, \"\\n\")\n", " \"normal return\"\n", #> "}\n", "g <- function(env) h(env)\n", "\n", "# Here we return from fn() with a new return value:\n", #> "h <- function(env) return_from(env, \"early return\")\n", #> "fn()\n", "\n", "# Here we return to fn(). The call stack unwinds until the last frame\n", #> "# called by fn(), which is g() in that case.\n", #> "h <- function(env) return_to(env, \"early return\")\n", #> "fn()\n"), "\n"), rlang_backtrace_on_error.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-abort.R", "\n", #> list("rlang_backtrace_on_error"), "\n", list("rlang_backtrace_on_error"), #> "\n", list("add_backtrace"), "\n", list("Display backtrace on error"), #> "\n", list("\n", "Errors thrown with ", list(list( #> "abort()")), " automatically save a backtrace that\n", #> "can be inspected by calling ", list(list("last_error()")), #> ". Optionally, you can\n", "also display the backtrace alongside the error message by setting\n", #> "the option ", list("rlang_backtrace_on_error"), #> " to one of the following\n", "values:\n", list( #> "\n", list(), " ", list("\"reminder\""), ": Display a reminder that the backtrace can be\n", #> "inspected by calling ", list(list("rlang::last_error()")), #> ".\n", list(), " ", list("\"branch\""), ": Display a simplified backtrace.\n", #> list(), " ", list("\"collapse\""), ": Display a collapsed backtrace tree.\n", #> list(), " ", list("\"full\""), ": Display the full backtrace tree.\n"), #> "\n"), "\n", list(list("Promote base errors to rlang errors"), #> list("\n", "\n", "\n", "Call ", list("options(error = rlang::enframe)"), #> " to instrument base\n", "errors with rlang features. This handler does two things:\n", #> list("\n", list(), " It saves the base error as an rlang object. This allows you to\n", #> "call ", list(list("last_error()")), " to print the backtrace or inspect its data.\n", #> list(), " It prints the backtrace for the current error according to the\n", #> list(list("rlang_backtrace_on_error")), " option.\n"), #> "\n")), "\n", "\n", list("\n", "# Display a simplified backtrace on error for both base and rlang\n", #> "# errors:\n", "\n", "# options(\n", "# rlang_backtrace_on_error = \"branch\",\n", #> "# error = rlang::enframe\n", "# )\n", "# stop(\"foo\")\n"), #> "\n"), rst_abort.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-restarts.R", #> "\n", list("rst_abort"), "\n", list("rst_abort"), #> "\n", list("Jump to the abort restart"), "\n", list( #> "\n", "rst_abort()\n"), "\n", list("\n", list( #> "rlang:::lifecycle(\"questioning\")"), "\n", #> "\n", "The abort restart is the only restart that is established at top\n", #> "level. It is used by R as a top-level target, most notably when an\n", #> "error is issued (see ", list(list("abort()")), #> ") that no handler is able\n", "to deal with (see ", #> list(list("with_handlers()")), ").\n"), "\n", #> list(list("Life cycle"), list("\n", "\n", "\n", "All the restart functions are in the questioning stage. It is not\n", #> "clear yet whether we want to recommend restarts as a style of\n", #> "programming in R.\n")), "\n", "\n", list("\n", #> "# The `abort` restart is a bit special in that it is always\n", #> "# registered in a R session. You will always find it on the restart\n", #> "# stack because it is established at top level:\n", #> "rst_list()\n", "\n", "# You can use the `above` restart to jump to top level without\n", #> "# signalling an error:\n", list("\n", "fn <- function() {\n", #> " cat(\"aborting...\\n\")\n", " rst_abort()\n", #> " cat(\"This is never called\\n\")\n", "}\n", #> "{\n", " fn()\n", " cat(\"This is never called\\n\")\n", #> "}\n"), "\n", "\n", "# The `above` restart is the target that R uses to jump to top\n", #> "# level when critical errors are signalled:\n", #> list("\n", "{\n", " abort(\"error\")\n", " cat(\"This is never called\\n\")\n", #> "}\n"), "\n", "\n", "# If another `abort` restart is specified, errors are signalled as\n", #> "# usual but then control flow resumes with from the new restart:\n", #> list("\n", "out <- NULL\n", "{\n", " out <- with_restarts(abort(\"error\"), abort = function() \"restart!\")\n", #> " cat(\"This is called\\n\")\n", "}\n", "cat(\"`out` has now become:\", out, \"\\n\")\n"), #> "\n"), "\n", list("\n", list(list("rst_jump()")), #> ", ", list(list("abort()")), "\n"), "\n"), rst_list.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-restarts.R", #> "\n", list("rst_list"), "\n", list("rst_list"), "\n", #> list("rst_exists"), "\n", list("rst_jump"), "\n", #> list("rst_maybe_jump"), "\n", list("Restarts utilities"), #> "\n", list("\n", "rst_list()\n", "\n", "rst_exists(.restart)\n", #> "\n", "rst_jump(.restart, ...)\n", "\n", "rst_maybe_jump(.restart, ...)\n"), #> "\n", list("\n", list(list(".restart"), list("The name of a restart.")), #> "\n", "\n", list(list("..."), list("Arguments passed on to the restart function. These\n", #> "dots support ", list("tidy dots"), " features.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "Restarts are named jumping points established by ", #> list(list("with_restarts()")), ".\n", list("rst_list()"), #> " returns the names of all restarts currently\n", #> "established. ", list("rst_exists()"), " checks if a given restart is\n", #> "established. ", list("rst_jump()"), " stops execution of the current function\n", #> "and jumps to a restart point. If the restart does not exist, an\n", #> "error is thrown. ", list("rst_maybe_jump()"), #> " first checks that a restart\n", "exists before jumping.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "All the restart functions are in the questioning stage. It is not\n", #> "clear yet whether we want to recommend restarts as a style of\n", #> "programming in R.\n")), "\n", "\n", list("\n", #> list(list("with_restarts()")), "\n"), "\n"), #> `scalar-type-predicates.Rd` = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/types.R", #> "\n", list("scalar-type-predicates"), "\n", list( #> "scalar-type-predicates"), "\n", list("is_scalar_list"), #> "\n", list("is_scalar_atomic"), "\n", list("is_scalar_vector"), #> "\n", list("is_scalar_integer"), "\n", list("is_scalar_double"), #> "\n", list("is_scalar_character"), "\n", list("is_scalar_logical"), #> "\n", list("is_scalar_raw"), "\n", list("is_string"), #> "\n", list("is_scalar_bytes"), "\n", list("is_bool"), #> "\n", list("Scalar type predicates"), "\n", list( #> "\n", "is_scalar_list(x)\n", "\n", "is_scalar_atomic(x)\n", #> "\n", "is_scalar_vector(x)\n", "\n", "is_scalar_integer(x)\n", #> "\n", "is_scalar_double(x)\n", "\n", "is_scalar_character(x, encoding = NULL)\n", #> "\n", "is_scalar_logical(x)\n", "\n", "is_scalar_raw(x)\n", #> "\n", "is_string(x, string = NULL)\n", "\n", #> "is_scalar_bytes(x)\n", "\n", "is_bool(x)\n"), #> "\n", list("\n", list(list("x"), list("object to be tested.")), #> "\n", "\n", list(list("encoding"), list("Defunct as of rlang 0.4.0.")), #> "\n", "\n", list(list("string"), list("A string to compare to ", #> list("x"), ". If a character vector,\n", "returns ", #> list("TRUE"), " if at least one element is equal to ", #> list("x"), ".")), "\n"), "\n", list("\n", "These predicates check for a given type and whether the vector is\n", #> "\"scalar\", that is, of length 1.\n", "\n", #> "In addition to the length check, ", list("is_string()"), #> " and ", list("is_bool()"), "\n", "return ", #> list("FALSE"), " if their input is missing. This is useful for\n", #> "type-checking arguments, when your function expects a single string\n", #> "or a single ", list("TRUE"), " or ", list("FALSE"), #> ".\n"), "\n", list("\n", list("type-predicates"), #> ", ", list("bare-type-predicates"), "\n"), "\n"), #> scoped_bindings.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-binding.R", #> "\n", list("scoped_bindings"), "\n", list("scoped_bindings"), #> "\n", list("with_bindings"), "\n", list("Temporarily change bindings of an environment"), #> "\n", list("\n", "scoped_bindings(..., .env = .frame, .frame = caller_env())\n", #> "\n", "with_bindings(.expr, ..., .env = caller_env())\n"), #> "\n", list("\n", list(list("..."), list("Pairs of names and values. These dots support splicing\n", #> "(with value semantics) and name unquoting.")), #> "\n", "\n", list(list(".env"), list("An environment.")), #> "\n", "\n", list(list(".frame"), list("The frame environment that determines the scope of\n", #> "the temporary bindings. When that frame is popped from the call\n", #> "stack, bindings are switched back to their original values.")), #> "\n", "\n", list(list(".expr"), list("An expression to evaluate with temporary bindings.")), #> "\n"), "\n", list("\n", list("scoped_bindings()"), #> " returns the values of old bindings\n", "invisibly; ", #> list("with_bindings()"), " returns the value of ", #> list("expr"), ".\n"), "\n", list("\n", list("\n", #> list(), " ", list("scoped_bindings()"), " temporarily changes bindings in ", #> list(".env"), " (which\n", "is by default the caller environment). The bindings are reset to\n", #> "their original values when the current frame (or an arbitrary one\n", #> "if you specify ", list(".frame"), ") goes out of scope.\n", #> list(), " ", list("with_bindings()"), " evaluates ", #> list("expr"), " with temporary bindings. When\n", #> list("with_bindings()"), " returns, bindings are reset to their original\n", #> "values. It is a simple wrapper around ", list( #> "scoped_bindings()"), ".\n"), "\n"), "\n", #> list("\n", "foo <- \"foo\"\n", "bar <- \"bar\"\n", #> "\n", "# `foo` will be temporarily rebinded while executing `expr`\n", #> "with_bindings(paste(foo, bar), foo = \"rebinded\")\n", #> "paste(foo, bar)\n"), "\n"), scoped_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("scoped_env"), "\n", list("scoped_env"), #> "\n", list("is_scoped"), "\n", list("scoped_envs"), #> "\n", list("scoped_names"), "\n", list("Retired ", #> list("scoped"), " functions"), "\n", list("\n", #> "scoped_env(nm)\n", "\n", "is_scoped(nm)\n", #> "\n", "scoped_envs()\n", "\n", "scoped_names()\n"), #> "\n", list("\n", list(list("nm"), list("The name of an environment attached to the search\n", #> "path. Call ", list(list("base::search()")), #> " to see what is currently on the path.")), "\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions are deprecated as of rlang 0.3.0. They are replaced\n", #> "by ", list(list("is_attached()")), ", ...\n"), #> "\n", list("internal"), "\n"), scoped_options.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/state.R", "\n", #> list("scoped_options"), "\n", list("scoped_options"), #> "\n", list("with_options"), "\n", list("push_options"), #> "\n", list("peek_options"), "\n", list("peek_option"), #> "\n", list("Change global options"), "\n", list("\n", #> "scoped_options(..., .frame = caller_env())\n", #> "\n", "with_options(.expr, ...)\n", "\n", "push_options(...)\n", #> "\n", "peek_options(...)\n", "\n", "peek_option(name)\n"), #> "\n", list("\n", list(list("..."), list("For ", list( #> "scoped_options()"), " and ", list("push_options()"), #> ", named\n", "values defining new option values. For ", #> list("peek_options()"), ", strings\n", "or character vectors of option names.")), #> "\n", "\n", list(list(".frame"), list("The environment of a stack frame which defines the\n", #> "scope of the temporary options. When the frame returns, the\n", #> "options are set back to their original values.")), #> "\n", "\n", list(list(".expr"), list("An expression to evaluate with temporary options.")), #> "\n", "\n", list(list("name"), list("An option name as string.")), #> "\n"), "\n", list("\n", "For ", list("scoped_options()"), #> " and ", list("push_options()"), ", the old option\n", #> "values. ", list("peek_option()"), " returns the current value of an option\n", #> "while the plural ", list("peek_options()"), #> " returns a list of current\n", "option values.\n"), #> "\n", list("\n", list("\n", list(), " ", list("scoped_options()"), #> " changes options for the duration of a stack\n", #> "frame (by default the current one). Options are set back to their\n", #> "old values when the frame returns.\n", list(), #> " ", list("with_options()"), " changes options while an expression is\n", #> "evaluated. Options are restored when the expression returns.\n", #> list(), " ", list("push_options()"), " adds or changes options permanently.\n", #> list(), " ", list("peek_option()"), " and ", #> list("peek_options()"), " return option values. The\n", #> "former returns the option directly while the latter returns a\n", #> "list.\n"), "\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "These functions are experimental.\n")), #> "\n", "\n", list("\n", "# Store and retrieve a global option:\n", #> "push_options(my_option = 10)\n", "peek_option(\"my_option\")\n", #> "\n", "# Change the option temporarily:\n", "with_options(my_option = 100, peek_option(\"my_option\"))\n", #> "peek_option(\"my_option\")\n", "\n", "# The scoped variant is useful within functions:\n", #> "fn <- function() {\n", " scoped_options(my_option = 100)\n", #> " peek_option(\"my_option\")\n", "}\n", "fn()\n", #> "peek_option(\"my_option\")\n", "\n", "# The plural peek returns a named list:\n", #> "peek_options(\"my_option\")\n", "peek_options(\"my_option\", \"digits\")\n"), #> "\n", list("experimental"), "\n"), search_envs.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-special.R", #> "\n", list("search_envs"), "\n", list("search_envs"), #> "\n", list("search_env"), "\n", list("pkg_env"), #> "\n", list("pkg_env_name"), "\n", list("is_attached"), #> "\n", list("base_env"), "\n", list("global_env"), #> "\n", list("Search path environments"), "\n", list( #> "\n", "search_envs()\n", "\n", "search_env(name)\n", #> "\n", "pkg_env(pkg)\n", "\n", "pkg_env_name(pkg)\n", #> "\n", "is_attached(x)\n", "\n", "base_env()\n", #> "\n", "global_env()\n"), "\n", list("\n", list( #> list("name"), list("The name of an environment attached to the search\n", #> "path. Call ", list(list("base::search()")), #> " to get the names of environments\n", "currently attached to the search path. Note that the search name\n", #> "of a package environment is prefixed with ", #> list("\"package:\""), ".")), "\n", "\n", list( #> list("pkg"), list("The name of a package.")), #> "\n"), "\n", list("\n", "The search path is a chain of environments containing exported\n", #> "functions of attached packages.\n", "\n", "The API includes:\n", #> list("\n", list(), " ", list(list("base::search()")), #> " to get the names of environments attached to the\n", #> "search path.\n", list(), " ", list("search_envs()"), #> " returns the environments on the search path as a\n", #> "list.\n", list(), " ", list("pkg_env_name()"), #> " takes a bare package name and prefixes it with\n", #> list("\"package:\""), ". Attached package environments have search names of\n", #> "the form ", list("package:name"), ".\n", list(), #> " ", list("pkg_env()"), " takes a bare package name and returns the scoped\n", #> "environment of packages if they are attached to the search path,\n", #> "and throws an error otherwise. It is a shortcut for\n", #> list("search_env(pkg_env_name(\"pkgname\"))"), #> ".\n", list(), " ", list("is_attached()"), #> " returns ", list("TRUE"), " when its argument (a search name\n", #> "or a package environment) is attached to the search path.\n"), #> "\n"), "\n", list(list("The search path"), list( #> "\n", "\n", "\n", "This chain of environments determines what objects are visible from\n", #> "the global workspace. It contains the following elements:\n", #> list("\n", list(), " The chain always starts with ", #> list("global_env()"), " and finishes with\n", #> list("base_env()"), " (technically, it finishes with the ", #> list("empty_env()"), "\n", "which the base package environment inherits from).\n", #> list(), " Each ", list(list("base::library()")), #> " call attaches a new package environment to\n", #> "the search path. Attached packages are associated with a ", #> list("search name"), ".\n", list(), " In addition, any list, data frame, or environment can be attached\n", #> "to the search path with ", list(list("base::attach()")), #> ".\n"), "\n")), "\n", "\n", list("\n", "# List the search names of environments attached to the search path:\n", #> "search()\n", "\n", "# Get the corresponding environments:\n", #> "search_envs()\n", "\n", "# The global environment and the base package are always first and\n", #> "# last in the chain, respectively:\n", "envs <- search_envs()\n", #> "envs[[1]]\n", "envs[[length(envs)]]\n", "\n", #> "# These two environments have their own shortcuts:\n", #> "global_env()\n", "base_env()\n", "\n", "# Packages appear in the search path with a special name. Use\n", #> "# pkg_env_name() to create that name:\n", "pkg_env_name(\"rlang\")\n", #> "search_env(pkg_env_name(\"rlang\"))\n", "\n", #> "# Alternatively, get the scoped environment of a package with\n", #> "# pkg_env():\n", "pkg_env(\"utils\")\n"), "\n", #> list("internal"), "\n"), seq2.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec.R", "\n", #> list("seq2"), "\n", list("seq2"), "\n", list("seq2_along"), #> "\n", list("Increasing sequence of integers in an interval"), #> "\n", list("\n", "seq2(from, to)\n", "\n", "seq2_along(from, x)\n"), #> "\n", list("\n", list(list("from"), list("The starting point of the sequence.")), #> "\n", "\n", list(list("to"), list("The end point.")), #> "\n", "\n", list(list("x"), list("A vector whose length is the end point.")), #> "\n"), "\n", list("\n", "An integer vector containing a strictly increasing\n", #> "sequence.\n"), "\n", list("\n", "These helpers take two endpoints and return the sequence of all\n", #> "integers within that interval. For ", list("seq2_along()"), #> ", the upper\n", "endpoint is taken from the length of a vector. Unlike\n", #> list("base::seq()"), ", they return an empty vector if the starting point is\n", #> "a larger integer than the end point.\n"), "\n", #> list("\n", "seq2(2, 10)\n", "seq2(10, 2)\n", "seq(10, 2)\n", #> "\n", "seq2_along(10, letters)\n"), "\n"), set_attrs.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("set_attrs"), "\n", list("set_attrs"), #> "\n", list("mut_attrs"), "\n", list("Add attributes to an object"), #> "\n", list("\n", "set_attrs(.x, ...)\n", "\n", "mut_attrs(.x, ...)\n"), #> "\n", list("\n", list(list(".x"), list("An object to decorate with attributes.")), #> "\n", "\n", list(list("..."), list("A list of named attributes. These have ", #> list("explicit splicing semantics"), ". Pass a single unnamed ", #> list("NULL"), " argument to\n", "zap all attributes from ", #> list(".x"), ".")), "\n"), "\n", list("\n", #> list("set_attrs()"), " returns a modified ", #> list("shallow copy"), "\n", "of ", list(".x"), #> ". ", list("mut_attrs()"), " invisibly returns the original ", #> list(".x"), "\n", "modified in place.\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", list("set_attrs()"), " adds, changes, or zaps attributes of objects. Pass a\n", #> "single unnamed ", list("NULL"), " argument to zap all attributes. For\n", #> list("uncopyable"), " types, use ", list("mut_attrs()"), #> ".\n"), "\n", list("\n", "Unlike ", list(list( #> "structure()")), ", these setters have no special handling of\n", #> "internal attributes names like ", list(".Dim"), #> ", ", list(".Dimnames"), " or ", list(".Names"), #> ".\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "These functions are deprecated since rlang 0.3.0.\n")), #> "\n", "\n", list("\n", "set_attrs(letters, names = 1:26, class = \"my_chr\")\n", #> "\n", "# Splice a list of attributes:\n", "attrs <- list(attr = \"attr\", names = 1:26, class = \"my_chr\")\n", #> "obj <- set_attrs(letters, splice(attrs))\n", #> "obj\n", "\n", "# Zap attributes by passing a single unnamed NULL argument:\n", #> "set_attrs(obj, NULL)\n", "set_attrs(obj, !!! list(NULL))\n", #> "\n", "# Note that set_attrs() never modifies objects in place:\n", #> "obj\n", "\n", "# For uncopyable types, mut_attrs() lets you modify in place:\n", #> "env <- env()\n", "mut_attrs(env, foo = \"bar\")\n", #> "env\n"), "\n", list("internal"), "\n"), set_expr.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/expr.R", "\n", #> list("set_expr"), "\n", list("set_expr"), "\n", list( #> "get_expr"), "\n", list("Set and get an expression"), #> "\n", list("\n", "set_expr(x, value)\n", "\n", "get_expr(x, default = x)\n"), #> "\n", list("\n", list(list("x"), list("An expression, closure, or one-sided formula. In addition,\n", #> list("set_expr()"), " accept frames.")), "\n", #> "\n", list(list("value"), list("An updated expression.")), #> "\n", "\n", list(list("default"), list("A default expression to return when ", #> list("x"), " is not an\n", "expression wrapper. Defaults to ", #> list("x"), " itself.")), "\n"), "\n", list( #> "\n", "The updated original input for ", list( #> "set_expr()"), ". A raw\n", "expression for ", #> list("get_expr()"), ".\n"), "\n", list("\n", #> "These helpers are useful to make your function work generically\n", #> "with quosures and raw expressions. First call ", #> list("get_expr()"), " to\n", "extract an expression. Once you're done processing the expression,\n", #> "call ", list("set_expr()"), " on the original object to update the expression.\n", #> "You can return the result of ", list("set_expr()"), #> ", either a formula or an\n", "expression depending on the input type. Note that ", #> list("set_expr()"), " does\n", "not change its input, it creates a new object.\n"), #> "\n", list("\n", "f <- ~foo(bar)\n", "e <- quote(foo(bar))\n", #> "frame <- identity(identity(ctxt_frame()))\n", #> "\n", "get_expr(f)\n", "get_expr(e)\n", "get_expr(frame)\n", #> "\n", "set_expr(f, quote(baz))\n", "set_expr(e, quote(baz))\n"), #> "\n", list("\n", list(list("quo_get_expr()")), " and ", #> list(list("quo_set_expr()")), " for versions of\n", #> list(list("get_expr()")), " and ", list(list( #> "set_expr()")), " that only work on quosures.\n"), #> "\n"), set_names.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/attr.R", #> "\n", list("set_names"), "\n", list("set_names"), #> "\n", list("Set names of a vector"), "\n", list("\n", #> "set_names(x, nm = x, ...)\n"), "\n", list("\n", #> list(list("x"), list("Vector to name.")), "\n", #> "\n", list(list("nm, ..."), list("Vector of names, the same length as ", #> list("x"), ".\n", "\n", "You can specify names in the following ways:\n", #> list("\n", list(), " If you do nothing, ", #> list("x"), " will be named with itself.\n", #> list(), " If ", list("x"), " already has names, you can provide a function or formula\n", #> "to transform the existing names. In that case, ", #> list("..."), " is passed\n", "to the function.\n", #> list(), " If ", list("nm"), " is ", list( #> "NULL"), ", the names are removed (if present).\n", #> list(), " In all other cases, ", list("nm"), #> " and ", list("..."), " are coerced to character.\n"))), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", "This is equivalent to ", list(list( #> "stats::setNames()")), ", with more features and\n", #> "stricter argument checking.\n"), "\n", list( #> list("Life cycle"), list("\n", "\n", "\n", list( #> "set_names()"), " is stable and exported in purrr.\n")), #> "\n", "\n", list("\n", "set_names(1:4, c(\"a\", \"b\", \"c\", \"d\"))\n", #> "set_names(1:4, letters[1:4])\n", "set_names(1:4, \"a\", \"b\", \"c\", \"d\")\n", #> "\n", "# If the second argument is ommitted a vector is named with itself\n", #> "set_names(letters[1:5])\n", "\n", "# Alternatively you can supply a function\n", #> "set_names(1:10, ~ letters[seq_along(.)])\n", #> "set_names(head(mtcars), toupper)\n", "\n", "# If the input vector is unnamed, it is first named after itself\n", #> "# before the function is applied:\n", "set_names(letters, toupper)\n", #> "\n", "# `...` is passed to the function:\n", #> "set_names(head(mtcars), paste0, \"_foo\")\n"), #> "\n"), splice.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/dots.R", #> "\n", list("splice"), "\n", list("splice"), "\n", #> list("is_spliced"), "\n", list("is_spliced_bare"), #> "\n", list("dots_splice"), "\n", list("Splice lists"), #> "\n", list("\n", "splice(x)\n", "\n", "is_spliced(x)\n", #> "\n", "is_spliced_bare(x)\n", "\n", "dots_splice(..., .ignore_empty = c(\"trailing\", \"none\", \"all\"),\n", #> " .preserve_empty = FALSE, .homonyms = c(\"keep\", \"first\", \"last\",\n", #> " \"error\"), .check_assign = FALSE)\n"), "\n", #> list("\n", list(list("x"), list("A list to splice.")), #> "\n", "\n", list(list("..."), list("Arguments to collect with ", #> list("!!!"), " support.")), "\n", "\n", list( #> list(".ignore_empty"), list("Whether to ignore empty arguments. Can be one\n", #> "of ", list("\"trailing\""), ", ", list("\"none\""), #> ", ", list("\"all\""), ". If ", list("\"trailing\""), #> ", only the\n", "last argument is ignored if it is empty.")), #> "\n", "\n", list(list(".preserve_empty"), list( #> "Whether to preserve the empty arguments that\n", #> "were not ignored. If ", list("TRUE"), ", empty arguments are stored with\n", #> list(list("missing_arg()")), " values. If ", #> list("FALSE"), " (the default) an error is\n", #> "thrown when an empty argument is detected.")), #> "\n", "\n", list(list(".homonyms"), list("How to treat arguments with the same name. The\n", #> "default, ", list("\"keep\""), ", preserves these arguments. Set ", #> list(".homonyms"), " to\n", list("\"first\""), #> " to only keep the first occurrences, to ", #> list("\"last\""), " to keep\n", "the last occurrences, and to ", #> list("\"error\""), " to raise an informative\n", #> "error and indicate what arguments have duplicated names.")), #> "\n", "\n", list(list(".check_assign"), list( #> "Whether to check for ", list("<-"), " calls passed in\n", #> "dots. When ", list("TRUE"), " and a ", list( #> "<-"), " call is detected, a warning is\n", #> "issued to advise users to use ", list("="), #> " if they meant to match a\n", "function parameter, or wrap the ", #> list("<-"), " call in braces otherwise.\n", #> "This ensures assignments are explicit.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", list("\n", list(), " ", list("splice"), #> " marks an object to be spliced. It is equivalent to using\n", #> list("!!!"), " in a function with ", list("tidy dots semantics"), #> ".\n", list(), " ", list("dots_splice()"), #> " is like ", list(list("dots_list()")), " but automatically splices\n", #> "list inputs.\n"), "\n"), "\n", list(list("Standard splicing versus quoting splicing"), #> list("\n", "\n", "\n", "The ", list("!!!"), " operator works differently in ", #> list("standard"), " functions taking\n", "dots with ", #> list("dots_list()"), " than in ", list("quoting"), #> " functions taking dots\n", "with ", list(list( #> "enexprs()")), " or ", list(list("enquos()")), #> ".\n", list("\n", list(), " In quoting functions ", #> list("!!!"), " disaggregates its argument (let's call\n", #> "it ", list("x"), ") into as many objects as there are elements in\n", #> list("x"), ". E.g. ", list("quo(foo(!!! c(1, 2)))"), #> " is completely equivalent to\n", list("quo(foo(1, 2))"), #> ". The creation of those separate objects has an\n", #> "overhead but is typically not important when manipulating calls\n", #> "because function calls typically take a small number of\n", #> "arguments.\n", list(), " In standard functions, disaggregating the spliced collection\n", #> "would have a negative performance impact in cases where\n", #> list("dots_list()"), " is used to build up data structures from user\n", #> "inputs. To avoid this spliced inputs are marked with ", #> list(list("splice()")), "\n", "and the final list is built with (the equivalent of)\n", #> list("flatten_if(dots, is_spliced)"), ".\n"), #> "\n", "\n", "Most of the time you should not care about the difference. However\n", #> "if you use a standard function taking tidy dots within a quoting\n", #> "function, the ", list("!!!"), " operator will disaggregate its argument because\n", #> "the behaviour of the quasiquoting function has priority. You might\n", #> "then observe some performance cost in edge cases. Here is one\n", #> "example where this would happen:", list("purrr::rerun(10, dplyr::bind_rows(!!! x))\n"), #> "\n", "\n", list("purrr::rerun()"), " is a quoting function and ", #> list("dplyr::bind_rows()"), " is\n", "a standard function. Because ", #> list("bind_rows()"), " is called ", list("inside"), #> "\n", list("rerun()"), ", the list ", list( #> "x"), " will be disaggregated into a pairlist of\n", #> "arguments. To avoid this you can use ", list( #> "splice()"), " instead:", list("purrr::rerun(10, dplyr::bind_rows(splice(x)))\n"), #> "\n")), "\n", "\n", list(list("Life cycle"), #> list("\n", "\n", list("\n", list(), " ", list( #> "dots_splice()"), " is in the questioning stage. It is part of our\n", #> "experiments with dots semantics. Compared to ", #> list("dots_list()"), ",\n", list("dots_splice()"), #> " automatically splices lists. We now lean towards\n", #> "adopting a single type of dots semantics (those of ", #> list("dots_list()"), ")\n", "where splicing is explicit.\n", #> list(), " ", list("splice()"), " is in the questioning stage. It is not clear whether it is\n", #> "really needed as there are other ways to avoid the performance\n", #> "issue discussed above.\n"), "\n")), "\n", #> "\n", list("internal"), "\n"), stack.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("stack"), "\n", list("stack"), "\n", list( #> "global_frame"), "\n", list("current_frame"), #> "\n", list("ctxt_frame"), "\n", list("call_frame"), #> "\n", list("ctxt_depth"), "\n", list("call_depth"), #> "\n", list("ctxt_stack"), "\n", list("call_stack"), #> "\n", list("Call stack information"), "\n", list( #> "\n", "global_frame()\n", "\n", "current_frame()\n", #> "\n", "ctxt_frame(n = 1)\n", "\n", "call_frame(n = 1, clean = TRUE)\n", #> "\n", "ctxt_depth()\n", "\n", "call_depth()\n", #> "\n", "ctxt_stack(n = NULL, trim = 0)\n", "\n", #> "call_stack(n = NULL, clean = TRUE)\n"), "\n", #> list("\n", list(list("n"), list("The number of frames to go back in the stack.")), #> "\n", "\n", list(list("clean"), list("Whether to post-process the call stack to clean\n", #> "non-standard frames. If ", list("TRUE"), ", suboptimal call-stack entries by\n", #> list(list("base::eval()")), " will be cleaned up: the duplicate frame created by\n", #> list("eval()"), " is eliminated.")), "\n", #> "\n", list(list("trim"), list("The number of layers of intervening frames to trim off\n", #> "the stack. See ", list(list("stack_trim()")), #> " and examples.")), "\n"), "\n", list("\n", #> list("rlang:::lifecycle(\"deprecated\")"), "\n", #> "\n", "The ", list("eval_"), " and ", list("call_"), #> " families of functions provide a replacement\n", #> "for the base R functions prefixed with ", list( #> "sys."), " (which are all about\n", "the context stack), as well as for ", #> list(list("parent.frame()")), " (which is the\n", #> "only base R function for querying the call stack). The context\n", #> "stack includes all R-level evaluation contexts. It is linear in\n", #> "terms of execution history but due to lazy evaluation it is\n", #> "potentially nonlinear in terms of call history. The call stack\n", #> "history, on the other hand, is homogenous.\n"), #> "\n", list("\n", list("ctxt_frame()"), " and ", list( #> "call_frame()"), " return a ", list("frame"), #> " object\n", "containing the following fields: ", #> list("expr"), " and ", list("env"), " (call expression\n", #> "and evaluation environment), ", list("pos"), #> " and ", list("caller_pos"), " (position of\n", #> "current frame in the context stack and position of the caller), and\n", #> list("fun"), " (function of the current frame). ", #> list("ctxt_stack()"), " and\n", list("call_stack()"), #> " return a list of all context or call frames on the\n", #> "stack. Finally, ", list("ctxt_depth()"), " and ", #> list("call_depth()"), " report the\n", "current context position or the number of calling frames on the\n", #> "stack.\n", "\n", "The base R functions take two sorts of arguments to indicate which\n", #> "frame to query: ", list("which"), " and ", list( #> "n"), ". The ", list("n"), " argument is\n", #> "straightforward: it's the number of frames to go down the stack,\n", #> "with ", list("n = 1"), " referring to the current context. The ", #> list("which"), " argument\n", "is more complicated and changes meaning for values lower than 1.\n", #> "For the sake of consistency, the rlang functions all take the\n", #> "same kind of argument ", list("n"), ". This argument has a single meaning (the\n", #> "number of frames to go down the stack) and cannot be lower than 1.\n", #> "\n", "Note finally that ", list("parent.frame(1)"), #> " corresponds to\n", list("call_frame(2)$env"), #> ", as ", list("n = 1"), " always refers to the current\n", #> "frame. This makes the ", list("_frame()"), " and ", #> list("_stack()"), " functions\n", "consistent: ", #> list("ctxt_frame(2)"), " is the same as ", list( #> "ctxt_stack()[[2]]"), ".\n", "Also, ", list( #> "ctxt_depth()"), " returns one more frame than\n", #> list(list("base::sys.nframe()")), " because it counts the global frame. That is\n", #> "consistent with the ", list("_stack()"), " functions which return the global\n", #> "frame as well. This way, ", list("call_stack(call_depth())"), #> " is the same as\n", list("global_frame()"), #> ".\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "These functions are soft-deprecated and replaced by ", #> list(list("trace_back()")), ".\n")), "\n", "\n", #> list("\n", "# Expressions within arguments count as contexts\n", #> "identity(identity(ctxt_depth())) # returns 2\n", #> "\n", "# But they are not part of the call stack because arguments are\n", #> "# evaluated within the calling function (or the global environment\n", #> "# if called at top level)\n", "identity(identity(call_depth())) # returns 0\n", #> "\n", "# The context stacks includes all intervening execution frames. The\n", #> "# call stack doesn't:\n", "f <- function(x) identity(x)\n", #> "f(f(ctxt_stack()))\n", "f(f(call_stack()))\n", #> "\n", "g <- function(cmd) cmd()\n", "f(g(ctxt_stack))\n", #> "f(g(call_stack))\n", "\n", "# The rlang _stack() functions return a list of frame\n", #> "# objects. Use purrr::transpose() or index a field with\n", #> "# purrr::map()'s to extract a particular field from a stack:\n", #> "\n", "# stack <- f(f(call_stack()))\n", "# purrr::map(stack, \"env\")\n", #> "# purrr::transpose(stack)$expr\n", "\n", "# current_frame() is an alias for ctxt_frame(1)\n", #> "fn <- function() list(current = current_frame(), first = ctxt_frame(1))\n", #> "fn()\n", "\n", "# While current_frame() is the top of the stack, global_frame() is\n", #> "# the bottom:\n", "fn <- function() {\n", " n <- ctxt_depth()\n", #> " ctxt_frame(n)\n", "}\n", "identical(fn(), global_frame())\n", #> "\n", "\n", "# ctxt_stack() returns a stack with all intervening frames. You can\n", #> "# trim layers of intervening frames with the trim argument:\n", #> "identity(identity(ctxt_stack()))\n", "identity(identity(ctxt_stack(trim = 1)))\n", #> "\n", "# ctxt_stack() is called within fn() with intervening frames:\n", #> "fn <- function(trim) identity(identity(ctxt_stack(trim = trim)))\n", #> "fn(0)\n", "\n", "# We can trim the first layer of those:\n", #> "fn(1)\n", "\n", "# The outside intervening frames (at the fn() call site) are still\n", #> "# returned, but can be trimmed as well:\n", #> "identity(identity(fn(1)))\n", "identity(identity(fn(2)))\n", #> "\n", "g <- function(trim) identity(identity(fn(trim)))\n", #> "g(2)\n", "g(3)\n"), "\n", list("internal"), #> "\n"), stack_trim.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("stack_trim"), "\n", list("stack_trim"), #> "\n", list("Trim top call layers from the evaluation stack"), #> "\n", list("\n", "stack_trim(stack, n = 1)\n"), "\n", #> list("\n", list(list("stack"), list("An evaluation stack.")), #> "\n", "\n", list(list("n"), list("The number of call frames (not eval frames) to trim off\n", #> "the top of the stack. In other words, the number of layers of\n", #> "intervening frames to trim.")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", list(list("ctxt_stack()")), " can be tricky to use in real code because all\n", #> "intervening frames are returned with the stack, including those at\n", #> list("ctxt_stack()"), " own call site. ", list( #> "stack_trim()"), " makes it easy to\n", "remove layers of intervening calls.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "These functions are deprecated and replaced by ", #> list(list("trace_back()")), ".\n")), "\n", "\n", #> list("\n", "# Intervening frames appear on the evaluation stack:\n", #> "identity(identity(ctxt_stack()))\n", "\n", "# stack_trim() will trim the first n layers of calls:\n", #> "stack_trim(identity(identity(ctxt_stack())))\n", #> "\n", "# Note that it also takes care of calls intervening at its own call\n", #> "# site:\n", "identity(identity(\n", " stack_trim(identity(identity(ctxt_stack())))\n", #> "))\n", "\n", "# It is especially useful when used within a function that needs to\n", #> "# inspect the evaluation stack but should nonetheless be callable\n", #> "# within nested calls without side effects:\n", #> "stack_util <- function() {\n", " # n = 2 means that two layers of intervening calls should be\n", #> " # removed: The layer at ctxt_stack()'s call site (including the\n", #> " # stack_trim() call), and the layer at stack_util()'s call.\n", #> " stack <- stack_trim(ctxt_stack(), n = 2)\n", #> " stack\n", "}\n", "user_fn <- function() {\n", #> " # A user calls your stack utility with intervening frames:\n", #> " identity(identity(stack_util()))\n", "}\n", #> "# These intervening frames won't appear in the evaluation stack\n", #> "identity(user_fn())\n"), "\n", list("internal"), #> "\n"), string.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/utils-encoding.R", #> "\n", list("string"), "\n", list("string"), "\n", #> list("Create a string"), "\n", list("\n", "string(x, encoding = NULL)\n"), #> "\n", list("\n", list(list("x"), list("A character vector or a vector or list of string-like\n", #> "objects.")), "\n", "\n", list(list("encoding"), #> list("If non-null, set an encoding mark. This is only\n", #> "declarative, no encoding conversion is performed.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "These base-type constructors allow more control over the creation\n", #> "of strings in R. They take character vectors or string-like objects\n", #> "(integerish or raw vectors), and optionally set the encoding. The\n", #> "string version checks that the input contains a scalar string.\n"), #> "\n", list("\n", "# As everywhere in R, you can specify a string with Unicode\n", #> "# escapes. The characters corresponding to Unicode codepoints will\n", #> "# be encoded in UTF-8, and the string will be marked as UTF-8\n", #> "# automatically:\n", "cafe <- string(\"caf\\uE9\")\n", #> "Encoding(cafe)\n", "as_bytes(cafe)\n", "\n", #> "# In addition, string() provides useful conversions to let\n", #> "# programmers control how the string is represented in memory. For\n", #> "# encodings other than UTF-8, you'll need to supply the bytes in\n", #> "# hexadecimal form. If it is a latin1 encoding, you can mark the\n", #> "# string explicitly:\n", "cafe_latin1 <- string(c(0x63, 0x61, 0x66, 0xE9), \"latin1\")\n", #> "Encoding(cafe_latin1)\n", "as_bytes(cafe_latin1)\n"), #> "\n"), switch_type.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("switch_type"), "\n", list("switch_type"), #> "\n", list("coerce_type"), "\n", list("switch_class"), #> "\n", list("coerce_class"), "\n", list("Dispatch on base types"), #> "\n", list("\n", "switch_type(.x, ...)\n", "\n", #> "coerce_type(.x, .to, ...)\n", "\n", "switch_class(.x, ...)\n", #> "\n", "coerce_class(.x, .to, ...)\n"), "\n", #> list("\n", list(list(".x"), list("An object from which to dispatch.")), #> "\n", "\n", list(list("..."), list("Named clauses. The names should be types as returned by\n", #> list(list("type_of()")), ".")), "\n", "\n", #> list(list(".to"), list("This is useful when you switchpatch within a coercing\n", #> "function. If supplied, this should be a string indicating the\n", #> "target type. A catch-all clause is then added to signal an error\n", #> "stating the conversion failure. This type is prettified unless\n", #> list(".to"), " inherits from the S3 class ", #> list("\"AsIs\""), " (see ", list(list("base::I()")), #> ").")), "\n"), "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", list("switch_type()"), " is equivalent to\n", #> list(list("switch"), "(", list("type_of"), "(x, ...))"), #> ", while\n", list("switch_class()"), " switchpatches based on ", #> list("class(x)"), ". The ", list("coerce_"), #> "\n", "versions are intended for type conversion and provide a standard\n", #> "error message when conversion fails.\n"), "\n", #> list("\n", "switch_type(3L,\n", " double = \"foo\",\n", #> " integer = \"bar\",\n", " \"default\"\n", #> ")\n", "\n", "# Use the coerce_ version to get standardised error handling when no\n", #> "# type matches:\n", "to_chr <- function(x) {\n", #> " coerce_type(x, \"a chr\",\n", " integer = as.character(x),\n", #> " double = as.character(x)\n", " )\n", "}\n", #> "to_chr(3L)\n", "\n", "# Strings have their own type:\n", #> "switch_type(\"str\",\n", " character = \"foo\",\n", #> " string = \"bar\",\n", " \"default\"\n", ")\n", #> "\n", "# Use a fallthrough clause if you need to dispatch on all character\n", #> "# vectors, including strings:\n", "switch_type(\"str\",\n", #> " string = ,\n", " character = \"foo\",\n", #> " \"default\"\n", ")\n", "\n", "# special and builtin functions are treated as primitive, since\n", #> "# there is usually no reason to treat them differently:\n", #> "switch_type(base::list,\n", " primitive = \"foo\",\n", #> " \"default\"\n", ")\n", "switch_type(base::`$`,\n", #> " primitive = \"foo\",\n", " \"default\"\n", #> ")\n", "\n", "# closures are not primitives:\n", #> "switch_type(rlang::switch_type,\n", " primitive = \"foo\",\n", #> " \"default\"\n", ")\n"), "\n", list("internal"), #> "\n"), sym.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/sym.R", "\n", #> list("sym"), "\n", list("sym"), "\n", list("syms"), #> "\n", list("Create a symbol or list of symbols"), #> "\n", list("\n", "sym(x)\n", "\n", "syms(x)\n"), #> "\n", list("\n", list(list("x"), list("A string or list of strings.")), #> "\n"), "\n", list("\n", "A symbol for ", list( #> "sym()"), " and a list of symbols for ", list( #> "syms()"), ".\n"), "\n", list("\n", "These functions take strings as input and turn them into symbols.\n"), #> "\n", list("\n", "# The empty string returns the missing argument:\n", #> "sym(\"\")\n", "\n", "# This way sym() and as_string() are inverse of each other:\n", #> "as_string(missing_arg())\n", "sym(as_string(missing_arg()))\n"), #> "\n"), `tidy-dots.Rd` = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/dots.R, R/vec-new.R", #> "\n", list("tidy-dots"), "\n", list("tidy-dots"), #> "\n", list("dots_list"), "\n", list("list2"), "\n", #> list("Collect dots tidily"), "\n", list("\n", "dots_list(..., .ignore_empty = c(\"trailing\", \"none\", \"all\"),\n", #> " .preserve_empty = FALSE, .homonyms = c(\"keep\", \"first\", \"last\",\n", #> " \"error\"), .check_assign = FALSE)\n", "\n", #> "list2(...)\n"), "\n", list("\n", list(list("..."), #> list("Arguments to collect with ", list("!!!"), #> " support.")), "\n", "\n", list(list(".ignore_empty"), #> list("Whether to ignore empty arguments. Can be one\n", #> "of ", list("\"trailing\""), ", ", list("\"none\""), #> ", ", list("\"all\""), ". If ", list("\"trailing\""), #> ", only the\n", "last argument is ignored if it is empty.")), #> "\n", "\n", list(list(".preserve_empty"), list( #> "Whether to preserve the empty arguments that\n", #> "were not ignored. If ", list("TRUE"), ", empty arguments are stored with\n", #> list(list("missing_arg()")), " values. If ", #> list("FALSE"), " (the default) an error is\n", #> "thrown when an empty argument is detected.")), #> "\n", "\n", list(list(".homonyms"), list("How to treat arguments with the same name. The\n", #> "default, ", list("\"keep\""), ", preserves these arguments. Set ", #> list(".homonyms"), " to\n", list("\"first\""), #> " to only keep the first occurrences, to ", #> list("\"last\""), " to keep\n", "the last occurrences, and to ", #> list("\"error\""), " to raise an informative\n", #> "error and indicate what arguments have duplicated names.")), #> "\n", "\n", list(list(".check_assign"), list( #> "Whether to check for ", list("<-"), " calls passed in\n", #> "dots. When ", list("TRUE"), " and a ", list( #> "<-"), " call is detected, a warning is\n", #> "issued to advise users to use ", list("="), #> " if they meant to match a\n", "function parameter, or wrap the ", #> list("<-"), " call in braces otherwise.\n", #> "This ensures assignments are explicit.")), #> "\n"), "\n", list("\n", "A list of arguments. This list is always named: unnamed\n", #> "arguments are named with the empty string ", #> list("\"\""), ".\n"), "\n", list("\n", list("list2()"), #> " is equivalent to ", list("list(...)"), " but provides tidy\n", #> "dots semantics:\n", list("\n", list(), " You can splice other lists with the\n", #> list("unquote-splice"), " ", list("!!!"), " operator.\n", #> list(), " You can unquote names by using the ", #> list("unquote"), "\n", "operator ", list("!!"), #> " on the left-hand side of ", list(":="), ".\n"), #> "\n", "\n", "We call quasiquotation support in dots ", #> list("tidy dots"), " semantics and\n", "functions taking dots with ", #> list("list2()"), " tidy dots functions.\n", "Quasiquotation is an alternative to ", #> list("do.call()"), " idioms and gives\n", "the users of your functions an uniform syntax to supply a variable\n", #> "number of arguments or a variable name.\n", #> "\n", list("dots_list()"), " is a lower-level version of ", #> list("list2()"), " that offers\n", "additional parameters for dots capture.\n"), #> "\n", list("\n", "Note that while all tidy eval ", #> list("quoting functions"), " have\n", "tidy dots semantics, not all tidy dots functions are quoting\n", #> "functions. ", list("list2()"), " is for standard functions, not quoting\n", #> "functions.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "One difference of ", #> list("dots_list()"), " with ", list("list2()"), #> " is that it always\n", "allocates a vector of names even if no names were supplied. In this\n", #> "case, the names are all empty ", list("\"\""), #> ". This is for consistency with\n", list(list( #> "enquos()")), " and ", list(list("enexprs()")), #> " but can be quite costly when long lists\n", #> "are spliced in the results. For this reason we plan to parameterise\n", #> "this behaviour with a ", list(".named"), " argument and possibly change the\n", #> "default. ", list("list2()"), " does not have this issue.\n")), #> "\n", "\n", list("\n", "# Let's create a function that takes a variable number of arguments:\n", #> "numeric <- function(...) {\n", " dots <- list2(...)\n", #> " num <- as.numeric(dots)\n", " set_names(num, names(dots))\n", #> "}\n", "numeric(1, 2, 3)\n", "\n", "# The main difference with list(...) is that list2(...) enables\n", #> "# the `!!!` syntax to splice lists:\n", "x <- list(2, 3)\n", #> "numeric(1, !!! x, 4)\n", "\n", "# As well as unquoting of names:\n", #> "nm <- \"yup!\"\n", "numeric(!!nm := 1)\n", "\n", #> "\n", "# One useful application of splicing is to work around exact and\n", #> "# partial matching of arguments. Let's create a function taking\n", #> "# named arguments and dots:\n", "fn <- function(data, ...) {\n", #> " list2(...)\n", "}\n", "\n", "# You normally cannot pass an argument named `data` through the dots\n", #> "# as it will match `fn`'s `data` argument. The splicing syntax\n", #> "# provides a workaround:\n", "fn(\"wrong!\", data = letters) # exact matching of `data`\n", #> "fn(\"wrong!\", dat = letters) # partial matching of `data`\n", #> "fn(some_data, !!!list(data = letters)) # no matching\n", #> "\n", "\n", "# Empty arguments trigger an error by default:\n", #> "try(fn(, ))\n", "\n", "# You can choose to preserve empty arguments instead:\n", #> "list3 <- function(...) dots_list(..., .preserve_empty = TRUE)\n", #> "\n", "# Note how the last empty argument is still ignored because\n", #> "# `.ignore_empty` defaults to \"trailing\":\n", #> "list3(, )\n", "\n", "# The list with preserved empty arguments is equivalent to:\n", #> "list(missing_arg())\n", "\n", "\n", "# Arguments with duplicated names are kept by default:\n", #> "list2(a = 1, a = 2, b = 3, b = 4, 5, 6)\n", #> "\n", "# Use the `.homonyms` argument to keep only the first of these:\n", #> "dots_list(a = 1, a = 2, b = 3, b = 4, 5, 6, .homonyms = \"first\")\n", #> "\n", "# Or the last:\n", "dots_list(a = 1, a = 2, b = 3, b = 4, 5, 6, .homonyms = \"last\")\n", #> "\n", "# Or raise an informative error:\n", "try(dots_list(a = 1, a = 2, b = 3, b = 4, 5, 6, .homonyms = \"error\"))\n", #> "\n", "\n", "# dots_list() can be configured to warn when a `<-` call is\n", #> "# detected:\n", "my_list <- function(...) dots_list(..., .check_assign = TRUE)\n", #> "my_list(a <- 1)\n", "\n", "# There is no warning if the assignment is wrapped in braces.\n", #> "# This requires users to be explicit about their intent:\n", #> "my_list({ a <- 1 })\n"), "\n", list("\n", list( #> list("exprs()")), " for extracting dots without evaluation.\n"), #> "\n"), `tidyeval-data.Rd` = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval-tidy.R", #> "\n", list("data"), "\n", list("tidyeval-data"), #> "\n", list("tidyeval-data"), "\n", list(".data"), #> "\n", list("Data pronoun for tidy evaluation"), "\n", #> list("\n", ".data\n"), "\n", list("\n", "This pronoun allows you to be explicit when you refer to an object\n", #> "inside the data. Referring to the ", list(".data"), #> " pronoun rather than to\n", "the original data frame has several advantages:\n", #> list("\n", list(), " It makes it easy to refer to column names stored as strings. If\n", #> list("var"), " contains the column ", list( #> "\"height\""), ", the pronoun will subset that\n", #> "column:", list("var <- \"height\"\n", "dplyr::summarise(df, mean(.data[[var]]))\n"), #> "\n", "\n", "The index variable ", list("var"), #> " is ", list("unquoted"), ", which\n", "ensures a column named ", #> list("var"), " in the data frame cannot mask it.\n", #> "This makes the pronoun safe to use in functions and packages.\n", #> list(), " Sometimes a computation is not about the whole data but about a\n", #> "subset. For example if you supply a grouped data frame to a dplyr\n", #> "verb, the ", list(".data"), " pronoun contains the group subset.\n", #> list(), " It lets dplyr know that you're referring to a column from the\n", #> "data which is helpful to generate correct queries when the source\n", #> "is a database.\n"), "\n", "\n", "The ", list( #> ".data"), " object exported here is useful to import in your\n", #> "package namespace to avoid a ", list("R CMD check"), #> " note when referring to\n", "objects from the data mask.\n"), #> "\n", list("datasets"), "\n"), trace_back.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/trace.R", "\n", #> list("trace_back"), "\n", list("trace_back"), "\n", #> list("trace_length"), "\n", list("Capture a backtrace"), #> "\n", list("\n", "trace_back(top = NULL, bottom = NULL)\n", #> "\n", "trace_length(trace)\n"), "\n", list("\n", #> list(list("top"), list("The first frame environment to be included in the\n", #> "backtrace. This becomes the top of the backtrace tree and\n", #> "represents the oldest call in the backtrace.\n", #> "\n", "This is needed in particular when you call ", #> list("trace_back()"), "\n", "indirectly or from a larger context, for example in tests or\n", #> "inside an RMarkdown document where you don't want all of the\n", #> "knitr evaluation mechanisms to appear in the backtrace.")), #> "\n", "\n", list(list("bottom"), list("The last frame environment to be included in the\n", #> "backtrace. This becomes the rightmost leaf of the backtrace tree\n", #> "and represents the youngest call in the backtrace.\n", #> "\n", "Set this when you would like to capture a backtrace without the\n", #> "capture context.\n", "\n", "Can also be an integer that will be passed to ", #> list(list("caller_env()")), ".")), "\n", "\n", #> list(list("trace"), list("A backtrace created by ", #> list("trace_back()"), ".")), "\n"), "\n", list( #> "\n", "A backtrace captures the sequence of calls that lead to the current\n", #> "function, sometimes called the call stack. Because of lazy\n", #> "evaluation, the call stack in R is actually a tree, which the\n", #> list("summary()"), " method of this object will reveal.\n"), #> "\n", list("\n", list("trace_length()"), " returns the number of frames in a backtrace.\n"), #> "\n", list("\n", "# Trim backtraces automatically (this improves the generated\n", #> "# documentation for the rlang website and the same trick can be\n", #> "# useful within knitr documents):\n", "options(rlang_trace_top_env = current_env())\n", #> "\n", "f <- function() g()\n", "g <- function() h()\n", #> "h <- function() trace_back()\n", "\n", "# When no lazy evaluation is involved the backtrace is linear\n", #> "# (i.e. every call has only one child)\n", "f()\n", #> "\n", "# Lazy evaluation introduces a tree like structure\n", #> "identity(identity(f()))\n", "identity(try(f()))\n", #> "try(identity(f()))\n", "\n", "# When printing, you can request to simplify this tree to only show\n", #> "# the direct sequence of calls that lead to `trace_back()`\n", #> "x <- try(identity(f()))\n", "x\n", "print(x, simplify = \"branch\")\n", #> "\n", "# With a little cunning you can also use it to capture the\n", #> "# tree from within a base NSE function\n", "x <- NULL\n", #> "with(mtcars, {x <<- f(); 10})\n", "x\n", "\n", #> "\n", "# Restore default top env for next example\n", #> "options(rlang_trace_top_env = NULL)\n", "\n", #> "# When code is executed indirectly, i.e. via source or within an\n", #> "# RMarkdown document, you'll tend to get a lot of guff at the beginning\n", #> "# related to the execution environment:\n", #> "conn <- textConnection(\"summary(f())\")\n", #> "source(conn, echo = TRUE, local = TRUE)\n", #> "close(conn)\n", "\n", "# To automatically strip this off, specify which frame should be\n", #> "# the top of the backtrace. This will automatically trim off calls\n", #> "# prior to that frame:\n", "top <- current_env()\n", #> "h <- function() trace_back(top)\n", "\n", "conn <- textConnection(\"summary(f())\")\n", #> "source(conn, echo = TRUE, local = TRUE)\n", #> "close(conn)\n"), "\n"), `type-predicates.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("type-predicates"), "\n", list("type-predicates"), #> "\n", list("is_list"), "\n", list("is_atomic"), "\n", #> list("is_vector"), "\n", list("is_integer"), "\n", #> list("is_double"), "\n", list("is_character"), "\n", #> list("is_logical"), "\n", list("is_raw"), "\n", list( #> "is_bytes"), "\n", list("is_null"), "\n", list( #> "Type predicates"), "\n", list("\n", "is_list(x, n = NULL)\n", #> "\n", "is_atomic(x, n = NULL)\n", "\n", "is_vector(x, n = NULL)\n", #> "\n", "is_integer(x, n = NULL)\n", "\n", "is_double(x, n = NULL, finite = NULL)\n", #> "\n", "is_character(x, n = NULL, encoding = NULL)\n", #> "\n", "is_logical(x, n = NULL)\n", "\n", "is_raw(x, n = NULL)\n", #> "\n", "is_bytes(x, n = NULL)\n", "\n", "is_null(x)\n"), #> "\n", list("\n", list(list("x"), list("Object to be tested.")), #> "\n", "\n", list(list("n"), list("Expected length of a vector.")), #> "\n", "\n", list(list("finite"), list("Whether all values of the vector are finite. The\n", #> "non-finite values are ", list("NA"), ", ", #> list("Inf"), ", ", list("-Inf"), " and ", list( #> "NaN"), ". Setting this\n", "to something other than ", #> list("NULL"), " can be expensive because the whole\n", #> "vector needs to be traversed and checked.")), #> "\n", "\n", list(list("encoding"), list("Defunct as of rlang 0.4.0.")), #> "\n"), "\n", list("\n", "These type predicates aim to make type testing in R more\n", #> "consistent. They are wrappers around ", list( #> list("base::typeof()")), ", so operate\n", #> "at a level beneath S3/S4 etc.\n"), "\n", list( #> "\n", "Compared to base R functions:\n", list( #> "\n", list(), " The predicates for vectors include the ", #> list("n"), " argument for\n", "pattern-matching on the vector length.\n", #> list(), " Unlike ", list("is.atomic()"), ", ", #> list("is_atomic()"), " does not return ", list( #> "TRUE"), " for\n", list("NULL"), ".\n", list(), #> " Unlike ", list("is.vector()"), ", ", list( #> "is_vector()"), " tests if an object is an\n", #> "atomic vector or a list. ", list("is.vector"), #> " checks for the presence of\n", "attributes (other than name).\n"), #> "\n"), "\n", list("\n", list("bare-type-predicates"), #> " ", list("scalar-type-predicates"), "\n"), "\n"), #> type_of.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("type_of"), "\n", list("type_of"), "\n", #> list("Base type of an object"), "\n", list("\n", #> "type_of(x)\n"), "\n", list("\n", list(list("x"), #> list("An R object.")), "\n"), "\n", list("\n", #> list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "This is equivalent to ", list(list( #> "base::typeof()")), " with a few differences that\n", #> "make dispatching easier:\n", list("\n", list(), #> " The type of one-sided formulas is \"quote\".\n", #> list(), " The type of character vectors of length 1 is \"string\".\n", #> list(), " The type of special and builtin functions is \"primitive\".\n"), #> "\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", list("type_of()"), " is an experimental function. Expect API changes.\n")), #> "\n", "\n", list("\n", "type_of(10L)\n", "\n", "# Quosures are treated as a new base type but not formulas:\n", #> "type_of(quo(10L))\n", "type_of(~10L)\n", "\n", #> "# Compare to base::typeof():\n", "typeof(quo(10L))\n", #> "\n", "# Strings are treated as a new base type:\n", #> "type_of(letters)\n", "type_of(letters[[1]])\n", #> "\n", "# This is a bit inconsistent with the core language tenet that data\n", #> "# types are vectors. However, treating strings as a different\n", #> "# scalar type is quite helpful for switching on function inputs\n", #> "# since so many arguments expect strings:\n", #> "switch_type(\"foo\", character = abort(\"vector!\"), string = \"result\")\n", #> "\n", "# Special and builtin primitives are both treated as primitives.\n", #> "# That's because it is often irrelevant which type of primitive an\n", #> "# input is:\n", "typeof(list)\n", "typeof(`$`)\n", #> "type_of(list)\n", "type_of(`$`)\n"), "\n", list( #> "internal"), "\n"), vec_poke_n.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec.R", "\n", #> list("vec_poke_n"), "\n", list("vec_poke_n"), "\n", #> list("vec_poke_range"), "\n", list("Poke values into a vector"), #> "\n", list("\n", "vec_poke_n(x, start, y, from = 1L, n = length(y))\n", #> "\n", "vec_poke_range(x, start, y, from = 1L, to = length(y) - from + 1L)\n"), #> "\n", list("\n", list(list("x"), list("The destination vector.")), #> "\n", "\n", list(list("start"), list("The index indicating where to start modifying ", #> list("x"), ".")), "\n", "\n", list(list("y"), #> list("The source vector.")), "\n", "\n", list( #> list("from"), list("The index indicating where to start copying from ", #> list("y"), ".")), "\n", "\n", list(list("n"), #> list("How many elements should be copied from ", #> list("y"), " to ", list("x"), ".")), "\n", #> "\n", list(list("to"), list("The index indicating the end of the range to copy from ", #> list("y"), ".")), "\n"), "\n", list("\n", list( #> "rlang:::lifecycle(\"experimental\")"), "\n", #> "\n", "These tools are for R experts only. They copy elements from ", #> list("y"), "\n", "into ", list("x"), " by mutation. You should only do this if you own ", #> list("x"), ",\n", "i.e. if you have created it or if you are certain that it doesn't\n", #> "exist in any other context. Otherwise you might create unintended\n", #> "side effects that have undefined consequences.\n"), #> "\n", list("internal"), "\n"), `vector-coercion.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("vector-coercion"), "\n", list("vector-coercion"), #> "\n", list("as_logical"), "\n", list("as_integer"), #> "\n", list("as_double"), "\n", list("as_complex"), #> "\n", list("as_character"), "\n", list("as_list"), #> "\n", list("Coerce an object to a base type"), "\n", #> list("\n", "as_logical(x)\n", "\n", "as_integer(x)\n", #> "\n", "as_double(x)\n", "\n", "as_complex(x)\n", #> "\n", "as_character(x, encoding = NULL)\n", "\n", #> "as_list(x)\n"), "\n", list("\n", list(list("x"), #> list("An object to coerce to a base type.")), #> "\n", "\n", list(list("encoding"), list("If non-null, set an encoding mark. This is only\n", #> "declarative, no encoding conversion is performed.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", "\n", "These are equivalent to the base functions (e.g. ", #> list(list("as.logical()")), ",\n", list(list( #> "as.list()")), ", etc), but perform coercion rather than conversion.\n", #> "This means they are not generic and will not call S3 conversion\n", #> "methods. They only attempt to coerce the base type of their\n", #> "input. In addition, they have stricter implicit coercion rules and\n", #> "will never attempt any kind of parsing. E.g. they will not try to\n", #> "figure out if a character vector represents integers or booleans.\n", #> "Finally, they treat attributes consistently, unlike the base R\n", #> "functions: all attributes except names are removed.\n"), #> "\n", list(list("Lifecycle"), list("\n", "\n", "\n", #> "These functions are deprecated in favour of ", #> list("vctrs::vec_cast()"), ".\n")), "\n", "\n", #> list(list("Coercion to logical and numeric atomic vectors"), #> list("\n", "\n", list("\n", list(), " To logical vectors: Integer and integerish double vectors. See\n", #> list(list("is_integerish()")), ".\n", list(), #> " To integer vectors: Logical and integerish double vectors.\n", #> list(), " To double vectors: Logical and integer vectors.\n", #> list(), " To complex vectors: Logical, integer and double vectors.\n"), #> "\n")), "\n", "\n", list(list("Coercion to character vectors"), #> list("\n", "\n", "\n", list("as_character()"), #> " and ", list("as_string()"), " have an optional ", #> list("encoding"), "\n", "argument to specify the encoding. R uses this information for\n", #> "internal handling of strings and character vectors. Note that this\n", #> "is only declarative, no encoding conversion is attempted.\n", #> "\n", "Note that only ", list("as_string()"), #> " can coerce symbols to a scalar\n", "character vector. This makes the code more explicit and adds an\n", #> "extra type check.\n")), "\n", "\n", list(list( #> "Coercion to lists"), list("\n", "\n", "\n", #> list("as_list()"), " only coerces vector and dictionary types (environments\n", #> "are an example of dictionary type). Unlike ", #> list(list("base::as.list()")), ",\n", list("as_list()"), #> " removes all attributes except names.\n")), #> "\n", "\n", list(list("Effects of removing attributes"), #> list("\n", "\n", "\n", "A technical side-effect of removing the attributes of the input is\n", #> "that the underlying objects has to be copied. This has no\n", #> "performance implications in the case of lists because this is a\n", #> "shallow copy: only the list structure is copied, not the contents\n", #> "(see ", list(list("duplicate()")), "). However, be aware that atomic vectors\n", #> "containing large amounts of data will have to be copied.\n", #> "\n", "In general, any attribute modification creates a copy, which is why\n", #> "it is better to avoid using attributes with heavy atomic vectors.\n", #> "Uncopyable objects like environments and symbols are an exception\n", #> "to this rule: in this case, attributes modification happens in\n", #> "place and has side-effects.\n")), "\n", "\n", #> list("\n", "# Coercing atomic vectors removes attributes with both base R and rlang:\n", #> "x <- structure(TRUE, class = \"foo\", bar = \"baz\")\n", #> "as.logical(x)\n", "\n", "# But coercing lists preserves attributes in base R but not rlang:\n", #> "l <- structure(list(TRUE), class = \"foo\", bar = \"baz\")\n", #> "as.list(l)\n", "as_list(l)\n", "\n", "# Implicit conversions are performed in base R but not rlang:\n", #> "as.logical(l)\n", list("\n", "as_logical(l)\n"), #> "\n", "\n", "# Conversion methods are bypassed, making the result of the\n", #> "# coercion more predictable:\n", "as.list.foo <- function(x) \"wrong\"\n", #> "as.list(l)\n", "as_list(l)\n", "\n", "# The input is never parsed. E.g. character vectors of numbers are\n", #> "# not converted to numeric types:\n", "as.integer(\"33\")\n", #> list("\n", "as_integer(\"33\")\n"), "\n", "\n", #> "\n", "# With base R tools there is no way to convert an environment to a\n", #> "# list without either triggering method dispatch, or changing the\n", #> "# original environment. as_list() makes it easy:\n", #> "x <- structure(as_environment(mtcars[1:2]), class = \"foobar\")\n", #> "as.list.foobar <- function(x) abort(\"dont call me\")\n", #> "as_list(x)\n"), "\n", list("internal"), "\n"), #> `vector-construction.Rd` = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-new.R", #> "\n", list("vector-construction"), "\n", list("vector-construction"), #> "\n", list("lgl"), "\n", list("int"), "\n", list( #> "dbl"), "\n", list("cpl"), "\n", list("chr"), #> "\n", list("bytes"), "\n", list("ll"), "\n", list( #> "Create vectors"), "\n", list("\n", "lgl(...)\n", #> "\n", "int(...)\n", "\n", "dbl(...)\n", "\n", #> "cpl(...)\n", "\n", "chr(...)\n", "\n", "bytes(...)\n"), #> "\n", list("\n", list(list("..."), list("Components of the new vector. Bare lists and explicitly\n", #> "spliced lists are spliced.")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "The atomic vector constructors are equivalent to ", #> list(list("c()")), " but:\n", list("\n", list(), #> " They allow you to be more explicit about the output\n", #> "type. Implicit coercions (e.g. from integer to logical) follow\n", #> "the rules described in ", list("vector-coercion"), #> ".\n", list(), " They use ", list("tidy dots"), #> " and thus support splicing with ", list("!!!"), #> ".\n"), "\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", list("\n", list(), " All the abbreviated constructors such as ", #> list("lgl()"), " will probably be\n", "moved to the vctrs package at some point. This is why they are\n", #> "marked as questioning.\n", list(), " Automatic splicing is soft-deprecated and will trigger a warning\n", #> "in a future version. Please splice explicitly with ", #> list("!!!"), ".\n"), "\n")), "\n", "\n", list( #> "\n", "# These constructors are like a typed version of c():\n", #> "c(TRUE, FALSE)\n", "lgl(TRUE, FALSE)\n", "\n", #> "# They follow a restricted set of coercion rules:\n", #> "int(TRUE, FALSE, 20)\n", "\n", "# Lists can be spliced:\n", #> "dbl(10, !!! list(1, 2L), TRUE)\n", "\n", "\n", #> "# They splice names a bit differently than c(). The latter\n", #> "# automatically composes inner and outer names:\n", #> "c(a = c(A = 10), b = c(B = 20, C = 30))\n", #> "\n", "# On the other hand, rlang's ctors use the inner names and issue a\n", #> "# warning to inform the user that the outer names are ignored:\n", #> "dbl(a = c(A = 10), b = c(B = 20, C = 30))\n", #> "dbl(a = c(1, 2))\n", "\n", "# As an exception, it is allowed to provide an outer name when the\n", #> "# inner vector is an unnamed scalar atomic:\n", #> "dbl(a = 1)\n", "\n", "# Spliced lists behave the same way:\n", #> "dbl(!!! list(a = 1))\n", "dbl(!!! list(a = c(A = 1)))\n", #> "\n", "# bytes() accepts integerish inputs\n", #> "bytes(1:10)\n", "bytes(0x01, 0xff, c(0x03, 0x05), list(10, 20, 30L))\n"), #> "\n"), `vector-old-ctors.Rd` = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("node"), "\n", list("node"), "\n", list( #> "vector-old-ctors"), "\n", list("lgl_len"), "\n", #> list("int_len"), "\n", list("dbl_len"), "\n", list( #> "chr_len"), "\n", list("cpl_len"), "\n", list( #> "raw_len"), "\n", list("bytes_len"), "\n", list( #> "list_len"), "\n", list("lgl_along"), "\n", list( #> "int_along"), "\n", list("dbl_along"), "\n", #> list("chr_along"), "\n", list("cpl_along"), "\n", #> list("raw_along"), "\n", list("bytes_along"), "\n", #> list("list_along"), "\n", list("Retired vector construction by length"), #> "\n", list("\n", "node(car, cdr = NULL)\n", "\n", #> "lgl_len(.n)\n", "\n", "int_len(.n)\n", "\n", #> "dbl_len(.n)\n", "\n", "chr_len(.n)\n", "\n", #> "cpl_len(.n)\n", "\n", "raw_len(.n)\n", "\n", #> "bytes_len(.n)\n", "\n", "list_len(.n)\n", "\n", #> "lgl_along(.x)\n", "\n", "int_along(.x)\n", "\n", #> "dbl_along(.x)\n", "\n", "chr_along(.x)\n", "\n", #> "cpl_along(.x)\n", "\n", "raw_along(.x)\n", "\n", #> "bytes_along(.x)\n", "\n", "list_along(.x)\n"), #> "\n", list("\n", list(list(".x"), list("A vector.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions were deprecated and renamed with ", #> list("new_"), " prefix in\n", "rlang 0.2.0. This is for consistency with other non-variadic object\n", #> "constructors.\n"), "\n", list("internal"), "\n"), #> with_abort.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-entrace.R", #> "\n", list("with_abort"), "\n", list("with_abort"), #> "\n", list("Promote all errors to rlang errors"), #> "\n", list("\n", "with_abort(expr, classes = \"error\")\n"), #> "\n", list("\n", list(list("expr"), list("An expression run in a context where errors are\n", #> "promoted to rlang errors.")), "\n", "\n", list( #> list("classes"), list("Character vector of condition classes that should be\n", #> "promoted to rlang errors.")), "\n"), "\n", #> list("\n", list("with_abort()"), " promotes conditions as if they were thrown with\n", #> list(list("abort()")), ". These errors embed a ", #> list("backtrace"), ". They are\n", "particularly suitable to be set as ", #> list("parent errors"), " (see ", list("parent"), #> "\n", "argument of ", list(list("abort()")), #> ").\n"), "\n", list("\n", list("with_abort()"), #> " installs a ", list("calling handler"), " for errors and\n", #> "rethrows non-rlang errors with ", list(list( #> "abort()")), ". However, error handlers\n", #> "installed ", list("within"), " ", list("with_abort()"), #> " have priority. For this reason,\n", "you should use ", #> list(list("tryCatch()")), " and ", list("exiting"), #> " handlers outside\n", list("with_abort()"), #> " rather than inside.\n"), "\n", list("\n", "# with_abort() automatically casts simple errors thrown by stop()\n", #> "# to rlang errors. It is is handy for rethrowing low level\n", #> "# errors. The backtraces are then segmented between the low level\n", #> "# and high level contexts.\n", "f <- function() g()\n", #> "g <- function() stop(\"Low level error\")\n", #> "\n", "high_level <- function() {\n", " with_handlers(\n", #> " with_abort(f()),\n", " error = ~ abort(\"High level error\", parent = .)\n", #> " )\n", "}\n"), "\n"), with_env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval.R", #> "\n", list("with_env"), "\n", list("with_env"), "\n", #> list("locally"), "\n", list("Evaluate an expression within a given environment"), #> "\n", list("\n", "with_env(env, expr)\n", "\n", "locally(expr)\n"), #> "\n", list("\n", list(list("env"), list("An environment within which to evaluate ", #> list("expr"), ". Can be\n", "an object with a ", #> list(list("get_env()")), " method.")), "\n", #> "\n", list(list("expr"), list("An expression to evaluate.")), #> "\n"), "\n", list("\n", "These functions evaluate ", #> list("expr"), " within a given environment (", #> list("env"), "\n", "for ", list("with_env()"), #> ", or the child of the current environment for\n", #> list("locally"), "). They rely on ", list(list( #> "eval_bare()")), " which features a lighter\n", #> "evaluation mechanism than base R ", list(list( #> "base::eval()")), ", and which also has\n", #> "some subtle implications when evaluting stack sensitive functions\n", #> "(see help for ", list(list("eval_bare()")), #> ").\n"), "\n", list("\n", list("locally()"), #> " is equivalent to the base function\n", list( #> list("base::local()")), " but it produces a much cleaner\n", #> "evaluation stack, and has stack-consistent semantics. It is thus\n", #> "more suited for experimenting with the R language.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "These functions are experimental. Expect API changes.\n")), #> "\n", "\n", list("\n", "# with_env() is handy to create formulas with a given environment:\n", #> "env <- child_env(\"rlang\")\n", "f <- with_env(env, ~new_formula())\n", #> "identical(f_env(f), env)\n", "\n", "# Or functions with a given enclosure:\n", #> "fn <- with_env(env, function() NULL)\n", "identical(get_env(fn), env)\n", #> "\n", "\n", "# Unlike eval() it doesn't create duplicates on the evaluation\n", #> "# stack. You can thus use it e.g. to create non-local returns:\n", #> "fn <- function() {\n", " g(current_env())\n", #> " \"normal return\"\n", "}\n", "g <- function(env) {\n", #> " with_env(env, return(\"early return\"))\n", #> "}\n", "fn()\n", "\n", "\n", "# Since env is passed to as_environment(), it can be any object with an\n", #> "# as_environment() method. For strings, the pkg_env() is returned:\n", #> "with_env(\"base\", ~mtcars)\n", "\n", "# This can be handy to put dictionaries in scope:\n", #> "with_env(mtcars, cyl)\n"), "\n"), with_handlers.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-handlers.R", #> "\n", list("with_handlers"), "\n", list("with_handlers"), #> "\n", list("calling"), "\n", list("Establish handlers on the stack"), #> "\n", list("\n", "with_handlers(.expr, ...)\n", "\n", #> "calling(handler)\n"), "\n", list("\n", list( #> list(".expr"), list("An expression to execute in a context where new\n", #> "handlers are established. The underscored version takes a quoted\n", #> "expression or a quoted formula.")), "\n", #> "\n", list(list("..."), list("Named handlers. These should be functions of one\n", #> "argument. These handlers are treated as exiting by default. Use\n", #> list(list("calling()")), " to specify a calling handler. These dots support\n", #> list("tidy dots"), " features and are passed to ", #> list(list("as_function()")), "\n", "to enable the formula shortcut for lambda functions.")), #> "\n", "\n", list(list("handler"), list("A handler function that takes a condition as\n", #> "argument. This is passed to ", list(list("as_function()")), #> " and can thus be a\n", "formula describing a lambda function.")), #> "\n"), "\n", list("\n", "Condition handlers are functions established on the evaluation\n", #> "stack (see ", list(list("ctxt_stack()")), ") that are called by R when a condition is\n", #> "signalled (see ", list(list("cnd_signal()")), #> " and ", list(list("abort()")), " for two common signal\n", #> "functions). They come in two types:\n", list( #> "\n", list(), " Exiting handlers aborts all code currently run between\n", #> list("with_handlers()"), " and the point where the condition has been\n", #> "raised. ", list("with_handlers()"), " passes the return value of the handler\n", #> "to its caller.\n", list(), " Calling handlers, which are executed from inside the signalling\n", #> "functions. Their return values are ignored, only their side\n", #> "effects matters. Valid side effects are writing a log message, or\n", #> "jumping out of the signalling context by ", #> list("invoking a restart"), " or using ", list( #> list("return_from()")), ". If the raised\n", #> "condition was an error, this interrupts the aborting process.\n", #> "\n", "If a calling handler returns normally, it effectively declines to\n", #> "handle the condition and other handlers on the stack (calling or\n", #> "exiting) are given a chance to handle the condition.\n"), #> "\n", "\n", "Handlers are exiting by default, use ", #> list(list("calling()")), " to create a\n", "calling handler.\n"), #> "\n", list(list("Life cycle"), list("\n", " ", list( #> "exiting()"), " is soft-deprecated as of rlang\n", #> "0.4.0 because ", list(list("with_handlers()")), #> " now treats handlers as exiting by\n", "default.\n")), #> "\n", "\n", list("\n", "# Signal a condition with signal():\n", #> "fn <- function() {\n", " g()\n", " cat(\"called?\\n\")\n", #> " \"fn() return value\"\n", "}\n", "g <- function() {\n", #> " h()\n", " cat(\"called?\\n\")\n", "}\n", #> "h <- function() {\n", " signal(\"A foobar condition occurred\", \"foo\")\n", #> " cat(\"called?\\n\")\n", "}\n", "\n", "# Exiting handlers jump to with_handlers() before being\n", #> "# executed. Their return value is handed over:\n", #> "handler <- function(c) \"handler return value\"\n", #> "with_handlers(fn(), foo = handler)\n", "\n", #> "# Calling handlers are called in turn and their return value is\n", #> "# ignored. Returning just means they are declining to take charge of\n", #> "# the condition. However, they can produce side-effects such as\n", #> "# displaying a message:\n", "some_handler <- function(c) cat(\"some handler!\\n\")\n", #> "other_handler <- function(c) cat(\"other handler!\\n\")\n", #> "with_handlers(fn(), foo = calling(some_handler), foo = calling(other_handler))\n", #> "\n", "# If a calling handler jumps to an earlier context, it takes\n", #> "# charge of the condition and no other handler gets a chance to\n", #> "# deal with it. The canonical way of transferring control is by\n", #> "# jumping to a restart. See with_restarts() and restarting()\n", #> "# documentation for more on this:\n", "exiting_handler <- function(c) rst_jump(\"rst_foo\")\n", #> "fn2 <- function() {\n", " with_restarts(g(), rst_foo = function() \"restart value\")\n", #> "}\n", "with_handlers(fn2(), foo = calling(exiting_handler), foo = calling(other_handler))\n"), #> "\n"), with_restarts.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-restarts.R", #> "\n", list("with_restarts"), "\n", list("with_restarts"), #> "\n", list("Establish a restart point on the stack"), #> "\n", list("\n", "with_restarts(.expr, ...)\n"), #> "\n", list("\n", list(list(".expr"), list("An expression to execute with new restarts established\n", #> "on the stack. This argument is passed by expression and supports\n", #> list("unquoting"), ". It is evaluated in a context where\n", #> "restarts are established.")), "\n", "\n", list( #> list("..."), list("Named restart functions. The name is taken as the\n", #> "restart name and the function is executed after the jump. These\n", #> "dots support ", list("tidy dots"), " features.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "Restart points are named functions that are established with\n", #> list("with_restarts()"), ". Once established, you can interrupt the normal\n", #> "execution of R code, jump to the restart, and resume execution from\n", #> "there. Each restart is established along with a restart function\n", #> "that is executed after the jump and that provides a return value\n", #> "from the establishing point (i.e., a return value for\n", #> list("with_restarts()"), ").\n"), "\n", list( #> "\n", "Restarts are not the only way of jumping to a previous call frame\n", #> "(see ", list(list("return_from()")), " or ", #> list(list("return_to()")), "). However, they have the\n", #> "advantage of being callable by name once established.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "All the restart functions are in the questioning stage. It is not\n", #> "clear yet whether we want to recommend restarts as a style of\n", #> "programming in R.\n")), "\n", "\n", list("\n", #> "# Restarts are not the only way to jump to a previous frame, but\n", #> "# they have the advantage of being callable by name:\n", #> "fn <- function() with_restarts(g(), my_restart = function() \"returned\")\n", #> "g <- function() h()\n", "h <- function() { rst_jump(\"my_restart\"); \"not returned\" }\n", #> "fn()\n", "\n", "# Whereas a non-local return requires to manually pass the calling\n", #> "# frame to the return function:\n", "fn <- function() g(current_env())\n", #> "g <- function(env) h(env)\n", "h <- function(env) { return_from(env, \"returned\"); \"not returned\" }\n", #> "fn()\n", "\n", "\n", "# rst_maybe_jump() checks that a restart exists before trying to jump:\n", #> "fn <- function() {\n", " g()\n", " cat(\"will this be called?\\n\")\n", #> "}\n", "g <- function() {\n", " rst_maybe_jump(\"my_restart\")\n", #> " cat(\"will this be called?\\n\")\n", "}\n", #> "\n", "# Here no restart are on the stack:\n", #> "fn()\n", "\n", "# If a restart point called `my_restart` was established on the\n", #> "# stack before calling fn(), the control flow will jump there:\n", #> "rst <- function() {\n", " cat(\"restarting...\\n\")\n", #> " \"return value\"\n", "}\n", "with_restarts(fn(), my_restart = rst)\n", #> "\n", "\n", "# Restarts are particularly useful to provide alternative default\n", #> "# values when the normal output cannot be computed:\n", #> "\n", "fn <- function(valid_input) {\n", " if (valid_input) {\n", #> " return(\"normal value\")\n", " }\n", "\n", #> " # We decide to return the empty string \"\" as default value. An\n", #> " # altenative strategy would be to signal an error. In any case,\n", #> " # we want to provide a way for the caller to get a different\n", #> " # output. For this purpose, we provide two restart functions that\n", #> " # returns alternative defaults:\n", " restarts <- list(\n", #> " rst_empty_chr = function() character(0),\n", #> " rst_null = function() NULL\n", " )\n", #> "\n", " with_restarts(splice(restarts), .expr = {\n", #> "\n", " # Signal a typed condition to let the caller know that we are\n", #> " # about to return an empty string as default value:\n", #> " cnd_signal(\"default_empty_string\")\n", #> "\n", " # If no jump to with_restarts, return default value:\n", #> " \"\"\n", " })\n", "}\n", "\n", "# Normal value for valid input:\n", #> "fn(TRUE)\n", "\n", "# Default value for bad input:\n", #> "fn(FALSE)\n", "\n", "# Change the default value if you need an empty character vector by\n", #> "# defining a calling handler that jumps to the restart. It has to\n", #> "# be calling because exiting handlers jump to the place where they\n", #> "# are established before being executed, and the restart is not\n", #> "# defined anymore at that point:\n", "rst_handler <- calling(function(c) rst_jump(\"rst_empty_chr\"))\n", #> "with_handlers(fn(FALSE), default_empty_string = rst_handler)\n", #> "\n", "# You can use restarting() to create restarting handlers easily:\n", #> "with_handlers(fn(FALSE), default_empty_string = restarting(\"rst_null\"))\n"), #> "\n", list("\n", list(list("return_from()")), " and ", #> list(list("return_to()")), " for a more flexible way\n", #> "of performing a non-local jump to an arbitrary call frame.\n"), #> "\n"), wref_key.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/weakref.R", #> "\n", list("wref_key"), "\n", list("wref_key"), "\n", #> list("wref_value"), "\n", list("Get key/value from a weak reference object"), #> "\n", list("\n", "wref_key(x)\n", "\n", "wref_value(x)\n"), #> "\n", list("\n", list(list("x"), list("A weak reference object.")), #> "\n"), "\n", list("\n", "Get key/value from a weak reference object\n"), #> "\n", list("\n", list(list("is_weakref()")), " and ", #> list(list("new_weakref()")), ".\n"), "\n"), zap.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/s3.R", "\n", list( #> "zap"), "\n", list("zap"), "\n", list("is_zap"), #> "\n", list("Create zap objects"), "\n", list("\n", #> "zap()\n", "\n", "is_zap(x)\n"), "\n", list("\n", #> list(list("x"), list("An object to test.")), #> "\n"), "\n", list("\n", list("zap()"), " creates a sentinel object that indicates that an object\n", #> "should be removed. For instance, named zaps instruct ", #> list(list("env_bind()")), "\n", "and ", list( #> list("call_modify()")), " to remove those objects from the environment or\n", #> "the call.\n", "\n", "The advantage of zap objects is that they unambiguously signal the\n", #> "intent of removing an object. Sentinels like ", #> list("NULL"), " or\n", list(list("missing_arg()")), #> " are ambiguous because they represent valid R\n", #> "objects.\n"), "\n", list("\n", "# Create one zap object:\n", #> "zap()\n", "\n", "# Create a list of zaps:\n", #> "rep(list(zap()), 3)\n", "rep_named(c(\"foo\", \"bar\"), list(zap()))\n"), #> "\n")), source = list(abort.Rd = c("R/cnd-abort.R", #> "R/cnd-signal.R"), are_na.Rd = "R/vec-na.R", arg_match.Rd = "R/arg.R", #> as_box.Rd = "R/s3.R", as_bytes.Rd = "R/utils-encoding.R", #> as_data_mask.Rd = "R/eval-tidy.R", as_env.Rd = "R/lifecycle-retired.R", #> as_environment.Rd = "R/env.R", as_function.Rd = "R/fn.R", #> as_label.Rd = "R/deparse.R", as_name.Rd = "R/deparse.R", #> as_overscope.Rd = "R/lifecycle-retired.R", as_pairlist.Rd = "R/node.R", #> as_quosure.Rd = "R/quo.R", as_string.Rd = "R/sym.R", #> as_utf8_character.Rd = "R/utils-encoding.R", `bare-type-predicates.Rd` = "R/types.R", #> box.Rd = "R/s3.R", call2.Rd = "R/call.R", call_args.Rd = "R/call.R", #> call_fn.Rd = "R/call.R", call_inspect.Rd = "R/stack.R", #> call_modify.Rd = "R/call.R", call_name.Rd = "R/call.R", #> call_standardise.Rd = "R/call.R", caller_env.Rd = "R/env-special.R", #> caller_fn.Rd = "R/stack.R", caller_frame.Rd = "R/lifecycle-retired.R", #> catch_cnd.Rd = "R/cnd-handlers.R", chr_unserialise_unicode.Rd = "R/utils-encoding.R", #> cnd.Rd = c("R/cnd-error.R", "R/cnd.R"), cnd_message.Rd = "R/cnd-message.R", #> cnd_muffle.Rd = "R/cnd-handlers.R", cnd_signal.Rd = "R/cnd-signal.R", #> cnd_type.Rd = "R/cnd.R", done.Rd = "R/s3.R", dots_definitions.Rd = "R/dots.R", #> dots_n.Rd = "R/dots.R", dots_values.Rd = "R/dots.R", #> duplicate.Rd = "R/sexp.R", empty_env.Rd = "R/env-special.R", #> entrace.Rd = "R/cnd-entrace.R", env.Rd = "R/env.R", env_bind.Rd = "R/env-binding.R", #> env_bind_exprs.Rd = "R/lifecycle-retired.R", env_binding_are_active.Rd = "R/env-binding.R", #> env_binding_lock.Rd = "R/env-binding.R", env_bury.Rd = "R/env-binding.R", #> env_clone.Rd = "R/env.R", env_depth.Rd = "R/env.R", env_get.Rd = "R/env-binding.R", #> env_has.Rd = "R/env-binding.R", env_inherits.Rd = "R/env.R", #> env_lock.Rd = "R/env.R", env_name.Rd = "R/env-special.R", #> env_names.Rd = "R/env-binding.R", env_parent.Rd = "R/env.R", #> env_poke.Rd = "R/env-binding.R", env_print.Rd = "R/env.R", #> env_unbind.Rd = "R/env-binding.R", env_unlock.Rd = "R/env.R", #> eval_bare.Rd = "R/eval.R", eval_tidy.Rd = "R/eval-tidy.R", #> exec.Rd = "R/eval.R", exiting.Rd = "R/lifecycle-retired.R", #> expr_interp.Rd = "R/quasiquotation.R", expr_label.Rd = "R/expr.R", #> expr_print.Rd = "R/expr.R", exprs_auto_name.Rd = "R/quotation.R", #> f_rhs.Rd = "R/formula.R", f_text.Rd = "R/formula.R", #> flatten.Rd = "R/vec-squash.R", fn_body.Rd = "R/fn.R", #> fn_env.Rd = "R/fn.R", fn_fmls.Rd = "R/fn.R", frame_position.Rd = "R/lifecycle-retired.R", #> friendly_type.Rd = "R/types.R", get_env.Rd = "R/env.R", #> has_length.Rd = "R/attr.R", has_name.Rd = "R/attr.R", #> inherits_any.Rd = "R/s3.R", invoke.Rd = "R/eval.R", is_call.Rd = "R/call.R", #> is_callable.Rd = "R/call.R", is_condition.Rd = "R/cnd.R", #> is_copyable.Rd = "R/types.R", is_empty.Rd = "R/types.R", #> is_env.Rd = "R/lifecycle-retired.R", is_environment.Rd = "R/types.R", #> is_expr.Rd = "R/lifecycle-retired.R", is_expression.Rd = "R/expr.R", #> is_formula.Rd = "R/formula.R", is_frame.Rd = "R/lifecycle-retired.R", #> is_function.Rd = "R/fn.R", is_installed.Rd = "R/env-special.R", #> is_integerish.Rd = "R/types.R", is_interactive.Rd = "R/state.R", #> is_lang.Rd = "R/lifecycle-retired.R", is_named.Rd = "R/attr.R", #> is_namespace.Rd = "R/env-special.R", is_pairlist.Rd = "R/node.R", #> is_reference.Rd = "R/types.R", is_stack.Rd = "R/lifecycle-retired.R", #> is_symbol.Rd = "R/sym.R", is_true.Rd = "R/types.R", is_weakref.Rd = "R/weakref.R", #> lang.Rd = "R/lifecycle-retired.R", lang_head.Rd = "R/lifecycle-retired.R", #> lang_modify.Rd = "R/lifecycle-retired.R", last_error.Rd = "R/cnd-abort.R", #> lifecycle.Rd = "R/lifecycle.R", missing.Rd = "R/vec-na.R", #> missing_arg.Rd = "R/arg.R", mut_node_car.Rd = "R/lifecycle-retired.R", #> names2.Rd = "R/attr.R", `new-vector-along-retired.Rd` = "R/lifecycle-retired.R", #> `new-vector.Rd` = "R/vec-new.R", new_call.Rd = "R/node.R", #> new_formula.Rd = "R/formula.R", new_function.Rd = "R/fn.R", #> new_node.Rd = "R/node.R", new_quosures.Rd = "R/quo.R", #> new_weakref.Rd = "R/weakref.R", ns_env.Rd = "R/env-special.R", #> `op-definition.Rd` = "R/operators.R", `op-get-attr.Rd` = "R/operators.R", #> `op-na-default.Rd` = "R/operators.R", `op-null-default.Rd` = "R/operators.R", #> overscope_eval_next.Rd = "R/lifecycle-retired.R", pairlist2.Rd = "R/call.R", #> parse_expr.Rd = "R/parse.R", parse_quosure.Rd = "R/lifecycle-retired.R", #> prepend.Rd = "R/lifecycle-retired.R", prim_name.Rd = "R/fn.R", #> quasiquotation.Rd = "R/quasiquotation.R", quo_expr.Rd = "R/lifecycle-retired.R", #> quo_label.Rd = "R/quo.R", quo_squash.Rd = "R/quo.R", #> quosure.Rd = "R/quo.R", quotation.Rd = "R/quotation.R", #> rep_along.Rd = "R/vec-new.R", restarting.Rd = "R/cnd-handlers.R", #> return_from.Rd = "R/stack.R", rlang_backtrace_on_error.Rd = "R/cnd-abort.R", #> rst_abort.Rd = "R/cnd-restarts.R", rst_list.Rd = "R/cnd-restarts.R", #> `scalar-type-predicates.Rd` = "R/types.R", scoped_bindings.Rd = "R/env-binding.R", #> scoped_env.Rd = "R/lifecycle-retired.R", scoped_options.Rd = "R/state.R", #> search_envs.Rd = "R/env-special.R", seq2.Rd = "R/vec.R", #> set_attrs.Rd = "R/lifecycle-retired.R", set_expr.Rd = "R/expr.R", #> set_names.Rd = "R/attr.R", splice.Rd = "R/dots.R", stack.Rd = "R/lifecycle-retired.R", #> stack_trim.Rd = "R/lifecycle-retired.R", string.Rd = "R/utils-encoding.R", #> switch_type.Rd = "R/lifecycle-retired.R", sym.Rd = "R/sym.R", #> `tidy-dots.Rd` = c("R/dots.R", "R/vec-new.R"), `tidyeval-data.Rd` = "R/eval-tidy.R", #> trace_back.Rd = "R/trace.R", `type-predicates.Rd` = "R/types.R", #> type_of.Rd = "R/lifecycle-retired.R", vec_poke_n.Rd = "R/vec.R", #> `vector-coercion.Rd` = "R/lifecycle-retired.R", `vector-construction.Rd` = "R/vec-new.R", #> `vector-old-ctors.Rd` = "R/lifecycle-retired.R", with_abort.Rd = "R/cnd-entrace.R", #> with_env.Rd = "R/eval.R", with_handlers.Rd = "R/cnd-handlers.R", #> with_restarts.Rd = "R/cnd-restarts.R", wref_key.Rd = "R/weakref.R", #> zap.Rd = "R/s3.R"), concepts = list(abort.Rd = character(0), #> are_na.Rd = character(0), arg_match.Rd = character(0), #> as_box.Rd = character(0), as_bytes.Rd = character(0), #> as_data_mask.Rd = character(0), as_env.Rd = character(0), #> as_environment.Rd = character(0), as_function.Rd = character(0), #> as_label.Rd = character(0), as_name.Rd = character(0), #> as_overscope.Rd = character(0), as_pairlist.Rd = character(0), #> as_quosure.Rd = character(0), as_string.Rd = character(0), #> as_utf8_character.Rd = character(0), `bare-type-predicates.Rd` = character(0), #> box.Rd = character(0), call2.Rd = character(0), call_args.Rd = character(0), #> call_fn.Rd = character(0), call_inspect.Rd = character(0), #> call_modify.Rd = character(0), call_name.Rd = character(0), #> call_standardise.Rd = character(0), caller_env.Rd = character(0), #> caller_fn.Rd = character(0), caller_frame.Rd = character(0), #> catch_cnd.Rd = character(0), chr_unserialise_unicode.Rd = character(0), #> cnd.Rd = character(0), cnd_message.Rd = character(0), #> cnd_muffle.Rd = character(0), cnd_signal.Rd = character(0), #> cnd_type.Rd = character(0), done.Rd = character(0), dots_definitions.Rd = character(0), #> dots_n.Rd = character(0), dots_values.Rd = character(0), #> duplicate.Rd = character(0), empty_env.Rd = character(0), #> entrace.Rd = character(0), env.Rd = character(0), env_bind.Rd = character(0), #> env_bind_exprs.Rd = character(0), env_binding_are_active.Rd = character(0), #> env_binding_lock.Rd = character(0), env_bury.Rd = character(0), #> env_clone.Rd = character(0), env_depth.Rd = character(0), #> env_get.Rd = character(0), env_has.Rd = character(0), #> env_inherits.Rd = character(0), env_lock.Rd = character(0), #> env_name.Rd = character(0), env_names.Rd = character(0), #> env_parent.Rd = character(0), env_poke.Rd = character(0), #> env_print.Rd = character(0), env_unbind.Rd = character(0), #> env_unlock.Rd = character(0), eval_bare.Rd = character(0), #> eval_tidy.Rd = character(0), exec.Rd = character(0), #> exiting.Rd = character(0), expr_interp.Rd = character(0), #> expr_label.Rd = character(0), expr_print.Rd = character(0), #> exprs_auto_name.Rd = character(0), f_rhs.Rd = character(0), #> f_text.Rd = character(0), flatten.Rd = character(0), #> fn_body.Rd = character(0), fn_env.Rd = character(0), #> fn_fmls.Rd = character(0), frame_position.Rd = character(0), #> friendly_type.Rd = character(0), get_env.Rd = character(0), #> has_length.Rd = character(0), has_name.Rd = character(0), #> inherits_any.Rd = character(0), invoke.Rd = character(0), #> is_call.Rd = character(0), is_callable.Rd = character(0), #> is_condition.Rd = character(0), is_copyable.Rd = character(0), #> is_empty.Rd = character(0), is_env.Rd = character(0), #> is_environment.Rd = character(0), is_expr.Rd = character(0), #> is_expression.Rd = character(0), is_formula.Rd = character(0), #> is_frame.Rd = character(0), is_function.Rd = character(0), #> is_installed.Rd = character(0), is_integerish.Rd = character(0), #> is_interactive.Rd = character(0), is_lang.Rd = character(0), #> is_named.Rd = character(0), is_namespace.Rd = character(0), #> is_pairlist.Rd = character(0), is_reference.Rd = character(0), #> is_stack.Rd = character(0), is_symbol.Rd = character(0), #> is_true.Rd = character(0), is_weakref.Rd = character(0), #> lang.Rd = character(0), lang_head.Rd = character(0), #> lang_modify.Rd = character(0), last_error.Rd = character(0), #> lifecycle.Rd = character(0), missing.Rd = character(0), #> missing_arg.Rd = character(0), mut_node_car.Rd = character(0), #> names2.Rd = character(0), `new-vector-along-retired.Rd` = character(0), #> `new-vector.Rd` = character(0), new_call.Rd = character(0), #> new_formula.Rd = character(0), new_function.Rd = character(0), #> new_node.Rd = character(0), new_quosures.Rd = character(0), #> new_weakref.Rd = character(0), ns_env.Rd = character(0), #> `op-definition.Rd` = character(0), `op-get-attr.Rd` = character(0), #> `op-na-default.Rd` = character(0), `op-null-default.Rd` = character(0), #> overscope_eval_next.Rd = character(0), pairlist2.Rd = character(0), #> parse_expr.Rd = character(0), parse_quosure.Rd = character(0), #> prepend.Rd = character(0), prim_name.Rd = character(0), #> quasiquotation.Rd = character(0), quo_expr.Rd = character(0), #> quo_label.Rd = character(0), quo_squash.Rd = character(0), #> quosure.Rd = character(0), quotation.Rd = character(0), #> rep_along.Rd = character(0), restarting.Rd = character(0), #> return_from.Rd = character(0), rlang_backtrace_on_error.Rd = character(0), #> rst_abort.Rd = character(0), rst_list.Rd = character(0), #> `scalar-type-predicates.Rd` = character(0), scoped_bindings.Rd = character(0), #> scoped_env.Rd = character(0), scoped_options.Rd = character(0), #> search_envs.Rd = character(0), seq2.Rd = character(0), #> set_attrs.Rd = character(0), set_expr.Rd = character(0), #> set_names.Rd = character(0), splice.Rd = character(0), #> stack.Rd = character(0), stack_trim.Rd = character(0), #> string.Rd = character(0), switch_type.Rd = character(0), #> sym.Rd = character(0), `tidy-dots.Rd` = character(0), #> `tidyeval-data.Rd` = character(0), trace_back.Rd = character(0), #> `type-predicates.Rd` = character(0), type_of.Rd = character(0), #> vec_poke_n.Rd = character(0), `vector-coercion.Rd` = character(0), #> `vector-construction.Rd` = character(0), `vector-old-ctors.Rd` = character(0), #> with_abort.Rd = character(0), with_env.Rd = character(0), #> with_handlers.Rd = character(0), with_restarts.Rd = character(0), #> wref_key.Rd = character(0), zap.Rd = character(0)), internal = c(FALSE, #> FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, #> FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, #> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, #> FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, #> FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, #> TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, #> FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, #> TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, #> FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, #> FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, #> FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, #> TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, #> FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, #> FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, #> FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, #> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, #> FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, #> FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, #> FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, #> FALSE, FALSE, FALSE, FALSE)), tutorials = list(name = character(0), #> file_out = character(0), title = character(0), pagetitle = character(0), #> url = character(0)), vignettes = list(name = character(0), #> file_in = character(0), file_out = character(0), title = character(0)), #> topic_index = c(`:=` = "quasiquotation", `!!` = "quasiquotation", #> `!!!` = "quasiquotation", .data = "tidyeval-data", `%@%` = "op-get-attr", #> `%@%<-` = "op-get-attr", `%|%` = "op-na-default", `%||%` = "op-null-default", #> abort = "abort", add_backtrace = "rlang_backtrace_on_error", #> are_na = "are_na", arg_match = "arg_match", as_box = "as_box", #> as_box_if = "as_box", as_bytes = "as_bytes", as_character = "vector-coercion", #> as_closure = "as_function", as_complex = "vector-coercion", #> as_data_mask = "as_data_mask", as_data_pronoun = "as_data_mask", #> as_double = "vector-coercion", as_env = "as_env", as_environment = "as_environment", #> as_function = "as_function", as_integer = "vector-coercion", #> as_label = "as_label", as_list = "vector-coercion", as_logical = "vector-coercion", #> as_name = "as_name", as_overscope = "as_overscope", as_pairlist = "as_pairlist", #> as_quosure = "as_quosure", as_quosures = "new_quosures", #> as_string = "as_string", as_utf8_character = "as_utf8_character", #> `bare-type-predicates` = "bare-type-predicates", base_env = "search_envs", #> box = "box", bytes = "vector-construction", bytes_along = "vector-old-ctors", #> bytes_len = "vector-old-ctors", call_args = "call_args", #> call_args_names = "call_args", call_depth = "stack", call_fn = "call_fn", #> call_frame = "stack", call_inspect = "call_inspect", call_modify = "call_modify", #> call_name = "call_name", call_ns = "call_name", call_stack = "stack", #> call_standardise = "call_standardise", call2 = "call2", caller_env = "caller_env", #> caller_fn = "caller_fn", caller_frame = "caller_frame", calling = "with_handlers", #> catch_cnd = "catch_cnd", child_env = "env", chr = "vector-construction", #> chr_along = "vector-old-ctors", chr_len = "vector-old-ctors", #> chr_unserialise_unicode = "chr_unserialise_unicode", cnd = "cnd", #> cnd_bullets = "cnd_message", cnd_entrace = "entrace", cnd_issue = "cnd_message", #> cnd_message = "cnd_message", cnd_muffle = "cnd_muffle", cnd_signal = "cnd_signal", #> cnd_type = "cnd_type", coerce_class = "switch_type", coerce_type = "switch_type", #> cpl = "vector-construction", cpl_along = "vector-old-ctors", #> cpl_len = "vector-old-ctors", ctxt_depth = "stack", ctxt_frame = "stack", #> ctxt_stack = "stack", current_env = "caller_env", current_fn = "caller_fn", #> current_frame = "stack", dbl = "vector-construction", dbl_along = "vector-old-ctors", #> dbl_len = "vector-old-ctors", done = "done", dots_definitions = "dots_definitions", #> dots_list = "tidy-dots", dots_n = "dots_n", dots_splice = "splice", #> dots_values = "dots_values", duplicate = "duplicate", empty_env = "empty_env", #> enexpr = "quotation", enexprs = "quotation", enquo = "quotation", #> enquos = "quotation", ensym = "quotation", ensyms = "quotation", #> entrace = "entrace", env = "env", env_bind = "env_bind", #> env_bind_active = "env_bind", env_bind_exprs = "env_bind_exprs", #> env_bind_fns = "env_bind_exprs", env_bind_lazy = "env_bind", #> env_binding_are_active = "env_binding_are_active", env_binding_are_lazy = "env_binding_are_active", #> env_binding_are_locked = "env_binding_lock", env_binding_lock = "env_binding_lock", #> env_binding_unlock = "env_binding_lock", env_bury = "env_bury", #> env_clone = "env_clone", env_depth = "env_depth", env_get = "env_get", #> env_get_list = "env_get", env_has = "env_has", env_inherits = "env_inherits", #> env_is_locked = "env_lock", env_label = "env_name", env_length = "env_names", #> env_lock = "env_lock", env_name = "env_name", env_names = "env_names", #> env_parent = "env_parent", env_parents = "env_parent", env_poke = "env_poke", #> env_poke_parent = "get_env", env_print = "env_print", env_tail = "env_parent", #> env_unbind = "env_unbind", env_unlock = "env_unlock", error_cnd = "cnd", #> eval_bare = "eval_bare", eval_tidy = "eval_tidy", exec = "exec", #> exiting = "exiting", expr = "quotation", expr_deparse = "expr_print", #> expr_interp = "expr_interp", expr_label = "expr_label", expr_name = "expr_label", #> expr_print = "expr_print", expr_text = "expr_label", exprs = "quotation", #> exprs_auto_name = "exprs_auto_name", f_env = "f_rhs", `f_env<-` = "f_rhs", #> f_label = "f_text", f_lhs = "f_rhs", `f_lhs<-` = "f_rhs", #> f_name = "f_text", f_rhs = "f_rhs", `f_rhs<-` = "f_rhs", #> f_text = "f_text", flatten = "flatten", flatten_chr = "flatten", #> flatten_cpl = "flatten", flatten_dbl = "flatten", flatten_if = "flatten", #> flatten_int = "flatten", flatten_lgl = "flatten", flatten_raw = "flatten", #> fn_body = "fn_body", `fn_body<-` = "fn_body", fn_env = "fn_env", #> `fn_env<-` = "fn_env", fn_fmls = "fn_fmls", fn_fmls_names = "fn_fmls", #> `fn_fmls_names<-` = "fn_fmls", fn_fmls_syms = "fn_fmls", #> `fn_fmls<-` = "fn_fmls", frame_position = "frame_position", #> friendly_type = "friendly_type", get_env = "get_env", get_expr = "set_expr", #> global_env = "search_envs", global_frame = "stack", has_length = "has_length", #> has_name = "has_name", have_name = "is_named", inform = "abort", #> inherits_all = "inherits_any", inherits_any = "inherits_any", #> inherits_only = "inherits_any", int = "vector-construction", #> int_along = "vector-old-ctors", int_len = "vector-old-ctors", #> interrupt = "abort", invoke = "invoke", is_atomic = "type-predicates", #> is_attached = "search_envs", is_bare_atomic = "bare-type-predicates", #> is_bare_bytes = "bare-type-predicates", is_bare_character = "bare-type-predicates", #> is_bare_double = "bare-type-predicates", is_bare_env = "is_env", #> is_bare_environment = "is_environment", is_bare_formula = "is_formula", #> is_bare_integer = "bare-type-predicates", is_bare_integerish = "is_integerish", #> is_bare_list = "bare-type-predicates", is_bare_logical = "bare-type-predicates", #> is_bare_numeric = "bare-type-predicates", is_bare_raw = "bare-type-predicates", #> is_bare_string = "bare-type-predicates", is_bare_vector = "bare-type-predicates", #> is_binary_lang = "is_lang", is_bool = "scalar-type-predicates", #> is_box = "box", is_bytes = "type-predicates", is_call = "is_call", #> is_call_stack = "is_stack", is_callable = "is_callable", #> is_character = "type-predicates", is_chr_na = "are_na", is_closure = "is_function", #> is_condition = "is_condition", is_copyable = "is_copyable", #> is_cpl_na = "are_na", is_dbl_na = "are_na", is_definition = "op-definition", #> is_dictionaryish = "is_named", is_done_box = "done", is_double = "type-predicates", #> is_empty = "is_empty", is_env = "is_env", is_environment = "is_environment", #> is_eval_stack = "is_stack", is_expr = "is_expr", is_expression = "is_expression", #> is_false = "is_true", is_formula = "is_formula", is_formulaish = "op-definition", #> is_frame = "is_frame", is_function = "is_function", is_installed = "is_installed", #> is_int_na = "are_na", is_integer = "type-predicates", is_integerish = "is_integerish", #> is_interactive = "is_interactive", is_lambda = "as_function", #> is_lang = "is_lang", is_lgl_na = "are_na", is_list = "type-predicates", #> is_logical = "type-predicates", is_missing = "missing_arg", #> is_na = "are_na", is_named = "is_named", is_namespace = "is_namespace", #> is_node = "is_pairlist", is_node_list = "is_pairlist", is_null = "type-predicates", #> is_pairlist = "is_pairlist", is_primitive = "is_function", #> is_primitive_eager = "is_function", is_primitive_lazy = "is_function", #> is_quosure = "quosure", is_quosures = "new_quosures", is_raw = "type-predicates", #> is_reference = "is_reference", is_scalar_atomic = "scalar-type-predicates", #> is_scalar_bytes = "scalar-type-predicates", is_scalar_character = "scalar-type-predicates", #> is_scalar_double = "scalar-type-predicates", is_scalar_integer = "scalar-type-predicates", #> is_scalar_integerish = "is_integerish", is_scalar_list = "scalar-type-predicates", #> is_scalar_logical = "scalar-type-predicates", is_scalar_raw = "scalar-type-predicates", #> is_scalar_vector = "scalar-type-predicates", is_scoped = "scoped_env", #> is_spliced = "splice", is_spliced_bare = "splice", is_stack = "is_stack", #> is_string = "scalar-type-predicates", is_symbol = "is_symbol", #> is_symbolic = "is_expression", is_syntactic_literal = "is_expression", #> is_true = "is_true", is_unary_lang = "is_lang", is_vector = "type-predicates", #> is_weakref = "is_weakref", is_zap = "zap", lang = "lang", #> lang_args = "lang_modify", lang_args_names = "lang_modify", #> lang_fn = "lang_modify", lang_head = "lang_head", lang_modify = "lang_modify", #> lang_name = "lang_modify", lang_standardise = "lang_modify", #> lang_tail = "lang_head", last_error = "last_error", last_trace = "last_error", #> lgl = "vector-construction", lgl_along = "vector-old-ctors", #> lgl_len = "vector-old-ctors", lifecycle = "lifecycle", list_along = "vector-old-ctors", #> list_len = "vector-old-ctors", list2 = "tidy-dots", ll = "vector-construction", #> locally = "with_env", maybe_missing = "missing_arg", message_cnd = "cnd", #> missing = "missing", missing_arg = "missing_arg", modify = "prepend", #> mut_attrs = "set_attrs", mut_node_caar = "mut_node_car", #> mut_node_cadr = "mut_node_car", mut_node_car = "mut_node_car", #> mut_node_cdar = "mut_node_car", mut_node_cddr = "mut_node_car", #> mut_node_cdr = "mut_node_car", mut_node_tag = "mut_node_car", #> na_chr = "missing", na_cpl = "missing", na_dbl = "missing", #> na_int = "missing", na_lgl = "missing", names2 = "names2", #> new_box = "box", new_call = "new_call", new_character = "new-vector", #> new_character_along = "new-vector-along-retired", new_complex = "new-vector", #> new_complex_along = "new-vector-along-retired", new_data_mask = "as_data_mask", #> new_definition = "op-definition", new_double = "new-vector", #> new_double_along = "new-vector-along-retired", new_environment = "env", #> new_formula = "new_formula", new_function = "new_function", #> new_integer = "new-vector", new_integer_along = "new-vector-along-retired", #> new_language = "lang", new_list = "new-vector", new_list_along = "new-vector-along-retired", #> new_logical = "new-vector", new_logical_along = "new-vector-along-retired", #> new_node = "new_node", new_overscope = "as_overscope", new_quosure = "as_quosure", #> new_quosures = "new_quosures", new_raw = "new-vector", new_raw_along = "new-vector-along-retired", #> new_weakref = "new_weakref", `new-vector` = "new-vector", #> `new-vector-along-retired` = "new-vector-along-retired", #> node = "vector-old-ctors", node_caar = "new_node", node_cadr = "new_node", #> node_car = "new_node", node_cdar = "new_node", node_cddr = "new_node", #> node_cdr = "new_node", node_poke_caar = "new_node", node_poke_cadr = "new_node", #> node_poke_car = "new_node", node_poke_cdar = "new_node", #> node_poke_cddr = "new_node", node_poke_cdr = "new_node", #> node_poke_tag = "new_node", node_tag = "new_node", ns_env = "ns_env", #> ns_env_name = "ns_env", ns_imports_env = "ns_env", `op-definition` = "op-definition", #> `op-get-attr` = "op-get-attr", `op-na-default` = "op-na-default", #> `op-null-default` = "op-null-default", overscope_clean = "as_overscope", #> overscope_eval_next = "overscope_eval_next", pairlist2 = "pairlist2", #> parse_expr = "parse_expr", parse_exprs = "parse_expr", parse_quo = "parse_expr", #> parse_quos = "parse_expr", parse_quosure = "parse_quosure", #> parse_quosures = "parse_quosure", peek_option = "scoped_options", #> peek_options = "scoped_options", pkg_env = "search_envs", #> pkg_env_name = "search_envs", prepend = "prepend", prim_name = "prim_name", #> push_options = "scoped_options", qq_show = "quasiquotation", #> quasiquotation = "quasiquotation", quo = "quotation", quo_expr = "quo_expr", #> quo_get_env = "quosure", quo_get_expr = "quosure", quo_is_call = "quosure", #> quo_is_lang = "is_lang", quo_is_missing = "quosure", quo_is_null = "quosure", #> quo_is_symbol = "quosure", quo_is_symbolic = "quosure", quo_label = "quo_label", #> quo_name = "quo_label", quo_set_env = "quosure", quo_set_expr = "quosure", #> quo_squash = "quo_squash", quo_text = "quo_label", quos = "quotation", #> quos_auto_name = "exprs_auto_name", quosure = "quosure", #> quotation = "quotation", raw_along = "vector-old-ctors", #> raw_len = "vector-old-ctors", rep_along = "rep_along", rep_named = "rep_along", #> restarting = "restarting", return_from = "return_from", return_to = "return_from", #> rlang_backtrace_on_error = "rlang_backtrace_on_error", rst_abort = "rst_abort", #> rst_exists = "rst_list", rst_jump = "rst_list", rst_list = "rst_list", #> rst_maybe_jump = "rst_list", `scalar-type-predicates` = "scalar-type-predicates", #> scoped_bindings = "scoped_bindings", scoped_env = "scoped_env", #> scoped_envs = "scoped_env", scoped_interactive = "is_interactive", #> scoped_names = "scoped_env", scoped_options = "scoped_options", #> search_env = "search_envs", search_envs = "search_envs", #> seq2 = "seq2", seq2_along = "seq2", set_attrs = "set_attrs", #> set_env = "get_env", set_expr = "set_expr", set_names = "set_names", #> signal = "abort", splice = "splice", squash = "flatten", #> squash_chr = "flatten", squash_cpl = "flatten", squash_dbl = "flatten", #> squash_if = "flatten", squash_int = "flatten", squash_lgl = "flatten", #> squash_raw = "flatten", stack = "stack", stack_trim = "stack_trim", #> string = "string", switch_class = "switch_type", switch_type = "switch_type", #> sym = "sym", syms = "sym", `tidy-dots` = "tidy-dots", `tidyeval-data` = "tidyeval-data", #> trace_back = "trace_back", trace_length = "trace_back", type_of = "type_of", #> `type-predicates` = "type-predicates", unbox = "box", UQ = "quasiquotation", #> UQS = "quasiquotation", vec_poke_n = "vec_poke_n", vec_poke_range = "vec_poke_n", #> `vector-coercion` = "vector-coercion", `vector-construction` = "vector-construction", #> `vector-old-ctors` = "vector-old-ctors", warn = "abort", #> warning_cnd = "cnd", with_abort = "with_abort", with_bindings = "scoped_bindings", #> with_env = "with_env", with_handlers = "with_handlers", with_interactive = "is_interactive", #> with_options = "scoped_options", with_restarts = "with_restarts", #> wref_key = "wref_key", wref_value = "wref_key", zap = "zap" #> ), article_index = character(0)), examples = TRUE, run_dont_run = FALSE, #> seed = 1014, lazy = FALSE, override = list(destination = "/tmp/Rtmp4B68tY/file4f2653f13748"), #> install = FALSE, preview = FALSE, new_process = FALSE, devel = FALSE, #> crayon_enabled = TRUE, crayon_colors = 256, pkgdown_internet = TRUE), #> envir = <environment>) #> #> [[12]] #> (function (..., crayon_enabled, crayon_colors, pkgdown_internet) #> { #> options(crayon.enabled = crayon_enabled, crayon.colors = crayon_colors, #> pkgdown.internet = pkgdown_internet) #> pkgdown::build_site(...) #> })(pkg = list(package = "rlang", version = list(c(0L, 4L, 0L, #> 9005L)), src_path = "/home/travis/build/r-lib/rlang", dst_path = "/tmp/Rtmp4B68tY/file4f2653f13748", #> github_url = "https://github.com/r-lib/rlang", desc = <environment>, #> meta = list(url = "https://rlang.r-lib.org", template = list( #> params = list(ganalytics = "UA-115082821-1")), home = list( #> links = list(list(text = "The tidy eval bookdown", href = "https://tidyeval.tidyverse.org"))), #> navbar = list(structure = list(left = c("home", "reference", #> "lifecycle", "news"), right = "github"), components = list( #> lifecycle = list(text = "Life cycle", href = "reference/lifecycle.html"), #> news = list(text = "News", menu = list(list(text = "Release notes"), #> list(text = "Version 0.4.0", href = "https://www.tidyverse.org/articles/2019/06/rlang-0-4-0/"), #> list(text = "Version 0.3.1", href = "https://www.tidyverse.org/articles/2019/01/rlang-0-3-1/"), #> list(text = "Version 0.3.0", href = "https://www.tidyverse.org/articles/2018/10/rlang-0-3-0/"), #> list(text = "Version 0.2.0", href = "https://www.tidyverse.org/articles/2018/03/rlang-0.2.0/"), #> list(text = "------------------"), list(text = "Change log", #> href = "news/index.html"))))), reference = list( #> list(title = "Tidy evaluation", desc = "Quote arguments and expressions with unquoting support. The quosure variants wrap an environment with the expression.\n", #> contents = c("quo", "quos", "enquo", "enquos", #> "expr", "exprs", "enexpr", "enexprs", "quasiquotation" #> )), list(title = "Tidy dots", desc = "Collect arguments contained in `...` with `!!!` and name-unquoting support.\n", #> contents = c("list2", "dots_list")), list(title = "Errors, conditions, and backtraces", #> contents = c("abort", "warn", "inform", "signal", #> "trace_back", "with_abort", "entrace")), list( #> title = "Evaluate expressions", contents = c("eval_tidy", #> "eval_bare", "exec")), list(title = "Symbols", #> contents = c("sym", "syms", "is_symbol")), list( #> title = "Calls", contents = c("starts_with(\"call_\")", #> "call2", "is_call")), list(title = "Expressions", #> contents = c("starts_with(\"expr_\")", "starts_with(\"exprs_\")", #> "starts_with(\"parse_\")", "is_expression", "is_symbolic", #> "expr_text", "expr_label", "expr_name", "set_expr", #> "get_expr")), list(title = "Quosures", contents = c("starts_with(\"quo_\")", #> "new_quosure", "is_quosure", "as_quosure", "is_quosures", #> "quos_auto_name")), list(title = "Formulas", contents = c("starts_with(\"f_\")", #> "new_formula", "is_formula", "is_bare_formula")), #> list(title = "Functions", contents = c("starts_with(\"fn_\")", #> "new_function", "is_function", "is_closure", "is_primitive", #> "as_function", "as_closure")), list(title = "Environments", #> contents = c("env", "new_environment", "env_print", #> "env_parent", "env_tail", "env_parents", "env_depth", #> "get_env", "set_env", "env_clone", "env_inherits", #> "is_environment", "is_bare_environment", "as_environment", #> "caller_env")), list(title = "Environment bindings", #> contents = c("env_bind", "env_bind_lazy", "env_bind_active", #> "env_unbind", "with_bindings", "scoped_bindings", #> "env_has", "env_get", "env_get_list", "env_names", #> "env_length", "env_poke")), list(title = "Search path and namespaces", #> contents = c("search_envs", "search_env", "base_env", #> "global_env", "empty_env", "is_installed", "is_namespace", #> "ns_env", "pkg_env", "env_name", "env_label")), #> list(title = "S3", contents = c("inherits_any", "inherits_all", #> "inherits_only", "new_box", "is_box", "as_box", "as_box_if", #> "unbox", "zap", "is_zap")), list(title = "Create vectors", #> desc = "Atomic vector constructors have implicit splicing (i.e. splice lists automatically), while the list constructor has explicit splicing.\n", #> contents = c("lgl", "int", "dbl", "cpl", "chr", #> "list2", "rep_along", "rep_named", "seq2", "seq2_along" #> )), list(title = "Attributes", contents = c("set_names", #> "names2")), list(title = "Type predicates", contents = c("is_list", #> "is_atomic", "is_vector", "is_integer", "is_double", #> "is_character", "is_logical", "is_raw", "is_bytes", #> "is_scalar_list", "is_scalar_atomic", "is_scalar_vector", #> "is_scalar_integer", "is_scalar_double", "is_scalar_character", #> "is_scalar_logical", "is_scalar_raw", "is_scalar_bytes", #> "is_bare_list", "is_bare_atomic", "is_bare_vector", #> "is_bare_double", "is_bare_integer", "is_bare_numeric", #> "is_bare_character", "is_bare_logical", "is_bare_raw", #> "is_bare_bytes", "is_empty", "is_integerish", "is_bare_integerish", #> "is_scalar_integerish", "is_null", "is_true", "is_false", #> "is_string", "is_bool", "is_bare_string")), list( #> title = "Operators", contents = c("`%||%`", "`%|%`", #> "`%@%`")), list(title = "Function arguments", #> contents = c("arg_match", "missing_arg", "is_missing", #> "maybe_missing")), list(title = "Create tidy evaluation APIs", #> desc = "Create data masking APIs à-la dplyr or tidyr. These functions are meant for developers rather than users.\n", #> contents = c("`tidyeval-data`", "eval_tidy", #> "as_data_mask", "new_data_mask", "as_data_pronoun" #> )), list(title = "Condition handlers", contents = c("with_handlers", #> "calling")), list(title = "Session state", contents = c("matches(\"interactive\")", #> "matches(\"option\")")), list(title = "Weak references", #> contents = c("matches(\"weakref\")", "matches(\"wref\")" #> ))), destination = "/tmp/Rtmp4B68tY/file4f2653f13748"), #> figures = list(dev = "grDevices::png", dpi = 96L, dev.args = list(), #> fig.ext = "png", fig.width = 7.29166666666667, fig.height = NULL, #> fig.retina = 2L, fig.asp = 0.618046971569839), development = list( #> destination = "dev", mode = "release", version_label = "default", #> version_tooltip = "Released version", in_dev = FALSE), #> topics = list(name = c("abort", "are_na", "arg_match", "as_box", #> "as_bytes", "as_data_mask", "as_env", "as_environment", "as_function", #> "as_label", "as_name", "as_overscope", "as_pairlist", "as_quosure", #> "as_string", "as_utf8_character", "bare-type-predicates", #> "box", "call2", "call_args", "call_fn", "call_inspect", "call_modify", #> "call_name", "call_standardise", "caller_env", "caller_fn", #> "caller_frame", "catch_cnd", "chr_unserialise_unicode", "error_cnd", #> "cnd_message", "cnd_muffle", "cnd_signal", "cnd_type", "done", #> "dots_definitions", "dots_n", "dots_values", "duplicate", #> "empty_env", "entrace", "env", "env_bind", "env_bind_exprs", #> "env_binding_are_active", "env_binding_lock", "env_bury", #> "env_clone", "env_depth", "env_get", "env_has", "env_inherits", #> "env_lock", "env_name", "env_names", "env_parent", "env_poke", #> "env_print", "env_unbind", "env_unlock", "eval_bare", "eval_tidy", #> "exec", "exiting", "expr_interp", "expr_label", "expr_print", #> "exprs_auto_name", "f_rhs", "f_text", "flatten", "fn_body", #> "fn_env", "fn_fmls", "frame_position", "friendly_type", "get_env", #> "has_length", "has_name", "inherits_any", "invoke", "is_call", #> "is_callable", "is_condition", "is_copyable", "is_empty", #> "is_env", "is_environment", "is_expr", "is_expression", "is_formula", #> "is_frame", "is_function", "is_installed", "is_integerish", #> "is_interactive", "is_lang", "is_named", "is_namespace", #> "is_pairlist", "is_reference", "is_stack", "is_symbol", "is_true", #> "is_weakref", "lang", "lang_head", "lang_modify", "last_error", #> "lifecycle", "missing", "missing_arg", "mut_node_car", "names2", #> "new-vector-along-retired", "new-vector", "new_call", "new_formula", #> "new_function", "new_node", "new_quosures", "new_weakref", #> "ns_env", "op-definition", "op-get-attr", "op-na-default", #> "op-null-default", "overscope_eval_next", "pairlist2", "parse_expr", #> "parse_quosure", "prepend", "prim_name", "quasiquotation", #> "quo_expr", "quo_label", "quo_squash", "quosure", "quotation", #> "rep_along", "restarting", "return_from", "rlang_backtrace_on_error", #> "rst_abort", "rst_list", "scalar-type-predicates", "scoped_bindings", #> "scoped_env", "scoped_options", "search_envs", "seq2", "set_attrs", #> "set_expr", "set_names", "splice", "stack", "stack_trim", #> "string", "switch_type", "sym", "tidy-dots", "tidyeval-data", #> "trace_back", "type-predicates", "type_of", "vec_poke_n", #> "vector-coercion", "vector-construction", "node", "with_abort", #> "with_env", "with_handlers", "with_restarts", "wref_key", #> "zap"), file_in = c("abort.Rd", "are_na.Rd", "arg_match.Rd", #> "as_box.Rd", "as_bytes.Rd", "as_data_mask.Rd", "as_env.Rd", #> "as_environment.Rd", "as_function.Rd", "as_label.Rd", "as_name.Rd", #> "as_overscope.Rd", "as_pairlist.Rd", "as_quosure.Rd", "as_string.Rd", #> "as_utf8_character.Rd", "bare-type-predicates.Rd", "box.Rd", #> "call2.Rd", "call_args.Rd", "call_fn.Rd", "call_inspect.Rd", #> "call_modify.Rd", "call_name.Rd", "call_standardise.Rd", #> "caller_env.Rd", "caller_fn.Rd", "caller_frame.Rd", "catch_cnd.Rd", #> "chr_unserialise_unicode.Rd", "cnd.Rd", "cnd_message.Rd", #> "cnd_muffle.Rd", "cnd_signal.Rd", "cnd_type.Rd", "done.Rd", #> "dots_definitions.Rd", "dots_n.Rd", "dots_values.Rd", "duplicate.Rd", #> "empty_env.Rd", "entrace.Rd", "env.Rd", "env_bind.Rd", "env_bind_exprs.Rd", #> "env_binding_are_active.Rd", "env_binding_lock.Rd", "env_bury.Rd", #> "env_clone.Rd", "env_depth.Rd", "env_get.Rd", "env_has.Rd", #> "env_inherits.Rd", "env_lock.Rd", "env_name.Rd", "env_names.Rd", #> "env_parent.Rd", "env_poke.Rd", "env_print.Rd", "env_unbind.Rd", #> "env_unlock.Rd", "eval_bare.Rd", "eval_tidy.Rd", "exec.Rd", #> "exiting.Rd", "expr_interp.Rd", "expr_label.Rd", "expr_print.Rd", #> "exprs_auto_name.Rd", "f_rhs.Rd", "f_text.Rd", "flatten.Rd", #> "fn_body.Rd", "fn_env.Rd", "fn_fmls.Rd", "frame_position.Rd", #> "friendly_type.Rd", "get_env.Rd", "has_length.Rd", "has_name.Rd", #> "inherits_any.Rd", "invoke.Rd", "is_call.Rd", "is_callable.Rd", #> "is_condition.Rd", "is_copyable.Rd", "is_empty.Rd", "is_env.Rd", #> "is_environment.Rd", "is_expr.Rd", "is_expression.Rd", "is_formula.Rd", #> "is_frame.Rd", "is_function.Rd", "is_installed.Rd", "is_integerish.Rd", #> "is_interactive.Rd", "is_lang.Rd", "is_named.Rd", "is_namespace.Rd", #> "is_pairlist.Rd", "is_reference.Rd", "is_stack.Rd", "is_symbol.Rd", #> "is_true.Rd", "is_weakref.Rd", "lang.Rd", "lang_head.Rd", #> "lang_modify.Rd", "last_error.Rd", "lifecycle.Rd", "missing.Rd", #> "missing_arg.Rd", "mut_node_car.Rd", "names2.Rd", "new-vector-along-retired.Rd", #> "new-vector.Rd", "new_call.Rd", "new_formula.Rd", "new_function.Rd", #> "new_node.Rd", "new_quosures.Rd", "new_weakref.Rd", "ns_env.Rd", #> "op-definition.Rd", "op-get-attr.Rd", "op-na-default.Rd", #> "op-null-default.Rd", "overscope_eval_next.Rd", "pairlist2.Rd", #> "parse_expr.Rd", "parse_quosure.Rd", "prepend.Rd", "prim_name.Rd", #> "quasiquotation.Rd", "quo_expr.Rd", "quo_label.Rd", "quo_squash.Rd", #> "quosure.Rd", "quotation.Rd", "rep_along.Rd", "restarting.Rd", #> "return_from.Rd", "rlang_backtrace_on_error.Rd", "rst_abort.Rd", #> "rst_list.Rd", "scalar-type-predicates.Rd", "scoped_bindings.Rd", #> "scoped_env.Rd", "scoped_options.Rd", "search_envs.Rd", "seq2.Rd", #> "set_attrs.Rd", "set_expr.Rd", "set_names.Rd", "splice.Rd", #> "stack.Rd", "stack_trim.Rd", "string.Rd", "switch_type.Rd", #> "sym.Rd", "tidy-dots.Rd", "tidyeval-data.Rd", "trace_back.Rd", #> "type-predicates.Rd", "type_of.Rd", "vec_poke_n.Rd", "vector-coercion.Rd", #> "vector-construction.Rd", "vector-old-ctors.Rd", "with_abort.Rd", #> "with_env.Rd", "with_handlers.Rd", "with_restarts.Rd", "wref_key.Rd", #> "zap.Rd"), file_out = c("abort.html", "are_na.html", "arg_match.html", #> "as_box.html", "as_bytes.html", "as_data_mask.html", "as_env.html", #> "as_environment.html", "as_function.html", "as_label.html", #> "as_name.html", "as_overscope.html", "as_pairlist.html", #> "as_quosure.html", "as_string.html", "as_utf8_character.html", #> "bare-type-predicates.html", "box.html", "call2.html", "call_args.html", #> "call_fn.html", "call_inspect.html", "call_modify.html", #> "call_name.html", "call_standardise.html", "caller_env.html", #> "caller_fn.html", "caller_frame.html", "catch_cnd.html", #> "chr_unserialise_unicode.html", "cnd.html", "cnd_message.html", #> "cnd_muffle.html", "cnd_signal.html", "cnd_type.html", "done.html", #> "dots_definitions.html", "dots_n.html", "dots_values.html", #> "duplicate.html", "empty_env.html", "entrace.html", "env.html", #> "env_bind.html", "env_bind_exprs.html", "env_binding_are_active.html", #> "env_binding_lock.html", "env_bury.html", "env_clone.html", #> "env_depth.html", "env_get.html", "env_has.html", "env_inherits.html", #> "env_lock.html", "env_name.html", "env_names.html", "env_parent.html", #> "env_poke.html", "env_print.html", "env_unbind.html", "env_unlock.html", #> "eval_bare.html", "eval_tidy.html", "exec.html", "exiting.html", #> "expr_interp.html", "expr_label.html", "expr_print.html", #> "exprs_auto_name.html", "f_rhs.html", "f_text.html", "flatten.html", #> "fn_body.html", "fn_env.html", "fn_fmls.html", "frame_position.html", #> "friendly_type.html", "get_env.html", "has_length.html", #> "has_name.html", "inherits_any.html", "invoke.html", "is_call.html", #> "is_callable.html", "is_condition.html", "is_copyable.html", #> "is_empty.html", "is_env.html", "is_environment.html", "is_expr.html", #> "is_expression.html", "is_formula.html", "is_frame.html", #> "is_function.html", "is_installed.html", "is_integerish.html", #> "is_interactive.html", "is_lang.html", "is_named.html", "is_namespace.html", #> "is_pairlist.html", "is_reference.html", "is_stack.html", #> "is_symbol.html", "is_true.html", "is_weakref.html", "lang.html", #> "lang_head.html", "lang_modify.html", "last_error.html", #> "lifecycle.html", "missing.html", "missing_arg.html", "mut_node_car.html", #> "names2.html", "new-vector-along-retired.html", "new-vector.html", #> "new_call.html", "new_formula.html", "new_function.html", #> "new_node.html", "new_quosures.html", "new_weakref.html", #> "ns_env.html", "op-definition.html", "op-get-attr.html", #> "op-na-default.html", "op-null-default.html", "overscope_eval_next.html", #> "pairlist2.html", "parse_expr.html", "parse_quosure.html", #> "prepend.html", "prim_name.html", "quasiquotation.html", #> "quo_expr.html", "quo_label.html", "quo_squash.html", "quosure.html", #> "quotation.html", "rep_along.html", "restarting.html", "return_from.html", #> "rlang_backtrace_on_error.html", "rst_abort.html", "rst_list.html", #> "scalar-type-predicates.html", "scoped_bindings.html", "scoped_env.html", #> "scoped_options.html", "search_envs.html", "seq2.html", "set_attrs.html", #> "set_expr.html", "set_names.html", "splice.html", "stack.html", #> "stack_trim.html", "string.html", "switch_type.html", "sym.html", #> "tidy-dots.html", "tidyeval-data.html", "trace_back.html", #> "type-predicates.html", "type_of.html", "vec_poke_n.html", #> "vector-coercion.html", "vector-construction.html", "vector-old-ctors.html", #> "with_abort.html", "with_env.html", "with_handlers.html", #> "with_restarts.html", "wref_key.html", "zap.html"), alias = list( #> abort.Rd = c("abort", "warn", "inform", "signal", "interrupt" #> ), are_na.Rd = c("are_na", "is_na", "is_lgl_na", "is_int_na", #> "is_dbl_na", "is_chr_na", "is_cpl_na"), arg_match.Rd = "arg_match", #> as_box.Rd = c("as_box", "as_box_if"), as_bytes.Rd = "as_bytes", #> as_data_mask.Rd = c("as_data_mask", "as_data_pronoun", #> "new_data_mask"), as_env.Rd = "as_env", as_environment.Rd = "as_environment", #> as_function.Rd = c("as_function", "is_lambda", "as_closure" #> ), as_label.Rd = "as_label", as_name.Rd = "as_name", #> as_overscope.Rd = c("as_overscope", "new_overscope", #> "overscope_clean"), as_pairlist.Rd = "as_pairlist", as_quosure.Rd = c("as_quosure", #> "new_quosure"), as_string.Rd = "as_string", as_utf8_character.Rd = "as_utf8_character", #> `bare-type-predicates.Rd` = c("bare-type-predicates", #> "is_bare_list", "is_bare_atomic", "is_bare_vector", "is_bare_double", #> "is_bare_integer", "is_bare_numeric", "is_bare_character", #> "is_bare_logical", "is_bare_raw", "is_bare_string", "is_bare_bytes" #> ), box.Rd = c("box", "new_box", "is_box", "unbox"), call2.Rd = "call2", #> call_args.Rd = c("call_args", "call_args_names"), call_fn.Rd = "call_fn", #> call_inspect.Rd = "call_inspect", call_modify.Rd = "call_modify", #> call_name.Rd = c("call_name", "call_ns"), call_standardise.Rd = "call_standardise", #> caller_env.Rd = c("caller_env", "current_env"), caller_fn.Rd = c("caller_fn", #> "current_fn"), caller_frame.Rd = "caller_frame", catch_cnd.Rd = "catch_cnd", #> chr_unserialise_unicode.Rd = "chr_unserialise_unicode", #> cnd.Rd = c("error_cnd", "cnd", "warning_cnd", "message_cnd" #> ), cnd_message.Rd = c("cnd_message", "cnd_issue", "cnd_bullets" #> ), cnd_muffle.Rd = "cnd_muffle", cnd_signal.Rd = "cnd_signal", #> cnd_type.Rd = "cnd_type", done.Rd = c("done", "is_done_box" #> ), dots_definitions.Rd = "dots_definitions", dots_n.Rd = "dots_n", #> dots_values.Rd = "dots_values", duplicate.Rd = "duplicate", #> empty_env.Rd = "empty_env", entrace.Rd = c("entrace", #> "cnd_entrace"), env.Rd = c("env", "child_env", "new_environment" #> ), env_bind.Rd = c("env_bind", "env_bind_lazy", "env_bind_active" #> ), env_bind_exprs.Rd = c("env_bind_exprs", "env_bind_fns" #> ), env_binding_are_active.Rd = c("env_binding_are_active", #> "env_binding_are_lazy"), env_binding_lock.Rd = c("env_binding_lock", #> "env_binding_unlock", "env_binding_are_locked"), env_bury.Rd = "env_bury", #> env_clone.Rd = "env_clone", env_depth.Rd = "env_depth", #> env_get.Rd = c("env_get", "env_get_list"), env_has.Rd = "env_has", #> env_inherits.Rd = "env_inherits", env_lock.Rd = c("env_lock", #> "env_is_locked"), env_name.Rd = c("env_name", "env_label" #> ), env_names.Rd = c("env_names", "env_length"), env_parent.Rd = c("env_parent", #> "env_tail", "env_parents"), env_poke.Rd = "env_poke", #> env_print.Rd = "env_print", env_unbind.Rd = "env_unbind", #> env_unlock.Rd = "env_unlock", eval_bare.Rd = "eval_bare", #> eval_tidy.Rd = "eval_tidy", exec.Rd = "exec", exiting.Rd = "exiting", #> expr_interp.Rd = "expr_interp", expr_label.Rd = c("expr_label", #> "expr_name", "expr_text"), expr_print.Rd = c("expr_print", #> "expr_deparse"), exprs_auto_name.Rd = c("exprs_auto_name", #> "quos_auto_name"), f_rhs.Rd = c("f_rhs", "f_rhs<-", "f_lhs", #> "f_lhs<-", "f_env", "f_env<-"), f_text.Rd = c("f_text", #> "f_name", "f_label"), flatten.Rd = c("flatten", "flatten_lgl", #> "flatten_int", "flatten_dbl", "flatten_cpl", "flatten_chr", #> "flatten_raw", "squash", "squash_lgl", "squash_int", #> "squash_dbl", "squash_cpl", "squash_chr", "squash_raw", #> "flatten_if", "squash_if"), fn_body.Rd = c("fn_body", #> "fn_body<-"), fn_env.Rd = c("fn_env", "fn_env<-"), fn_fmls.Rd = c("fn_fmls", #> "fn_fmls_names", "fn_fmls_syms", "fn_fmls<-", "fn_fmls_names<-" #> ), frame_position.Rd = "frame_position", friendly_type.Rd = "friendly_type", #> get_env.Rd = c("get_env", "set_env", "env_poke_parent" #> ), has_length.Rd = "has_length", has_name.Rd = "has_name", #> inherits_any.Rd = c("inherits_any", "inherits_all", "inherits_only" #> ), invoke.Rd = "invoke", is_call.Rd = "is_call", is_callable.Rd = "is_callable", #> is_condition.Rd = "is_condition", is_copyable.Rd = "is_copyable", #> is_empty.Rd = "is_empty", is_env.Rd = c("is_env", "is_bare_env" #> ), is_environment.Rd = c("is_environment", "is_bare_environment" #> ), is_expr.Rd = "is_expr", is_expression.Rd = c("is_expression", #> "is_syntactic_literal", "is_symbolic"), is_formula.Rd = c("is_formula", #> "is_bare_formula"), is_frame.Rd = "is_frame", is_function.Rd = c("is_function", #> "is_closure", "is_primitive", "is_primitive_eager", "is_primitive_lazy" #> ), is_installed.Rd = "is_installed", is_integerish.Rd = c("is_integerish", #> "is_bare_integerish", "is_scalar_integerish"), is_interactive.Rd = c("is_interactive", #> "scoped_interactive", "with_interactive"), is_lang.Rd = c("is_lang", #> "is_unary_lang", "is_binary_lang", "quo_is_lang"), is_named.Rd = c("is_named", #> "is_dictionaryish", "have_name"), is_namespace.Rd = "is_namespace", #> is_pairlist.Rd = c("is_pairlist", "is_node", "is_node_list" #> ), is_reference.Rd = "is_reference", is_stack.Rd = c("is_stack", #> "is_eval_stack", "is_call_stack"), is_symbol.Rd = "is_symbol", #> is_true.Rd = c("is_true", "is_false"), is_weakref.Rd = "is_weakref", #> lang.Rd = c("lang", "new_language"), lang_head.Rd = c("lang_head", #> "lang_tail"), lang_modify.Rd = c("lang_modify", "lang_standardise", #> "lang_fn", "lang_name", "lang_args", "lang_args_names" #> ), last_error.Rd = c("last_error", "last_trace"), lifecycle.Rd = "lifecycle", #> missing.Rd = c("missing", "na_lgl", "na_int", "na_dbl", #> "na_chr", "na_cpl"), missing_arg.Rd = c("missing_arg", #> "is_missing", "maybe_missing"), mut_node_car.Rd = c("mut_node_car", #> "mut_node_cdr", "mut_node_caar", "mut_node_cadr", "mut_node_cdar", #> "mut_node_cddr", "mut_node_tag"), names2.Rd = "names2", #> `new-vector-along-retired.Rd` = c("new-vector-along-retired", #> "new_logical_along", "new_integer_along", "new_double_along", #> "new_character_along", "new_complex_along", "new_raw_along", #> "new_list_along"), `new-vector.Rd` = c("new-vector", #> "new_logical", "new_integer", "new_double", "new_character", #> "new_complex", "new_raw", "new_list"), new_call.Rd = "new_call", #> new_formula.Rd = "new_formula", new_function.Rd = "new_function", #> new_node.Rd = c("new_node", "node_car", "node_cdr", "node_caar", #> "node_cadr", "node_cdar", "node_cddr", "node_poke_car", #> "node_poke_cdr", "node_poke_caar", "node_poke_cadr", #> "node_poke_cdar", "node_poke_cddr", "node_tag", "node_poke_tag" #> ), new_quosures.Rd = c("new_quosures", "as_quosures", #> "is_quosures"), new_weakref.Rd = "new_weakref", ns_env.Rd = c("ns_env", #> "ns_imports_env", "ns_env_name"), `op-definition.Rd` = c("op-definition", #> "is_definition", "new_definition", "is_formulaish"), #> `op-get-attr.Rd` = c("op-get-attr", "%@%", "%@%<-"), #> `op-na-default.Rd` = c("op-na-default", "%|%"), `op-null-default.Rd` = c("op-null-default", #> "%||%"), overscope_eval_next.Rd = "overscope_eval_next", #> pairlist2.Rd = "pairlist2", parse_expr.Rd = c("parse_expr", #> "parse_exprs", "parse_quo", "parse_quos"), parse_quosure.Rd = c("parse_quosure", #> "parse_quosures"), prepend.Rd = c("prepend", "modify" #> ), prim_name.Rd = "prim_name", quasiquotation.Rd = c("quasiquotation", #> "UQ", "UQS", "!!", "!!!", ":=", "qq_show"), quo_expr.Rd = "quo_expr", #> quo_label.Rd = c("quo_label", "quo_text", "quo_name"), #> quo_squash.Rd = "quo_squash", quosure.Rd = c("quosure", #> "is_quosure", "quo_is_missing", "quo_is_symbol", "quo_is_call", #> "quo_is_symbolic", "quo_is_null", "quo_get_expr", "quo_get_env", #> "quo_set_expr", "quo_set_env"), quotation.Rd = c("quotation", #> "expr", "enexpr", "exprs", "enexprs", "ensym", "ensyms", #> "quo", "enquo", "quos", "enquos"), rep_along.Rd = c("rep_along", #> "rep_named"), restarting.Rd = "restarting", return_from.Rd = c("return_from", #> "return_to"), rlang_backtrace_on_error.Rd = c("rlang_backtrace_on_error", #> "add_backtrace"), rst_abort.Rd = "rst_abort", rst_list.Rd = c("rst_list", #> "rst_exists", "rst_jump", "rst_maybe_jump"), `scalar-type-predicates.Rd` = c("scalar-type-predicates", #> "is_scalar_list", "is_scalar_atomic", "is_scalar_vector", #> "is_scalar_integer", "is_scalar_double", "is_scalar_character", #> "is_scalar_logical", "is_scalar_raw", "is_string", "is_scalar_bytes", #> "is_bool"), scoped_bindings.Rd = c("scoped_bindings", #> "with_bindings"), scoped_env.Rd = c("scoped_env", "is_scoped", #> "scoped_envs", "scoped_names"), scoped_options.Rd = c("scoped_options", #> "with_options", "push_options", "peek_options", "peek_option" #> ), search_envs.Rd = c("search_envs", "search_env", "pkg_env", #> "pkg_env_name", "is_attached", "base_env", "global_env" #> ), seq2.Rd = c("seq2", "seq2_along"), set_attrs.Rd = c("set_attrs", #> "mut_attrs"), set_expr.Rd = c("set_expr", "get_expr"), #> set_names.Rd = "set_names", splice.Rd = c("splice", "is_spliced", #> "is_spliced_bare", "dots_splice"), stack.Rd = c("stack", #> "global_frame", "current_frame", "ctxt_frame", "call_frame", #> "ctxt_depth", "call_depth", "ctxt_stack", "call_stack" #> ), stack_trim.Rd = "stack_trim", string.Rd = "string", #> switch_type.Rd = c("switch_type", "coerce_type", "switch_class", #> "coerce_class"), sym.Rd = c("sym", "syms"), `tidy-dots.Rd` = c("tidy-dots", #> "dots_list", "list2"), `tidyeval-data.Rd` = c("tidyeval-data", #> ".data"), trace_back.Rd = c("trace_back", "trace_length" #> ), `type-predicates.Rd` = c("type-predicates", "is_list", #> "is_atomic", "is_vector", "is_integer", "is_double", #> "is_character", "is_logical", "is_raw", "is_bytes", "is_null" #> ), type_of.Rd = "type_of", vec_poke_n.Rd = c("vec_poke_n", #> "vec_poke_range"), `vector-coercion.Rd` = c("vector-coercion", #> "as_logical", "as_integer", "as_double", "as_complex", #> "as_character", "as_list"), `vector-construction.Rd` = c("vector-construction", #> "lgl", "int", "dbl", "cpl", "chr", "bytes", "ll"), `vector-old-ctors.Rd` = c("node", #> "vector-old-ctors", "lgl_len", "int_len", "dbl_len", #> "chr_len", "cpl_len", "raw_len", "bytes_len", "list_len", #> "lgl_along", "int_along", "dbl_along", "chr_along", "cpl_along", #> "raw_along", "bytes_along", "list_along"), with_abort.Rd = "with_abort", #> with_env.Rd = c("with_env", "locally"), with_handlers.Rd = c("with_handlers", #> "calling"), with_restarts.Rd = "with_restarts", wref_key.Rd = c("wref_key", #> "wref_value"), zap.Rd = c("zap", "is_zap")), funs = list( #> abort.Rd = c("abort()", "warn()", "inform()", "signal()", #> "interrupt()"), are_na.Rd = c("are_na()", "is_na()", #> "is_lgl_na()", "is_int_na()", "is_dbl_na()", "is_chr_na()", #> "is_cpl_na()"), arg_match.Rd = "arg_match()", as_box.Rd = c("as_box()", #> "as_box_if()"), as_bytes.Rd = "as_bytes()", as_data_mask.Rd = c("as_data_mask()", #> "as_data_pronoun()", "new_data_mask()"), as_env.Rd = "as_env()", #> as_environment.Rd = "as_environment()", as_function.Rd = c("as_function()", #> "is_lambda()", "as_closure()"), as_label.Rd = "as_label()", #> as_name.Rd = "as_name()", as_overscope.Rd = c("as_overscope()", #> "new_overscope()", "overscope_clean()"), as_pairlist.Rd = "as_pairlist()", #> as_quosure.Rd = c("as_quosure()", "new_quosure()"), as_string.Rd = "as_string()", #> as_utf8_character.Rd = "as_utf8_character()", `bare-type-predicates.Rd` = c("is_bare_list()", #> "is_bare_atomic()", "is_bare_vector()", "is_bare_double()", #> "is_bare_integer()", "is_bare_numeric()", "is_bare_character()", #> "is_bare_logical()", "is_bare_raw()", "is_bare_string()", #> "is_bare_bytes()"), box.Rd = c("new_box()", "is_box()", #> "unbox()"), call2.Rd = "call2()", call_args.Rd = c("call_args()", #> "call_args_names()"), call_fn.Rd = "call_fn()", call_inspect.Rd = "call_inspect()", #> call_modify.Rd = "call_modify()", call_name.Rd = c("call_name()", #> "call_ns()"), call_standardise.Rd = "call_standardise()", #> caller_env.Rd = c("caller_env()", "current_env()"), caller_fn.Rd = c("caller_fn()", #> "current_fn()"), caller_frame.Rd = "caller_frame()", #> catch_cnd.Rd = "catch_cnd()", chr_unserialise_unicode.Rd = "chr_unserialise_unicode()", #> cnd.Rd = c("error_cnd()", "cnd()", "warning_cnd()", "message_cnd()" #> ), cnd_message.Rd = c("cnd_message()", "cnd_issue()", #> "cnd_bullets()"), cnd_muffle.Rd = "cnd_muffle()", cnd_signal.Rd = "cnd_signal()", #> cnd_type.Rd = "cnd_type()", done.Rd = c("done()", "is_done_box()" #> ), dots_definitions.Rd = "dots_definitions()", dots_n.Rd = "dots_n()", #> dots_values.Rd = "dots_values()", duplicate.Rd = "duplicate()", #> empty_env.Rd = "empty_env()", entrace.Rd = c("entrace()", #> "cnd_entrace()"), env.Rd = c("env()", "child_env()", #> "new_environment()"), env_bind.Rd = c("env_bind()", "env_bind_lazy()", #> "env_bind_active()"), env_bind_exprs.Rd = c("env_bind_exprs()", #> "env_bind_fns()"), env_binding_are_active.Rd = c("env_binding_are_active()", #> "env_binding_are_lazy()"), env_binding_lock.Rd = c("env_binding_lock()", #> "env_binding_unlock()", "env_binding_are_locked()"), #> env_bury.Rd = "env_bury()", env_clone.Rd = "env_clone()", #> env_depth.Rd = "env_depth()", env_get.Rd = c("env_get()", #> "env_get_list()"), env_has.Rd = "env_has()", env_inherits.Rd = "env_inherits()", #> env_lock.Rd = c("env_lock()", "env_is_locked()"), env_name.Rd = c("env_name()", #> "env_label()"), env_names.Rd = c("env_names()", "env_length()" #> ), env_parent.Rd = c("env_parent()", "env_tail()", "env_parents()" #> ), env_poke.Rd = "env_poke()", env_print.Rd = "env_print()", #> env_unbind.Rd = "env_unbind()", env_unlock.Rd = "env_unlock()", #> eval_bare.Rd = "eval_bare()", eval_tidy.Rd = "eval_tidy()", #> exec.Rd = "exec()", exiting.Rd = "exiting()", expr_interp.Rd = "expr_interp()", #> expr_label.Rd = c("expr_label()", "expr_name()", "expr_text()" #> ), expr_print.Rd = c("expr_print()", "expr_deparse()" #> ), exprs_auto_name.Rd = c("exprs_auto_name()", "quos_auto_name()" #> ), f_rhs.Rd = c("f_rhs()", "`f_rhs<-`()", "f_lhs()", #> "`f_lhs<-`()", "f_env()", "`f_env<-`()"), f_text.Rd = c("f_text()", #> "f_name()", "f_label()"), flatten.Rd = c("flatten()", #> "flatten_lgl()", "flatten_int()", "flatten_dbl()", "flatten_cpl()", #> "flatten_chr()", "flatten_raw()", "squash()", "squash_lgl()", #> "squash_int()", "squash_dbl()", "squash_cpl()", "squash_chr()", #> "squash_raw()", "flatten_if()", "squash_if()"), fn_body.Rd = c("fn_body()", #> "`fn_body<-`()"), fn_env.Rd = c("fn_env()", "`fn_env<-`()" #> ), fn_fmls.Rd = c("fn_fmls()", "fn_fmls_names()", "fn_fmls_syms()", #> "`fn_fmls<-`()", "`fn_fmls_names<-`()"), frame_position.Rd = "frame_position()", #> friendly_type.Rd = "friendly_type()", get_env.Rd = c("get_env()", #> "set_env()", "env_poke_parent()"), has_length.Rd = "has_length()", #> has_name.Rd = "has_name()", inherits_any.Rd = c("inherits_any()", #> "inherits_all()", "inherits_only()"), invoke.Rd = "invoke()", #> is_call.Rd = "is_call()", is_callable.Rd = "is_callable()", #> is_condition.Rd = "is_condition()", is_copyable.Rd = "is_copyable()", #> is_empty.Rd = "is_empty()", is_env.Rd = c("is_env()", #> "is_bare_env()"), is_environment.Rd = c("is_environment()", #> "is_bare_environment()"), is_expr.Rd = "is_expr()", is_expression.Rd = c("is_expression()", #> "is_syntactic_literal()", "is_symbolic()"), is_formula.Rd = c("is_formula()", #> "is_bare_formula()"), is_frame.Rd = "is_frame()", is_function.Rd = c("is_function()", #> "is_closure()", "is_primitive()", "is_primitive_eager()", #> "is_primitive_lazy()"), is_installed.Rd = "is_installed()", #> is_integerish.Rd = c("is_integerish()", "is_bare_integerish()", #> "is_scalar_integerish()"), is_interactive.Rd = c("is_interactive()", #> "scoped_interactive()", "with_interactive()"), is_lang.Rd = c("is_lang()", #> "is_unary_lang()", "is_binary_lang()", "quo_is_lang()" #> ), is_named.Rd = c("is_named()", "is_dictionaryish()", #> "have_name()"), is_namespace.Rd = "is_namespace()", is_pairlist.Rd = c("is_pairlist()", #> "is_node()", "is_node_list()"), is_reference.Rd = "is_reference()", #> is_stack.Rd = c("is_stack()", "is_eval_stack()", "is_call_stack()" #> ), is_symbol.Rd = "is_symbol()", is_true.Rd = c("is_true()", #> "is_false()"), is_weakref.Rd = "is_weakref()", lang.Rd = c("lang()", #> "new_language()"), lang_head.Rd = c("lang_head()", "lang_tail()" #> ), lang_modify.Rd = c("lang_modify()", "lang_standardise()", #> "lang_fn()", "lang_name()", "lang_args()", "lang_args_names()" #> ), last_error.Rd = c("last_error()", "last_trace()"), #> lifecycle.Rd = character(0), missing.Rd = c("na_lgl", #> "na_int", "na_dbl", "na_chr", "na_cpl"), missing_arg.Rd = c("missing_arg()", #> "is_missing()", "maybe_missing()"), mut_node_car.Rd = c("mut_node_car()", #> "mut_node_cdr()", "mut_node_caar()", "mut_node_cadr()", #> "mut_node_cdar()", "mut_node_cddr()", "mut_node_tag()" #> ), names2.Rd = "names2()", `new-vector-along-retired.Rd` = c("new_logical_along()", #> "new_integer_along()", "new_double_along()", "new_character_along()", #> "new_complex_along()", "new_raw_along()", "new_list_along()" #> ), `new-vector.Rd` = c("new_logical()", "new_integer()", #> "new_double()", "new_character()", "new_complex()", "new_raw()", #> "new_list()"), new_call.Rd = "new_call()", new_formula.Rd = "new_formula()", #> new_function.Rd = "new_function()", new_node.Rd = c("new_node()", #> "node_car()", "node_cdr()", "node_caar()", "node_cadr()", #> "node_cdar()", "node_cddr()", "node_poke_car()", "node_poke_cdr()", #> "node_poke_caar()", "node_poke_cadr()", "node_poke_cdar()", #> "node_poke_cddr()", "node_tag()", "node_poke_tag()"), #> new_quosures.Rd = c("new_quosures()", "as_quosures()", #> "is_quosures()"), new_weakref.Rd = "new_weakref()", ns_env.Rd = c("ns_env()", #> "ns_imports_env()", "ns_env_name()"), `op-definition.Rd` = c("is_definition()", #> "new_definition()", "is_formulaish()"), `op-get-attr.Rd` = c("`%@%`", #> "`%@%<-`()"), `op-na-default.Rd` = "`%|%`", `op-null-default.Rd` = "`%||%`", #> overscope_eval_next.Rd = "overscope_eval_next()", pairlist2.Rd = "pairlist2()", #> parse_expr.Rd = c("parse_expr()", "parse_exprs()", "parse_quo()", #> "parse_quos()"), parse_quosure.Rd = c("parse_quosure()", #> "parse_quosures()"), prepend.Rd = c("prepend()", "modify()" #> ), prim_name.Rd = "prim_name()", quasiquotation.Rd = "qq_show()", #> quo_expr.Rd = "quo_expr()", quo_label.Rd = c("quo_label()", #> "quo_text()", "quo_name()"), quo_squash.Rd = "quo_squash()", #> quosure.Rd = c("is_quosure()", "quo_is_missing()", "quo_is_symbol()", #> "quo_is_call()", "quo_is_symbolic()", "quo_is_null()", #> "quo_get_expr()", "quo_get_env()", "quo_set_expr()", #> "quo_set_env()"), quotation.Rd = c("expr()", "enexpr()", #> "exprs()", "enexprs()", "ensym()", "ensyms()", "quo()", #> "enquo()", "quos()", "enquos()"), rep_along.Rd = c("rep_along()", #> "rep_named()"), restarting.Rd = "restarting()", return_from.Rd = c("return_from()", #> "return_to()"), rlang_backtrace_on_error.Rd = character(0), #> rst_abort.Rd = "rst_abort()", rst_list.Rd = c("rst_list()", #> "rst_exists()", "rst_jump()", "rst_maybe_jump()"), `scalar-type-predicates.Rd` = c("is_scalar_list()", #> "is_scalar_atomic()", "is_scalar_vector()", "is_scalar_integer()", #> "is_scalar_double()", "is_scalar_character()", "is_scalar_logical()", #> "is_scalar_raw()", "is_string()", "is_scalar_bytes()", #> "is_bool()"), scoped_bindings.Rd = c("scoped_bindings()", #> "with_bindings()"), scoped_env.Rd = c("scoped_env()", #> "is_scoped()", "scoped_envs()", "scoped_names()"), scoped_options.Rd = c("scoped_options()", #> "with_options()", "push_options()", "peek_options()", #> "peek_option()"), search_envs.Rd = c("search_envs()", #> "search_env()", "pkg_env()", "pkg_env_name()", "is_attached()", #> "base_env()", "global_env()"), seq2.Rd = c("seq2()", #> "seq2_along()"), set_attrs.Rd = c("set_attrs()", "mut_attrs()" #> ), set_expr.Rd = c("set_expr()", "get_expr()"), set_names.Rd = "set_names()", #> splice.Rd = c("splice()", "is_spliced()", "is_spliced_bare()", #> "dots_splice()"), stack.Rd = c("global_frame()", "current_frame()", #> "ctxt_frame()", "call_frame()", "ctxt_depth()", "call_depth()", #> "ctxt_stack()", "call_stack()"), stack_trim.Rd = "stack_trim()", #> string.Rd = "string()", switch_type.Rd = c("switch_type()", #> "coerce_type()", "switch_class()", "coerce_class()"), #> sym.Rd = c("sym()", "syms()"), `tidy-dots.Rd` = c("dots_list()", #> "list2()"), `tidyeval-data.Rd` = ".data", trace_back.Rd = c("trace_back()", #> "trace_length()"), `type-predicates.Rd` = c("is_list()", #> "is_atomic()", "is_vector()", "is_integer()", "is_double()", #> "is_character()", "is_logical()", "is_raw()", "is_bytes()", #> "is_null()"), type_of.Rd = "type_of()", vec_poke_n.Rd = c("vec_poke_n()", #> "vec_poke_range()"), `vector-coercion.Rd` = c("as_logical()", #> "as_integer()", "as_double()", "as_complex()", "as_character()", #> "as_list()"), `vector-construction.Rd` = c("lgl()", "int()", #> "dbl()", "cpl()", "chr()", "bytes()"), `vector-old-ctors.Rd` = c("node()", #> "lgl_len()", "int_len()", "dbl_len()", "chr_len()", "cpl_len()", #> "raw_len()", "bytes_len()", "list_len()", "lgl_along()", #> "int_along()", "dbl_along()", "chr_along()", "cpl_along()", #> "raw_along()", "bytes_along()", "list_along()"), with_abort.Rd = "with_abort()", #> with_env.Rd = c("with_env()", "locally()"), with_handlers.Rd = c("with_handlers()", #> "calling()"), with_restarts.Rd = "with_restarts()", wref_key.Rd = c("wref_key()", #> "wref_value()"), zap.Rd = c("zap()", "is_zap()")), title = c("Signal an error, warning, or message", #> "Test for missing values", "Match an argument to a character vector", #> "Convert object to a box", "Coerce to a raw vector", "Create a data mask", #> "Coerce to an environment", "Coerce to an environment", "Convert to function or closure", #> "Create a default name for an R object", "Extract names from symbols", #> "Create an overscope", "Coerce to pairlist", "Coerce object to quosure", #> "Cast symbol to string", "Coerce to a character vector and attempt encoding conversion", #> "Bare type predicates", "Box a value", "Create a call", "Extract arguments from a call", #> "Extract function from a call", "Inspect a call", "Modify the arguments of a call", #> "Extract function name or namespaced of a call", "Standardise a call", #> "Get the current or caller environment", "Get properties of the current or caller frame", #> "Get caller frame", "Catch a condition", "Translate unicode points to UTF-8", #> "Create a condition object", "Build an error message from a main issue and bullet messages", #> "Muffle a condition", "Signal a condition object", "What type is a condition?", #> "Box a final value for early termination", "Capture definition objects", #> "How many arguments are currently forwarded in dots?", "Evaluate dots with preliminary splicing", #> "Duplicate an R object", "Get the empty environment", "Add backtrace from error handler", #> "Create a new environment", "Bind symbols to objects in an environment", #> "Bind a promise or active binding", "What kind of environment binding?", #> "Lock or unlock environment bindings", "Mask bindings by defining symbols deeper in a scope", #> "Clone an environment", "Depth of an environment chain", #> "Get an object in an environment", "Does an environment have or see bindings?", #> "Does environment inherit from another environment?", "Lock an environment", #> "Label of an environment", "Names and numbers of symbols bound in an environment", #> "Get parent environments", "Poke an object in an environment", #> "Pretty-print an environment", "Remove bindings from an environment", #> "Unlock an environment", "Evaluate an expression in an environment", #> "Evaluate an expression with quosures and pronoun support", #> "Execute a function", "Exiting handler", "Process unquote operators in a captured expression", #> "Turn an expression to a label", "Print an expression", "Ensure that all elements of a list of expressions are named", #> "Get or set formula components", "Turn RHS of formula into a string or label", #> "Flatten or squash a list of lists into a simpler vector", #> "Get or set function body", "Return the closure environment of a function", #> "Extract arguments from a function", "Find the position or distance of a frame on the evaluation stack", #> "Format a type for error messages", "Get or set the environment of an object", #> "How long is an object?", "Does an object have an element with this name?", #> "Does an object inherit from a set of classes?", "Invoke a function with a list of arguments", #> "Is object a call?", "Is an object callable?", "Is object a condition?", #> "Is an object copyable?", "Is object an empty vector or NULL?", #> "Is an object an environment?", "Is object an environment?", #> "Is an object an expression?", "Is an object an expression?", #> "Is object a formula?", "Is object a frame?", "Is object a function?", #> "Is a package installed in the library?", "Is a vector integer-like?", #> "Is R running interactively?", "Is object a call?", "Is object named?", #> "Is an object a namespace environment?", "Is object a node or pairlist?", #> "Is an object referencing another?", "Is object a stack?", #> "Is object a symbol?", "Is object identical to TRUE or FALSE?", #> "Is object a weak reference?", "Create a call", "Return the head or tail of a call", #> "Manipulate or access a call", "Last <code>abort()</code> error", #> "Life cycle of the rlang package", "Missing values", "Generate or handle a missing argument", #> "Mutate node components", "Get names of a vector", "Create vectors matching the length of a given vector", #> "Create vectors matching a given length", "Create a new call from components", #> "Create a formula", "Create a function", "Helpers for pairlist and language nodes", #> "Create a list of quosures", "Create a weak reference", "Get the namespace of a package", #> "Definition operator", "Infix attribute accessor and setter", #> "Replace missing values", "Default value for <code>NULL</code>", #> "Evaluate next quosure in a data mask", "Create pairlists with splicing support", #> "Parse R code", "Parse text into a quosure", "Prepend a vector", #> "Name of a primitive function", "Quasiquotation of an expression", #> "Squash a quosure", "Format quosures for printing or labelling", #> "Squash a quosure", "Quosure getters, setters and testers", #> "Quotation", "Create vectors matching the length of a given vector", #> "Create a restarting handler", "Jump to or from a frame", #> "Display backtrace on error", "Jump to the abort restart", #> "Restarts utilities", "Scalar type predicates", "Temporarily change bindings of an environment", #> "Retired <code>scoped</code> functions", "Change global options", #> "Search path environments", "Increasing sequence of integers in an interval", #> "Add attributes to an object", "Set and get an expression", #> "Set names of a vector", "Splice lists", "Call stack information", #> "Trim top call layers from the evaluation stack", "Create a string", #> "Dispatch on base types", "Create a symbol or list of symbols", #> "Collect dots tidily", "Data pronoun for tidy evaluation", #> "Capture a backtrace", "Type predicates", "Base type of an object", #> "Poke values into a vector", "Coerce an object to a base type", #> "Create vectors", "Retired vector construction by length", #> "Promote all errors to rlang errors", "Evaluate an expression within a given environment", #> "Establish handlers on the stack", "Establish a restart point on the stack", #> "Get key/value from a weak reference object", "Create zap objects" #> ), rd = list(abort.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-abort.R, R/cnd-signal.R", #> "\n", list("abort"), "\n", list("abort"), "\n", list( #> "warn"), "\n", list("inform"), "\n", list("signal"), #> "\n", list("interrupt"), "\n", list("Signal an error, warning, or message"), #> "\n", list("\n", "abort(message = \"\", .subclass = NULL, ..., trace = NULL,\n", #> " call = NULL, parent = NULL, msg, type)\n", "\n", #> "warn(message, .subclass = NULL, ..., call = NULL, msg, type)\n", #> "\n", "inform(message, .subclass = NULL, ..., call = NULL, msg, type)\n", #> "\n", "signal(message, .subclass, ...)\n", "\n", #> "interrupt()\n"), "\n", list("\n", list(list("message"), #> list("The message to display.")), "\n", "\n", list( #> list(".subclass"), list("Subclass of the condition. This allows your users\n", #> "to selectively handle the conditions signalled by your functions.")), #> "\n", "\n", list(list("..."), list("Additional data to be stored in the condition object.")), #> "\n", "\n", list(list("trace"), list("A ", list("trace"), #> " object created by ", list(list("trace_back()")), #> ".")), "\n", "\n", list(list("call"), list("Defunct as of rlang 0.4.0. Storing the full\n", #> "backtrace is now preferred to storing a simple call.")), #> "\n", "\n", list(list("parent"), list("A parent condition object created by ", #> list(list("abort()")), ".")), "\n", "\n", list( #> list("msg, type"), list("These arguments were renamed to ", #> list("message"), " and\n", list(".subclass"), #> " and are defunct as of rlang 0.4.0.")), "\n"), #> "\n", list("\n", "These functions are equivalent to base functions ", #> list(list("base::stop()")), ",\n", list(list("base::warning()")), #> " and ", list(list("base::message()")), ", but make it easy to supply\n", #> "condition metadata:\n", list("\n", list(), " Supply ", #> list(".subclass"), " to create a classed condition. Typed\n", #> "conditions can be captured or handled selectively, allowing for\n", #> "finer-grained error handling.\n", list(), " Supply metadata with named ", #> list("..."), " arguments. This data will be\n", #> "stored in the condition object and can be examined by handlers.\n"), #> "\n", "\n", list("interrupt()"), " allows R code to simulate a user interrupt of the\n", #> "kind that is signalled with ", list("Ctrl-C"), ". It is currently not possible\n", #> "to create custom interrupt condition objects.\n"), #> "\n", list(list("Backtrace"), list("\n", "\n", "\n", #> "Unlike ", list("stop()"), " and ", list("warning()"), #> ", these functions don't include call\n", "information by default. This saves you from typing ", #> list("call. = FALSE"), "\n", "and produces cleaner error messages.\n", #> "\n", "A backtrace is always saved into error objects. You can print a\n", #> "simplified backtrace of the last error by calling ", #> list(list("last_error()")), "\n", "and a full backtrace with ", #> list("summary(last_error())"), ".\n", "\n", "You can also display a backtrace with the error message by setting\n", #> "the option ", list("rlang_backtrace_on_error"), #> ". It supports the following\n", "values:\n", list( #> "\n", list(), " ", list("\"reminder\""), ": Invite users to call ", #> list("rlang::last_error()"), " to see a\n", "backtrace.\n", #> list(), " ", list("\"branch\""), ": Display a simplified backtrace.\n", #> list(), " ", list("\"collapse\""), ": Display a collapsed backtrace tree.\n", #> list(), " ", list("\"full\""), ": Display a full backtrace tree.\n", #> list(), " ", list("\"none\""), ": Display nothing.\n"), #> "\n")), "\n", "\n", list(list("Mufflable conditions"), #> list("\n", "\n", "\n", "Signalling a condition with ", #> list("inform()"), " or ", list("warn()"), " causes a message\n", #> "to be displayed in the console. These messages can be muffled with\n", #> list(list("base::suppressMessages()")), " or ", #> list(list("base::suppressWarnings()")), ".\n", #> "\n", "On recent R versions (>= R 3.5.0), interrupts are typically\n", #> "signalled with a ", list("\"resume\""), " restart. This is however not\n", #> "guaranteed.\n")), "\n", "\n", list(list("Lifecycle"), #> list("\n", "\n", "\n", "These functions were changed in rlang 0.3.0 to take condition\n", #> "metadata with ", list("..."), ". Consequently:\n", #> list("\n", list(), " All arguments were renamed to be prefixed with a dot, except for\n", #> list("type"), " which was renamed to ", list( #> ".subclass"), ".\n", list(), " ", list(".call"), #> " (previously ", list("call"), ") can no longer be passed positionally.\n"), #> "\n")), "\n", "\n", list("\n", "# These examples are guarded to avoid throwing errors\n", #> "if (FALSE) {\n", "\n", "# Signal an error with a message just like stop():\n", #> "abort(\"Something bad happened\")\n", "\n", "# Give a class to the error:\n", #> "abort(\"Something bad happened\", \"somepkg_bad_error\")\n", #> "\n", "# This will allow your users to handle the error selectively\n", #> "tryCatch(\n", " somepkg_function(),\n", " somepkg_bad_error = function(err) {\n", #> " warn(err$message) # Demote the error to a warning\n", #> " NA # Return an alternative value\n", #> " }\n", ")\n", "\n", "# You can also specify metadata that will be stored in the condition:\n", #> "abort(\"Something bad happened\", \"somepkg_bad_error\", data = 1:10)\n", #> "\n", "# This data can then be consulted by user handlers:\n", #> "tryCatch(\n", " somepkg_function(),\n", " somepkg_bad_error = function(err) {\n", #> " # Compute an alternative return value with the data:\n", #> " recover_error(err$data)\n", " }\n", ")\n", #> "\n", "# If you call low-level APIs it is good practice to catch technical\n", #> "# errors and rethrow them with a more meaningful message. Pass on\n", #> "# the caught error as `parent` to get a nice decomposition of\n", #> "# errors and backtraces:\n", "file <- \"http://foo.bar/baz\"\n", #> "tryCatch(\n", " download(file),\n", " error = function(err) {\n", #> " msg <- sprintf(\"Can't download `%s`\", file)\n", #> " abort(msg, parent = err)\n", "})\n", "\n", "# Unhandled errors are saved automatically by `abort()` and can be\n", #> "# retrieved with `last_error()`. The error prints with a simplified\n", #> "# backtrace:\n", "abort(\"Saved error?\")\n", "last_error()\n", #> "\n", "# Use `summary()` to print the full backtrace and the condition fields:\n", #> "summary(last_error())\n", "\n", "}\n"), "\n", list( #> "\n", list(list("with_abort()")), " to convert all errors to rlang errors.\n"), #> "\n"), are_na.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-na.R", "\n", #> list("are_na"), "\n", list("are_na"), "\n", list("is_na"), #> "\n", list("is_lgl_na"), "\n", list("is_int_na"), "\n", #> list("is_dbl_na"), "\n", list("is_chr_na"), "\n", list( #> "is_cpl_na"), "\n", list("Test for missing values"), #> "\n", list("\n", "are_na(x)\n", "\n", "is_na(x)\n", "\n", #> "is_lgl_na(x)\n", "\n", "is_int_na(x)\n", "\n", "is_dbl_na(x)\n", #> "\n", "is_chr_na(x)\n", "\n", "is_cpl_na(x)\n"), #> "\n", list("\n", list(list("x"), list("An object to test")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("are_na()"), " checks for missing values in a vector and is equivalent\n", #> "to ", list(list("base::is.na()")), ". It is a vectorised predicate, meaning that its\n", #> "output is always the same length as its input. On the other hand,\n", #> list("is_na()"), " is a scalar predicate and always returns a scalar\n", #> "boolean, ", list("TRUE"), " or ", list("FALSE"), #> ". If its input is not scalar, it returns\n", list( #> "FALSE"), ". Finally, there are typed versions that check for\n", #> "particular ", list("missing types"), ".\n"), "\n", #> list("\n", "The scalar predicates accept non-vector inputs. They are equivalent\n", #> "to ", list(list("is_null()")), " in that respect. In contrast the vectorised\n", #> "predicate ", list("are_na()"), " requires a vector input since it is defined\n", #> "over vector values.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "These functions might be moved to the vctrs package at some\n", #> "point. This is why they are marked as questioning.\n")), #> "\n", "\n", list("\n", "# are_na() is vectorised and works regardless of the type\n", #> "are_na(c(1, 2, NA))\n", "are_na(c(1L, NA, 3L))\n", #> "\n", "# is_na() checks for scalar input and works for all types\n", #> "is_na(NA)\n", "is_na(na_dbl)\n", "is_na(character(0))\n", #> "\n", "# There are typed versions as well:\n", "is_lgl_na(NA)\n", #> "is_lgl_na(na_dbl)\n"), "\n"), arg_match.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/arg.R", "\n", list( #> "arg_match"), "\n", list("arg_match"), "\n", list( #> "Match an argument to a character vector"), "\n", #> list("\n", "arg_match(arg, values = NULL)\n"), "\n", #> list("\n", list(list("arg"), list("A symbol referring to an argument accepting strings.")), #> "\n", "\n", list(list("values"), list("The possible values that ", #> list("arg"), " can take. If ", list("NULL"), #> ",\n", "the values are taken from the function definition of the ", #> list("caller frame"), ".")), "\n"), "\n", list( #> "\n", "The string supplied to ", list("arg"), ".\n"), #> "\n", list("\n", "This is equivalent to ", list(list( #> "base::match.arg()")), " with a few differences:\n", #> list("\n", list(), " Partial matches trigger an error.\n", #> list(), " Error messages are a bit more informative and obey the tidyverse\n", #> "standards.\n"), "\n"), "\n", list("\n", "fn <- function(x = c(\"foo\", \"bar\")) arg_match(x)\n", #> "fn(\"bar\")\n", "\n", "# This would throw an informative error if run:\n", #> "# fn(\"b\")\n", "# fn(\"baz\")\n"), "\n"), as_box.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/s3.R", "\n", list("as_box"), #> "\n", list("as_box"), "\n", list("as_box_if"), "\n", #> list("Convert object to a box"), "\n", list("\n", "as_box(x, class = NULL)\n", #> "\n", "as_box_if(.x, .p, .class = NULL, ...)\n"), #> "\n", list("\n", list(list("x"), list("An R object.")), #> "\n", "\n", list(list("class, .class"), list("A box class. If the input is already a box of\n", #> "that class, it is returned as is. If the input needs to be boxed,\n", #> list("class"), " is passed to ", list(list("new_box()")), #> ".")), "\n", "\n", list(list(".x"), list("An R object.")), #> "\n", "\n", list(list(".p"), list("A predicate function.")), #> "\n", "\n", list(list("..."), list("Arguments passed to ", #> list(".p"), ".")), "\n"), "\n", list("\n", list( #> "\n", list(), " ", list("as_box()"), " boxes its input only if it is not already a box. The\n", #> "class is also checked if supplied.\n", list(), " ", #> list("as_box_if()"), " boxes its input only if it not already a box, or if\n", #> "the predicate ", list(".p"), " returns ", list("TRUE"), #> ".\n"), "\n"), "\n"), as_bytes.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/utils-encoding.R", #> "\n", list("as_bytes"), "\n", list("as_bytes"), "\n", #> list("Coerce to a raw vector"), "\n", list("\n", "as_bytes(x)\n"), #> "\n", list("\n", list(list("x"), list("A string.")), #> "\n"), "\n", list("\n", "A raw vector of bytes.\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "This currently only works with strings, and returns its hexadecimal\n", #> "representation.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "Raw vector functions are experimental.\n")), #> "\n", "\n", list("internal"), "\n"), as_data_mask.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/eval-tidy.R", "\n", #> list("as_data_mask"), "\n", list("as_data_mask"), "\n", #> list("as_data_pronoun"), "\n", list("new_data_mask"), #> "\n", list("Create a data mask"), "\n", list("\n", "as_data_mask(data, parent = NULL)\n", #> "\n", "as_data_pronoun(data)\n", "\n", "new_data_mask(bottom, top = bottom, parent = NULL)\n"), #> "\n", list("\n", list(list("data"), list("A data frame or named vector of masking data.")), #> "\n", "\n", list(list("parent"), list("Deprecated. This argument no longer has any effect.\n", #> "The parent of the data mask is determined from either:\n", #> list("\n", list(), " The ", list("env"), " argument of ", #> list("eval_tidy()"), "\n", list(), " Quosure environments when applicable\n"))), #> "\n", "\n", list(list("bottom"), list("The environment containing masking objects if the\n", #> "data mask is one environment deep. The bottom environment if the\n", #> "data mask comprises multiple environment.\n", #> "\n", "If you haven't supplied ", list("top"), #> ", this ", list("must"), " be an environment\n", #> "that you own, i.e. that you have created yourself.")), #> "\n", "\n", list(list("top"), list("The last environment of the data mask. If the data mask\n", #> "is only one environment deep, ", list("top"), #> " should be the same as\n", list("bottom"), ".\n", #> "\n", "This ", list("must"), " be an environment that you own, i.e. that you have\n", #> "created yourself. The parent of ", list("top"), #> " will be changed by the tidy\n", "eval engine and should be considered undetermined. Never make\n", #> "assumption about the parent of ", list("top"), #> ".")), "\n"), "\n", list("\n", "A data mask that you can supply to ", #> list(list("eval_tidy()")), ".\n"), "\n", list("\n", #> list("rlang:::lifecycle(\"stable\")"), "\n", "\n", #> "A data mask is an environment (or possibly multiple environments\n", #> "forming an ancestry) containing user-supplied objects. Objects in\n", #> "the mask have precedence over objects in the environment (i.e. they\n", #> "mask those objects). Many R functions evaluate quoted expressions\n", #> "in a data mask so these expressions can refer to objects within the\n", #> "user data.\n", "\n", "These functions let you construct a tidy eval data mask manually.\n", #> "They are meant for developers of tidy eval interfaces rather than\n", #> "for end users.\n"), "\n", list(list("Why build a data mask?"), #> list("\n", "\n", "\n", "Most of the time you can just call ", #> list(list("eval_tidy()")), " with a list or a\n", #> "data frame and the data mask will be constructed automatically.\n", #> "There are three main use cases for manual creation of data masks:\n", #> list("\n", list(), " When ", list(list("eval_tidy()")), #> " is called with the same data in a tight loop.\n", #> "Because there is some overhead to creating tidy eval data masks,\n", #> "constructing the mask once and reusing it for subsequent\n", #> "evaluations may improve performance.\n", list(), #> " When several expressions should be evaluated in the exact same\n", #> "environment because a quoted expression might create new objects\n", #> "that can be referred in other quoted expressions evaluated at a\n", #> "later time. One example of this is ", list( #> "tibble::lst()"), " where new\n", "columns can refer to previous ones.\n", #> list(), " When your data mask requires special features. For instance the\n", #> "data frame columns in dplyr data masks are implemented with\n", #> list("active bindings"), ".\n"), "\n")), "\n", #> "\n", list(list("Building your own data mask"), list( #> "\n", "\n", "\n", "Unlike ", list(list("base::eval()")), #> " which takes any kind of environments as data\n", #> "mask, ", list(list("eval_tidy()")), " has specific requirements in order to support\n", #> list("quosures"), ". For this reason you can't supply bare\n", #> "environments.\n", "\n", "There are two ways of constructing an rlang data mask manually:\n", #> list("\n", list(), " ", list("as_data_mask()"), " transforms a list or data frame to a data mask.\n", #> "It automatically installs the data pronoun ", #> list(list(".data")), ".\n", list(), " ", list( #> "new_data_mask()"), " is a bare bones data mask constructor for\n", #> "environments. You can supply a bottom and a top environment in\n", #> "case your data mask comprises multiple environments (see section\n", #> "below).\n", "\n", "Unlike ", list("as_data_mask()"), #> " it does not install the ", list(".data"), " pronoun\n", #> "so you need to provide one yourself. You can provide a pronoun\n", #> "constructed with ", list("as_data_pronoun()"), #> " or your own pronoun class.\n", "\n", list("as_data_pronoun()"), #> " will create a pronoun from a list, an\n", "environment, or an rlang data mask. In the latter case, the whole\n", #> "ancestry is looked up from the bottom to the top of the mask.\n", #> "Functions stored in the mask are bypassed by the pronoun.\n"), #> "\n", "\n", "Once you have built a data mask, simply pass it to ", #> list(list("eval_tidy()")), " as\n", "the ", list( #> "data"), " argument. You can repeat this as many times as\n", #> "needed. Note that any objects created there (perhaps because of a\n", #> "call to ", list("<-"), ") will persist in subsequent evaluations.\n")), #> "\n", "\n", list(list("Top and bottom of data mask"), #> list("\n", "\n", "\n", "In some cases you'll need several levels in your data mask. One\n", #> "good reason is when you include functions in the mask. It's a good\n", #> "idea to keep data objects one level lower than function objects, so\n", #> "that the former cannot override the definitions of the latter (see\n", #> "examples).\n", "\n", "In that case, set up all your environments and keep track of the\n", #> "bottom child and the top parent. You'll need to pass both to\n", #> list("new_data_mask()"), ".\n", "\n", "Note that the parent of the top environment is completely\n", #> "undetermined, you shouldn't expect it to remain the same at all\n", #> "times. This parent is replaced during evaluation by ", #> list(list("eval_tidy()")), "\n", "to one of the following environments:\n", #> list("\n", list(), " The default environment passed as the ", #> list("env"), " argument of ", list("eval_tidy()"), #> ".\n", list(), " The environment of the current quosure being evaluated, if applicable.\n"), #> "\n", "\n", "Consequently, all masking data should be contained between the\n", #> "bottom and top environment of the data mask.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> "\n", "The ", list("parent"), " argument no longer has any effect and is defunct as of\n", #> "rlang 0.4.0. The parent of the data mask is determined from either:\n", #> list("\n", list(), " The ", list("env"), " argument of ", #> list("eval_tidy()"), "\n", list(), " Quosure environments when applicable\n"), #> "\n", "\n", "Passing environments to ", list("as_data_mask()"), #> " is deprecated as of rlang\n", "0.3.0. Please use ", #> list("new_data_mask()"), " instead.\n", "\n", list( #> "rlang 0.2.0"), "\n", "\n", "In early versions of rlang data masks were called overscopes. We\n", #> "think data mask is a more natural name in R. It makes reference to\n", #> "masking in the search path which occurs through the same mechanism\n", #> "(in technical terms, lexical scoping with hierarchically nested\n", #> "environments). We say that objects from user data mask objects\n", #> "in the current environment.\n", "\n", "Following this change in terminology, ", #> list("as_overscope()"), " and\n", list("new_overscope()"), #> " were deprecated in rlang 0.2.0 in favour of\n", #> list("as_data_mask()"), " and ", list("new_data_mask()"), #> ".\n")), "\n", "\n", list("\n", "# Evaluating in a tidy evaluation environment enables all tidy\n", #> "# features:\n", "mask <- as_data_mask(mtcars)\n", #> "eval_tidy(quo(letters), mask)\n", "\n", "# You can install new pronouns in the mask:\n", #> "mask$.pronoun <- as_data_pronoun(list(foo = \"bar\", baz = \"bam\"))\n", #> "eval_tidy(quo(.pronoun$foo), mask)\n", "\n", "# In some cases the data mask can leak to the user, for example if\n", #> "# a function or formula is created in the data mask environment:\n", #> "cyl <- \"user variable from the context\"\n", "fn <- eval_tidy(quote(function() cyl), mask)\n", #> "fn()\n", "\n", "# If new objects are created in the mask, they persist in the\n", #> "# subsequent calls:\n", "eval_tidy(quote(new <- cyl + am), mask)\n", #> "eval_tidy(quote(new * 2), mask)\n", "\n", "\n", #> "# In some cases your data mask is a whole chain of environments\n", #> "# rather than a single environment. You'll have to use\n", #> "# `new_data_mask()` and let it know about the bottom of the mask\n", #> "# (the last child of the environment chain) and the topmost parent.\n", #> "\n", "# A common situation where you'll want a multiple-environment mask\n", #> "# is when you include functions in your mask. In that case you'll\n", #> "# put functions in the top environment and data in the bottom. This\n", #> "# will prevent the data from overwriting the functions.\n", #> "top <- new_environment(list(`+` = base::paste, c = base::paste))\n", #> "\n", "# Let's add a middle environment just for sport:\n", #> "middle <- env(top)\n", "\n", "# And finally the bottom environment containing data:\n", #> "bottom <- env(middle, a = \"a\", b = \"b\", c = \"c\")\n", #> "\n", "# We can now create a mask by supplying the top and bottom\n", #> "# environments:\n", "mask <- new_data_mask(bottom, top = top)\n", #> "\n", "# This data mask can be passed to eval_tidy() instead of a list or\n", #> "# data frame:\n", "eval_tidy(quote(a + b + c), data = mask)\n", #> "\n", "# Note how the function `c()` and the object `c` are looked up\n", #> "# properly because of the multi-level structure:\n", #> "eval_tidy(quote(c(a, b, c)), data = mask)\n", "\n", #> "# new_data_mask() does not create data pronouns, but\n", #> "# data pronouns can be added manually:\n", "mask$.fns <- as_data_pronoun(top)\n", #> "\n", "# The `.data` pronoun should generally be created from the\n", #> "# mask. This will ensure data is looked up throughout the whole\n", #> "# ancestry. Only non-function objects are looked up from this\n", #> "# pronoun:\n", "mask$.data <- as_data_pronoun(mask)\n", #> "mask$.data$c\n", "\n", "# Now we can reference the values with the pronouns:\n", #> "eval_tidy(quote(c(.data$a, .data$b, .data$c)), data = mask)\n"), #> "\n"), as_env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("as_env"), "\n", list("as_env"), "\n", list( #> "Coerce to an environment"), "\n", list("\n", "as_env(x, parent = NULL)\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "This function is deprecated as it was renamed to ", #> list(list("as_environment()")), "\n", "in rlang 0.2.0.\n"), #> "\n", list("internal"), "\n"), as_environment.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env.R", "\n", list( #> "as_environment"), "\n", list("as_environment"), #> "\n", list("Coerce to an environment"), "\n", list("\n", #> "as_environment(x, parent = NULL)\n"), "\n", list( #> "\n", list(list("x"), list("An object to coerce.")), #> "\n", "\n", list(list("parent"), list("A parent environment, ", #> list(list("empty_env()")), " by default. This\n", #> "argument is only used when ", list("x"), " is data actually coerced to an\n", #> "environment (as opposed to data representing an environment, like\n", #> list("NULL"), " representing the empty environment).")), #> "\n"), "\n", list("\n", list("as_environment()"), #> " coerces named vectors (including lists) to an\n", #> "environment. The names must be unique. If supplied an unnamed\n", #> "string, it returns the corresponding package environment (see\n", #> list(list("pkg_env()")), ").\n"), "\n", list("\n", #> "If ", list("x"), " is an environment and ", list( #> "parent"), " is not ", list("NULL"), ", the\n", #> "environment is duplicated before being set a new parent. The return\n", #> "value is therefore a different environment than ", #> list("x"), ".\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", list("as_env()"), " was soft-deprecated and renamed to ", #> list("as_environment()"), " in\n", "rlang 0.2.0. This is for consistency as type predicates should not\n", #> "be abbreviated.\n")), "\n", "\n", list("\n", #> "# Coerce a named vector to an environment:\n", "env <- as_environment(mtcars)\n", #> "\n", "# By default it gets the empty environment as parent:\n", #> "identical(env_parent(env), empty_env())\n", "\n", #> "\n", "# With strings it is a handy shortcut for pkg_env():\n", #> "as_environment(\"base\")\n", "as_environment(\"rlang\")\n", #> "\n", "# With NULL it returns the empty environment:\n", #> "as_environment(NULL)\n"), "\n"), as_function.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list("as_function"), #> "\n", list("as_function"), "\n", list("is_lambda"), "\n", #> list("as_closure"), "\n", list("Convert to function or closure"), #> "\n", list("\n", "as_function(x, env = caller_env())\n", #> "\n", "is_lambda(x)\n", "\n", "as_closure(x, env = caller_env())\n"), #> "\n", list("\n", list(list("x"), list("A function or formula.\n", #> "\n", "If a ", list("function"), ", it is used as is.\n", #> "\n", "If a ", list("formula"), ", e.g. ", list("~ .x + 2"), #> ", it is converted to a function\n", "with up to two arguments: ", #> list(".x"), " (single argument) or ", list(".x"), #> " and ", list(".y"), "\n", "(two arguments). The ", #> list("."), " placeholder can be used instead of ", #> list(".x"), ".\n", "This allows you to create very compact anonymous functions (lambdas) with up\n", #> "to two inputs. Functions created from formulas have a special\n", #> "class. Use ", list("is_lambda()"), " to test for it.\n", #> "\n", "Lambdas currently do not support ", list("quasiquotation"), #> ",\n", "due to the way the arguments are handled internally.")), #> "\n", "\n", list(list("env"), list("Environment in which to fetch the function in case ", #> list("x"), "\n", "is a string.")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"stable\")"), "\n", #> list("\n", list(), " ", list("as_function()"), " transforms a one-sided formula into a function.\n", #> "This powers the lambda syntax in packages like purrr.\n", #> list(), " ", list("as_closure()"), " first passes its argument to ", #> list("as_function()"), ". If\n", "the result is a primitive function, it regularises it to a proper\n", #> list("closure"), " (see ", list(list("is_function()")), #> " about primitive functions).\n"), "\n"), "\n", #> list("\n", "f <- as_function(~ .x + 1)\n", "f(10)\n", #> "\n", "g <- as_function(~ -1 * .)\n", "g(4)\n", "\n", #> "h <- as_function(~ .x - .y)\n", "h(6, 3)\n", "\n", #> "# Functions created from a formula have a special class:\n", #> "is_lambda(f)\n", "is_lambda(as_function(function() \"foo\"))\n", #> "\n", "# Primitive functions are regularised as closures\n", #> "as_closure(list)\n", "as_closure(\"list\")\n", "\n", #> "# Operators have `.x` and `.y` as arguments, just like lambda\n", #> "# functions created with the formula syntax:\n", #> "as_closure(`+`)\n", "as_closure(`~`)\n", "\n", "# Use a regular function for tidy evaluation, also when calling functions\n", #> "# that use tidy evaluation:\n", "## Bad:\n", "e <- as_function(~ as_label(ensym(.x)))\n", #> "## Good:\n", "e <- as_function(function(x) as_label(ensym(x)))\n", #> "\n", "e(y)\n"), "\n"), as_label.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/deparse.R", "\n", #> list("as_label"), "\n", list("as_label"), "\n", list( #> "Create a default name for an R object"), "\n", list( #> "\n", "as_label(x)\n"), "\n", list("\n", list(list( #> "x"), list("An object.")), "\n"), "\n", list("\n", #> list("as_label()"), " transforms R objects into a short, human-readable\n", #> "description. You can use labels to:\n", list("\n", #> list(), " Display an object in a concise way, for example to labellise axes\n", #> "in a graphical plot.\n", list(), " Give default names to columns in a data frame. In this case,\n", #> "labelling is the first step before name repair.\n"), #> "\n", "\n", "See also ", list(list("as_name()")), #> " for transforming symbols back to a\n", "string. Unlike ", #> list("as_label()"), ", ", list("as_string()"), " is a well defined\n", #> "operation that guarantees the roundtrip symbol -> string ->\n", #> "symbol.\n", "\n", "In general, if you don't know for sure what kind of object you're\n", #> "dealing with (a call, a symbol, an unquoted constant), use\n", #> list("as_label()"), " and make no assumption about the resulting string. If\n", #> "you know you have a symbol and need the name of the object it\n", #> "refers to, use ", list(list("as_string()")), ". For instance, use ", #> list("as_label()"), " with\n", "objects captured with ", #> list("enquo()"), " and ", list("as_string()"), " with symbols\n", #> "captured with ", list("ensym()"), ".\n"), "\n", #> list(list("Transformation to string"), list("\n", "\n", #> list("\n", list(), " Quosures are ", list("squashed"), #> " before being labelled.\n", list(), " Symbols are transformed to string with ", #> list("as_string()"), ".\n", list(), " Calls are abbreviated.\n", #> list(), " Numbers are represented as such.\n", #> list(), " Other constants are represented by their type, such as ", #> list("<dbl>"), "\n", "or ", list("<data.frame>"), #> ".\n"), "\n", "\n", "Note that simple symbols should generally be transformed to strings\n", #> "with ", list(list("as_name()")), ". Labelling is not a well defined operation and\n", #> "no assumption should be made about how the label is created. On the\n", #> "other hand, ", list("as_name()"), " only works with symbols and is a well\n", #> "defined, deterministic operation.\n")), "\n", "\n", #> list("\n", "# as_label() is useful with quoted expressions:\n", #> "as_label(expr(foo(bar)))\n", "as_label(expr(foobar))\n", #> "\n", "# It works with any R object. This is also useful for quoted\n", #> "# arguments because the user might unquote constant objects:\n", #> "as_label(1:3)\n", "as_label(base::list)\n"), "\n", #> list("\n", list(list("as_name()")), " for transforming symbols back to a string\n", #> "deterministically.\n"), "\n"), as_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/deparse.R", "\n", list( #> "as_name"), "\n", list("as_name"), "\n", list("Extract names from symbols"), #> "\n", list("\n", "as_name(x)\n"), "\n", list("\n", list( #> list("x"), list("A string or symbol, possibly wrapped in a ", #> list("quosure"), ".\n", "If a string, the attributes are removed, if any.")), #> "\n"), "\n", list("\n", "A character vector of length 1.\n"), #> "\n", list("\n", list("as_name()"), " converts ", list( #> "symbols"), " to character strings. The\n", "conversion is deterministic. That is, the roundtrip symbol -> name\n", #> "-> symbol always gets the same result.\n", list( #> "\n", list(), " Use ", list("as_name()"), " when you need to transform a symbol to a string\n", #> "to ", list("refer"), " to an object by its name.\n", #> list(), " Use ", list(list("as_label()")), " when you need to transform any kind of object to\n", #> "a string to ", list("represent"), " that object with a short description.\n"), #> "\n", "\n", "Expect ", list("as_name()"), " to gain\n", #> list(list("https://principles.tidyverse.org/names-attribute.html#minimal-unique-universal"), #> list("name-repairing")), "\n", "features in the future.\n", #> "\n", "Note that ", list("rlang::as_name()"), " is the ", #> list("opposite"), " of\n", list(list("base::as.name()")), #> ". If you're writing base R code, we recommend\n", #> "using ", list(list("base::as.symbol()")), " which is an alias of ", #> list("as.name()"), " that\n", "follows a more modern terminology (R types instead of S modes).\n"), #> "\n", list("\n", "# Let's create some symbols:\n", "foo <- quote(foo)\n", #> "bar <- sym(\"bar\")\n", "\n", "# as_name() converts symbols to strings:\n", #> "foo\n", "as_name(foo)\n", "\n", "typeof(bar)\n", #> "typeof(as_name(bar))\n", "\n", "# as_name() unwraps quosured symbols automatically:\n", #> "as_name(quo(foo))\n"), "\n", list("\n", list(list( #> "as_label()")), " for converting any object to a single string\n", #> "suitable as a label. ", list(list("as_string()")), #> " for a lower-level version that\n", "doesn't unwrap quosures.\n"), #> "\n"), as_overscope.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("as_overscope"), "\n", list("as_overscope"), #> "\n", list("new_overscope"), "\n", list("overscope_clean"), #> "\n", list("Create an overscope"), "\n", list("\n", "as_overscope(quo, data = NULL)\n", #> "\n", "new_overscope(bottom, top = NULL, enclosure = NULL)\n", #> "\n", "overscope_clean(overscope)\n"), "\n", list( #> "\n", list(list("quo"), list("A ", list("quosure"), #> ".")), "\n", "\n", list(list("data"), list("A data frame or named vector of masking data.")), #> "\n", "\n", list(list("bottom"), list("The environment containing masking objects if the\n", #> "data mask is one environment deep. The bottom environment if the\n", #> "data mask comprises multiple environment.\n", #> "\n", "If you haven't supplied ", list("top"), #> ", this ", list("must"), " be an environment\n", #> "that you own, i.e. that you have created yourself.")), #> "\n", "\n", list(list("top"), list("The last environment of the data mask. If the data mask\n", #> "is only one environment deep, ", list("top"), #> " should be the same as\n", list("bottom"), ".\n", #> "\n", "This ", list("must"), " be an environment that you own, i.e. that you have\n", #> "created yourself. The parent of ", list("top"), #> " will be changed by the tidy\n", "eval engine and should be considered undetermined. Never make\n", #> "assumption about the parent of ", list("top"), #> ".")), "\n", "\n", list(list("enclosure"), list( #> "The ", list("parent"), " argument of ", list( #> list("new_data_mask()")), ".")), "\n", "\n", #> list(list("overscope"), list("A data mask.")), "\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions have been deprecated in rlang 0.2.0. Please use\n", #> list(list("as_data_mask()")), " and ", list(list( #> "new_data_mask()")), " instead. We no longer\n", #> "require the mask to be cleaned up so ", list("overscope_clean()"), #> " does not\n", "have a replacement.\n"), "\n", list( #> "internal"), "\n"), as_pairlist.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/node.R", "\n", #> list("as_pairlist"), "\n", list("as_pairlist"), "\n", #> list("Coerce to pairlist"), "\n", list("\n", "as_pairlist(x)\n"), #> "\n", list("\n", list(list("x"), list("An object to coerce.")), #> "\n"), "\n", list("\n", "This transforms vector objects to a linked pairlist of nodes. See\n", #> "the ", list("pairlist"), " type help page.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> list("as_pairlist()"), " is experimental because we are still figuring out\n", #> "the naming scheme for pairlists and node-like objects.\n")), #> "\n", "\n", list("internal"), "\n"), as_quosure.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "as_quosure"), "\n", list("as_quosure"), "\n", list( #> "new_quosure"), "\n", list("Coerce object to quosure"), #> "\n", list("\n", "as_quosure(x, env = NULL)\n", "\n", #> "new_quosure(expr, env = caller_env())\n"), "\n", #> list("\n", list(list("x"), list("An object to convert. Either an ", #> list("expression"), " or a\n", "formula.")), "\n", #> "\n", list(list("env"), list("The environment in which the expression should be\n", #> "evaluated. Only used for symbols and calls. This should typically\n", #> "be the environment in which the expression was created.")), #> "\n", "\n", list(list("expr"), list("The expression wrapped by the quosure.")), #> "\n"), "\n", list("\n", "While ", list("new_quosure()"), #> " wraps any R object (including expressions,\n", #> "formulas, or other quosures) into a quosure, ", #> list("as_quosure()"), "\n", "converts formulas and quosures and does not double-wrap.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", list( #> "\n", list(), " ", list("as_quosure()"), " now requires an explicit default environment for\n", #> "creating quosures from symbols and calls.\n", list(), #> " ", list("as_quosureish()"), " is deprecated as of rlang 0.2.0. This function\n", #> "assumes that quosures are formulas which is currently true but\n", #> "might not be in the future.\n"), "\n")), "\n", "\n", #> list("\n", "# as_quosure() converts expressions or any R object to a validly\n", #> "# scoped quosure:\n", "env <- env(var = \"thing\")\n", #> "as_quosure(quote(var), env)\n", "\n", "\n", "# The environment is ignored for formulas:\n", #> "as_quosure(~foo, env)\n", "as_quosure(~foo)\n", #> "\n", "# However you must supply it for symbols and calls:\n", #> "try(as_quosure(quote(var)))\n"), "\n", list("\n", #> list(list("quo()")), ", ", list(list("is_quosure()")), #> "\n"), "\n"), as_string.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/sym.R", "\n", #> list("as_string"), "\n", list("as_string"), "\n", list( #> "Cast symbol to string"), "\n", list("\n", "as_string(x)\n"), #> "\n", list("\n", list(list("x"), list("A string or symbol. If a string, the attributes are\n", #> "removed, if any.")), "\n"), "\n", list("\n", "A character vector of length 1.\n"), #> "\n", list("\n", list("as_string()"), " converts ", list( #> "symbols"), " to character strings.\n"), "\n", list( #> list("Unicode tags"), list("\n", "\n", "\n", "Unlike ", #> list(list("base::as.symbol()")), " and ", list( #> list("base::as.name()")), ", ", list("as_string()"), #> "\n", "automatically transforms unicode tags such as ", #> list("\"<U+5E78>\""), " to the\n", "proper UTF-8 character. This is important on Windows because:\n", #> list("\n", list(), " R on Windows has no UTF-8 support, and uses native encoding instead.\n", #> list(), " The native encodings do not cover all Unicode characters. For\n", #> "example, Western encodings do not support CKJ characters.\n", #> list(), " When a lossy UTF-8 -> native transformation occurs, uncovered\n", #> "characters are transformed to an ASCII unicode tag like ", #> list("\"<U+5E78>\""), ".\n", list(), " Symbols are always encoded in native. This means that\n", #> "transforming the column names of a data frame to symbols might be\n", #> "a lossy operation.\n", list(), " This operation is very common in the tidyverse because of data\n", #> "masking APIs like dplyr where data frames are transformed to\n", #> "environments. While the names of a data frame are stored as a\n", #> "character vector, the bindings of environments are stored as\n", #> "symbols.\n"), "\n", "\n", "Because it reencodes the ASCII unicode tags to their UTF-8\n", #> "representation, the string -> symbol -> string roundtrip is\n", #> "more stable with ", list("as_string()"), ".\n")), #> "\n", "\n", list("\n", "# Let's create some symbols:\n", #> "foo <- quote(foo)\n", "bar <- sym(\"bar\")\n", "\n", #> "# as_string() converts symbols to strings:\n", "foo\n", #> "as_string(foo)\n", "\n", "typeof(bar)\n", "typeof(as_string(bar))\n"), #> "\n", list("\n", list(list("as_name()")), " for a higher-level variant of ", #> list("as_string()"), "\n", "that automatically unwraps quosures.\n"), #> "\n"), as_utf8_character.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/utils-encoding.R", #> "\n", list("as_utf8_character"), "\n", list("as_utf8_character"), #> "\n", list("Coerce to a character vector and attempt encoding conversion"), #> "\n", list("\n", "as_utf8_character(x)\n"), "\n", list( #> "\n", list(list("x"), list("An object to coerce.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "Unlike specifying the ", list("encoding"), #> " argument in ", list("as_string()"), " and\n", list( #> "as_character()"), ", which is only declarative, these functions\n", #> "actually attempt to convert the encoding of their input. There are\n", #> "two possible cases:\n", list("\n", list(), " The string is tagged as UTF-8 or latin1, the only two encodings\n", #> "for which R has specific support. In this case, converting to the\n", #> "same encoding is a no-op, and converting to native always works\n", #> "as expected, as long as the native encoding, the one specified by\n", #> "the ", list("LC_CTYPE"), " locale has support for all characters occurring in\n", #> "the strings. Unrepresentable characters are serialised as unicode\n", #> "points: \"<U+xxxx>\".\n", list(), " The string is not tagged. R assumes that it is encoded in the\n", #> "native encoding. Conversion to native is a no-op, and conversion\n", #> "to UTF-8 should work as long as the string is actually encoded in\n", #> "the locale codeset.\n"), "\n", "\n", "When translating to UTF-8, the strings are parsed for serialised\n", #> "unicode points (e.g. strings looking like \"U+xxxx\") with\n", #> list(list("chr_unserialise_unicode()")), ". This helps to alleviate the effects of\n", #> "character-to-symbol-to-character roundtrips on systems with\n", #> "non-UTF-8 native encoding.\n"), "\n", list("\n", #> "# Let's create a string marked as UTF-8 (which is guaranteed by the\n", #> "# Unicode escaping in the string):\n", "utf8 <- \"caf\\uE9\"\n", #> "Encoding(utf8)\n", "as_bytes(utf8)\n"), "\n"), `bare-type-predicates.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", list( #> "bare-type-predicates"), "\n", list("bare-type-predicates"), #> "\n", list("is_bare_list"), "\n", list("is_bare_atomic"), #> "\n", list("is_bare_vector"), "\n", list("is_bare_double"), #> "\n", list("is_bare_integer"), "\n", list("is_bare_numeric"), #> "\n", list("is_bare_character"), "\n", list("is_bare_logical"), #> "\n", list("is_bare_raw"), "\n", list("is_bare_string"), #> "\n", list("is_bare_bytes"), "\n", list("Bare type predicates"), #> "\n", list("\n", "is_bare_list(x, n = NULL)\n", "\n", #> "is_bare_atomic(x, n = NULL)\n", "\n", "is_bare_vector(x, n = NULL)\n", #> "\n", "is_bare_double(x, n = NULL)\n", "\n", "is_bare_integer(x, n = NULL)\n", #> "\n", "is_bare_numeric(x, n = NULL)\n", "\n", "is_bare_character(x, n = NULL, encoding = NULL)\n", #> "\n", "is_bare_logical(x, n = NULL)\n", "\n", "is_bare_raw(x, n = NULL)\n", #> "\n", "is_bare_string(x, n = NULL)\n", "\n", "is_bare_bytes(x, n = NULL)\n"), #> "\n", list("\n", list(list("x"), list("Object to be tested.")), #> "\n", "\n", list(list("n"), list("Expected length of a vector.")), #> "\n", "\n", list(list("encoding"), list("Defunct as of rlang 0.4.0.")), #> "\n"), "\n", list("\n", "These predicates check for a given type but only return ", #> list("TRUE"), " for\n", "bare R objects. Bare objects have no class attributes. For example,\n", #> "a data frame is a list, but not a bare list.\n"), #> "\n", list("\n", list("\n", list(), " The predicates for vectors include the ", #> list("n"), " argument for\n", "pattern-matching on the vector length.\n", #> list(), " Like ", list(list("is_atomic()")), " and unlike base R ", #> list("is.atomic()"), ",\n", list("is_bare_atomic()"), #> " does not return ", list("TRUE"), " for ", list( #> "NULL"), ".\n", list(), " Unlike base R ", list( #> "is.numeric()"), ", ", list("is_bare_double()"), #> " only returns\n", list("TRUE"), " for floating point numbers.\n"), #> "\n"), "\n", list("\n", list("type-predicates"), #> ", ", list("scalar-type-predicates"), "\n"), "\n"), #> box.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/s3.R", "\n", #> list("box"), "\n", list("box"), "\n", list("new_box"), #> "\n", list("is_box"), "\n", list("unbox"), "\n", #> list("Box a value"), "\n", list("\n", "new_box(.x, class = NULL, ...)\n", #> "\n", "is_box(x, class = NULL)\n", "\n", "unbox(box)\n"), #> "\n", list("\n", list(list("class"), list("For ", #> list("new_box()"), ", an additional class for the\n", #> "boxed value (in addition to ", list("rlang_box"), #> "). For ", list("is_box()"), ", a class\n", "or vector of classes passed to ", #> list(list("inherits_all()")), ".")), "\n", "\n", #> list(list("..."), list("Additional attributes passed to ", #> list(list("base::structure()")), ".")), "\n", #> "\n", list(list("x, .x"), list("An R object.")), #> "\n", "\n", list(list("box"), list("A boxed value to unbox.")), #> "\n"), "\n", list("\n", list("new_box()"), " is similar to ", #> list(list("base::I()")), " but it protects a value by\n", #> "wrapping it in a scalar list rather than by adding an attribute.\n", #> list("unbox()"), " retrieves the boxed value. ", #> list("is_box()"), " tests whether an\n", "object is boxed with optional class. ", #> list("as_box()"), " ensures that a\n", "value is wrapped in a box. ", #> list("as_box_if()"), " does the same but only if\n", #> "the value matches a predicate.\n"), "\n", list( #> "\n", "boxed <- new_box(letters, \"mybox\")\n", #> "is_box(boxed)\n", "is_box(boxed, \"mybox\")\n", #> "is_box(boxed, \"otherbox\")\n", "\n", "unbox(boxed)\n", #> "\n", "# as_box() avoids double-boxing:\n", "boxed2 <- as_box(boxed, \"mybox\")\n", #> "boxed2\n", "unbox(boxed2)\n", "\n", "# Compare to:\n", #> "boxed_boxed <- new_box(boxed, \"mybox\")\n", #> "boxed_boxed\n", "unbox(unbox(boxed_boxed))\n", #> "\n", "# Use `as_box_if()` with a predicate if you need to ensure a box\n", #> "# only for a subset of values:\n", "as_box_if(NULL, is_null, \"null_box\")\n", #> "as_box_if(\"foo\", is_null, \"null_box\")\n"), #> "\n"), call2.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call2"), "\n", list("call2"), "\n", list( #> "Create a call"), "\n", list("\n", "call2(.fn, ..., .ns = NULL)\n"), #> "\n", list("\n", list(list(".fn"), list("Function to call. Must be a callable object: a string,\n", #> "symbol, call, or a function.")), "\n", "\n", #> list(list("..."), list("Arguments to the call either in or out of a list. These dots\n", #> "support ", list("tidy dots"), " features. Empty arguments are preserved.")), #> "\n", "\n", list(list(".ns"), list("Namespace with which to prefix ", #> list(".fn"), ". Must be a string\n", "or symbol.")), #> "\n"), "\n", list("\n", "Quoted function calls are one of the two types of\n", #> list("symbolic"), " objects in R. They represent the action of\n", #> "calling a function, possibly with arguments. There are two ways of\n", #> "creating a quoted call:\n", list("\n", list(), #> " By ", list("quoting"), " it. Quoting prevents functions from being\n", #> "called. Instead, you get the description of the function call as\n", #> "an R object. That is, a quoted function call.\n", #> list(), " By constructing it with ", list(list( #> "base::call()")), ", ", list(list("base::as.call()")), #> ", or\n", list("call2()"), ". In this case, you pass the call elements (the function\n", #> "to call and the arguments to call it with) separately.\n"), #> "\n", "\n", "See section below for the difference between ", #> list("call2()"), " and the base\n", "constructors.\n"), #> "\n", list(list("Difference with base constructors"), #> list("\n", "\n", "\n", list("call2()"), " is more flexible and convenient than ", #> list("base::call()"), ":\n", list("\n", list(), #> " The function to call can be a string or a ", #> list("callable"), "\n", "object: a symbol, another call (e.g. a ", #> list("$"), " or ", list("[["), " call), or a\n", #> "function to inline. ", list("base::call()"), #> " only supports strings and you\n", "need to use ", #> list("base::as.call()"), " to construct a call with a callable\n", #> "object.", list("call2(list, 1, 2)\n", "\n", #> "as.call(list(list, 1, 2))\n"), "\n", list(), #> " The ", list(".ns"), " argument is convenient for creating namespaced calls.", #> list("call2(\"list\", 1, 2, .ns = \"base\")\n", #> "\n", "ns_call <- as.call(list(as.name(\"::\"), as.name(\"list\"), as.name(\"base\")))\n", #> "as.call(list(ns_call, 1, 2))\n"), "\n", #> list(), " ", list("call2()"), " has ", list( #> "tidy dots"), " support and you can splice lists\n", #> "of arguments with ", list("!!!"), ". With base R, you need to use ", #> list("as.call()"), "\n", "instead of ", list( #> "call()"), " if the arguments are in a list.", #> list("args <- list(na.rm = TRUE, trim = 0)\n", #> "\n", "call2(\"mean\", 1:10, !!!args)\n", #> "\n", "as.call(c(list(as.name(\"mean\"), 1:10), args))\n"), #> "\n"), "\n")), "\n", "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "In rlang 0.2.0 ", list( #> "lang()"), " was soft-deprecated and renamed to\n", #> list("call2()"), ".\n", "\n", "In early versions of rlang calls were called \"language\" objects in\n", #> "order to follow the R type nomenclature as returned by\n", #> list(list("base::typeof()")), ". The goal was to avoid adding to the confusion\n", #> "between S modes and R types. With hindsight we find it is better to\n", #> "use more meaningful type names.\n")), "\n", #> "\n", list("\n", "# fn can either be a string, a symbol or a call\n", #> "call2(\"f\", a = 1)\n", "call2(quote(f), a = 1)\n", #> "call2(quote(f()), a = 1)\n", "\n", "#' Can supply arguments individually or in a list\n", #> "call2(quote(f), a = 1, b = 2)\n", "call2(quote(f), !!!list(a = 1, b = 2))\n", #> "\n", "# Creating namespaced calls is easy:\n", #> "call2(\"fun\", arg = quote(baz), .ns = \"mypkg\")\n", #> "\n", "# Empty arguments are preserved:\n", "call2(\"[\", quote(x), , drop = )\n"), #> "\n", list("\n", "call_modify\n"), "\n"), call_args.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("call_args"), "\n", list("call_args"), "\n", #> list("call_args_names"), "\n", list("Extract arguments from a call"), #> "\n", list("\n", "call_args(call)\n", "\n", "call_args_names(call)\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n"), "\n", list("\n", "A named list of arguments.\n"), #> "\n", list("\n", "Extract arguments from a call\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "In rlang 0.2.0, ", list("lang_args()"), " and ", #> list("lang_args_names()"), " were\n", "deprecated and renamed to ", #> list("call_args()"), " and ", list("call_args_names()"), #> ".\n", "See lifecycle section in ", list(list( #> "call2()")), " for more about this change.\n")), #> "\n", "\n", list("\n", "call <- quote(f(a, b))\n", #> "\n", "# Subsetting a call returns the arguments converted to a language\n", #> "# object:\n", "call[-1]\n", "\n", "# On the other hand, call_args() returns a regular list that is\n", #> "# often easier to work with:\n", "str(call_args(call))\n", #> "\n", "# When the arguments are unnamed, a vector of empty strings is\n", #> "# supplied (rather than NULL):\n", "call_args_names(call)\n"), #> "\n", list("\n", list(list("fn_fmls()")), " and ", #> list(list("fn_fmls_names()")), "\n"), "\n"), #> call_fn.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call_fn"), "\n", list("call_fn"), "\n", #> list("Extract function from a call"), "\n", list( #> "\n", "call_fn(call, env = caller_env())\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n", "\n", list(list("env"), list("The environment where to find the definition of the\n", #> "function quoted in ", list("call"), " in case ", #> list("call"), " is not wrapped in a\n", "quosure.")), #> "\n"), "\n", list("\n", "If a frame or formula, the function will be retrieved from the\n", #> "associated environment. Otherwise, it is looked up in the calling\n", #> "frame.\n"), "\n", list(list("Life cycle"), list( #> "\n", "\n", "\n", "In rlang 0.2.0, ", list("lang_fn()"), #> " was deprecated and renamed to\n", list("call_fn()"), #> ". See lifecycle section in ", list(list("call2()")), #> " for more about this\n", "change.\n")), "\n", #> "\n", list("\n", "# Extract from a quoted call:\n", #> "call_fn(quote(matrix()))\n", "call_fn(quo(matrix()))\n", #> "\n", "# Extract the calling function\n", "test <- function() call_fn(call_frame())\n", #> "test()\n"), "\n", list("\n", list(list("call_name()")), #> "\n"), "\n"), call_inspect.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/stack.R", #> "\n", list("call_inspect"), "\n", list("call_inspect"), #> "\n", list("Inspect a call"), "\n", list("\n", "call_inspect(...)\n"), #> "\n", list("\n", list(list("..."), list("Arguments to display in the returned call.")), #> "\n"), "\n", list("\n", "This function is useful for quick testing and debugging when you\n", #> "manipulate expressions and calls. It lets you check that a function\n", #> "is called with the right arguments. This can be useful in unit\n", #> "tests for instance. Note that this is just a simple wrapper around\n", #> list(list("base::match.call()")), ".\n"), "\n", #> list("\n", "call_inspect(foo(bar), \"\" %>% identity())\n"), #> "\n"), call_modify.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call_modify"), "\n", list("call_modify"), #> "\n", list("Modify the arguments of a call"), "\n", #> list("\n", "call_modify(.call, ..., .homonyms = c(\"keep\", \"first\", \"last\", \"error\"),\n", #> " .standardise = NULL, .env = caller_env())\n"), #> "\n", list("\n", list(list(".call"), list("Can be a call, a formula quoting a call in the\n", #> "right-hand side, or a frame object from which to extract the call\n", #> "expression.")), "\n", "\n", list(list("..."), #> list("Named or unnamed expressions (constants, names or calls)\n", #> "used to modify the call. Use ", list(list( #> "zap()")), " to remove arguments. These\n", #> "dots support ", list("tidy dots"), " features. Empty arguments are\n", #> "allowed and preserved.")), "\n", "\n", list( #> list(".homonyms"), list("How to treat arguments with the same name. The\n", #> "default, ", list("\"keep\""), ", preserves these arguments. Set ", #> list(".homonyms"), " to\n", list("\"first\""), #> " to only keep the first occurrences, to ", #> list("\"last\""), " to keep\n", "the last occurrences, and to ", #> list("\"error\""), " to raise an informative\n", #> "error and indicate what arguments have duplicated names.")), #> "\n", "\n", list(list(".standardise, .env"), #> list("Soft-deprecated as of rlang 0.3.0. Please\n", #> "call ", list(list("call_standardise()")), #> " manually.")), "\n"), "\n", list("\n", "A quosure if ", #> list(".call"), " is a quosure, a call otherwise.\n"), #> "\n", list("\n", "If you are working with a user-supplied call, make sure the\n", #> "arguments are standardised with ", list(list( #> "call_standardise()")), " before\n", "modifying the call.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", list( #> "\n", list(), " The ", list(".standardise"), #> " argument is deprecated as of rlang 0.3.0.\n", #> list(), " In rlang 0.2.0, ", list("lang_modify()"), #> " was deprecated and renamed to\n", list("call_modify()"), #> ". See lifecycle section in ", list(list("call2()")), #> " for more about\n", "this change.\n"), "\n")), #> "\n", "\n", list("\n", "call <- quote(mean(x, na.rm = TRUE))\n", #> "\n", "# Modify an existing argument\n", "call_modify(call, na.rm = FALSE)\n", #> "call_modify(call, x = quote(y))\n", "\n", "# Remove an argument\n", #> "call_modify(call, na.rm = zap())\n", "\n", "# Add a new argument\n", #> "call_modify(call, trim = 0.1)\n", "\n", "# Add an explicit missing argument:\n", #> "call_modify(call, na.rm = )\n", "\n", "# Supply a list of new arguments with `!!!`\n", #> "newargs <- list(na.rm = NULL, trim = 0.1)\n", #> "call <- call_modify(call, !!!newargs)\n", "call\n", #> "\n", "# Remove multiple arguments by splicing zaps:\n", #> "newargs <- rep_named(c(\"na.rm\", \"trim\"), list(zap()))\n", #> "call <- call_modify(call, !!!newargs)\n", "call\n", #> "\n", "\n", "# Modify the `...` arguments as if it were a named argument:\n", #> "call <- call_modify(call, ... = )\n", "call\n", #> "\n", "call <- call_modify(call, ... = zap())\n", #> "call\n", "\n", "\n", "# When you're working with a user-supplied call, standardise it\n", #> "# beforehand because it might contain unmatched arguments:\n", #> "user_call <- quote(matrix(x, nc = 3))\n", "call_modify(user_call, ncol = 1)\n", #> "\n", "# Standardising applies the usual argument matching rules:\n", #> "user_call <- call_standardise(user_call)\n", #> "user_call\n", "call_modify(user_call, ncol = 1)\n", #> "\n", "\n", "# You can also modify quosures inplace:\n", #> "f <- quo(matrix(bar))\n", "call_modify(f, quote(foo))\n", #> "\n", "\n", "# By default, arguments with the same name are kept. This has\n", #> "# subtle implications, for instance you can move an argument to\n", #> "# last position by removing it and remapping it:\n", #> "call <- quote(foo(bar = , baz))\n", "call_modify(call, bar = NULL, bar = missing_arg())\n", #> "\n", "# You can also choose to keep only the first or last homonym\n", #> "# arguments:\n", "args <- list(bar = NULL, bar = missing_arg())\n", #> "call_modify(call, !!!args, .homonyms = \"first\")\n", #> "call_modify(call, !!!args, .homonyms = \"last\")\n"), #> "\n"), call_name.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("call_name"), "\n", list("call_name"), #> "\n", list("call_ns"), "\n", list("Extract function name or namespaced of a call"), #> "\n", list("\n", "call_name(call)\n", "\n", "call_ns(call)\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n"), "\n", list("\n", "A string with the function name, or ", #> list("NULL"), " if the function\n", "is anonymous.\n"), #> "\n", list("\n", "Extract function name or namespaced of a call\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "In rlang 0.2.0, ", list("lang_name()"), " was deprecated and renamed to\n", #> list("call_name()"), ". See lifecycle section in ", #> list(list("call2()")), " for more about\n", "this change.\n")), #> "\n", "\n", list("\n", "# Extract the function name from quoted calls:\n", #> "call_name(quote(foo(bar)))\n", "call_name(quo(foo(bar)))\n", #> "\n", "# Namespaced calls are correctly handled:\n", #> "call_name(~base::matrix(baz))\n", "\n", "# Anonymous and subsetted functions return NULL:\n", #> "call_name(quote(foo$bar()))\n", "call_name(quote(foo[[bar]]()))\n", #> "call_name(quote(foo()()))\n", "\n", "# Extract namespace of a call with call_ns():\n", #> "call_ns(quote(base::bar()))\n", "\n", "# If not namespaced, call_ns() returns NULL:\n", #> "call_ns(quote(bar()))\n"), "\n", list("\n", #> list(list("call_fn()")), "\n"), "\n"), call_standardise.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("call_standardise"), "\n", list("call_standardise"), #> "\n", list("Standardise a call"), "\n", list("\n", #> "call_standardise(call, env = caller_env())\n"), #> "\n", list("\n", list(list("call"), list("Can be a call or a quosure that wraps a call.")), #> "\n", "\n", list(list("env"), list("The environment where to find the definition of the\n", #> "function quoted in ", list("call"), " in case ", #> list("call"), " is not wrapped in a\n", "quosure.")), #> "\n"), "\n", list("\n", "A quosure if ", list( #> "call"), " is a quosure, a raw call otherwise.\n"), #> "\n", list("\n", "This is essentially equivalent to ", #> list(list("base::match.call()")), ", but with\n", #> "experimental handling of primitive functions.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "In rlang 0.2.0, ", list("lang_standardise()"), #> " was deprecated and renamed to\n", list("call_standardise()"), #> ". See lifecycle section in ", list(list("call2()")), #> " for more\n", "about this change.\n")), "\n", #> "\n"), caller_env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("caller_env"), "\n", list("caller_env"), #> "\n", list("current_env"), "\n", list("Get the current or caller environment"), #> "\n", list("\n", "caller_env(n = 1)\n", "\n", "current_env()\n"), #> "\n", list("\n", list(list("n"), list("Number of frames to go back.")), #> "\n"), "\n", list("\n", list("\n", list(), " The current environment is the execution environment of the\n", #> "current function (the one currently being evaluated).\n", #> list(), " The caller environment is the execution environment of the\n", #> "function that called the current function.\n"), #> "\n"), "\n", list("\n", "# Let's create a function that returns its current environment and\n", #> "# its caller environment:\n", "fn <- function() list(current = current_env(), caller = caller_env())\n", #> "\n", "# The current environment is an unique execution environment\n", #> "# created when `fn()` was called. The caller environment is the\n", #> "# global env because that's where we called `fn()`.\n", #> "fn()\n", "\n", "# Let's call `fn()` again but this time within a function:\n", #> "g <- function() fn()\n", "\n", "# Now the caller environment is also an unique execution environment.\n", #> "# This is the exec env created by R for our call to g():\n", #> "g()\n"), "\n", list("\n", list(list("caller_frame()")), #> " and ", list(list("current_frame()")), "\n"), #> "\n"), caller_fn.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/stack.R", #> "\n", list("caller_fn"), "\n", list("caller_fn"), #> "\n", list("current_fn"), "\n", list("Get properties of the current or caller frame"), #> "\n", list("\n", "caller_fn(n = 1)\n", "\n", "current_fn()\n"), #> "\n", list("\n", list(list("n"), list("The number of generations to go back.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", list("\n", list(), " The current frame is the execution context of the function that\n", #> "is currently being evaluated.\n", list(), #> " The caller frame is the execution context of the function that\n", #> "called the function currently being evaluated.\n"), #> "\n", "\n", "See the ", list("call stack"), " topic for more information.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "These functions are experimental.\n")), "\n", #> "\n", list("\n", list(list("caller_env()")), " and ", #> list(list("current_env()")), "\n"), "\n"), caller_frame.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("caller_frame"), "\n", list("caller_frame"), #> "\n", list("Get caller frame"), "\n", list("\n", #> "caller_frame(n = 1)\n"), "\n", list("\n", list( #> list("n"), list("Number of frames to go back.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n"), "\n", list("internal"), "\n"), catch_cnd.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-handlers.R", #> "\n", list("catch_cnd"), "\n", list("catch_cnd"), #> "\n", list("Catch a condition"), "\n", list("\n", #> "catch_cnd(expr, classes = \"condition\")\n"), #> "\n", list("\n", list(list("expr"), list("Expression to be evaluated with a catching condition\n", #> "handler.")), "\n", "\n", list(list("classes"), #> list("A character vector of condition classes to catch. By\n", #> "default, catches all conditions.")), "\n"), #> "\n", list("\n", "A condition if any was signalled, ", #> list("NULL"), " otherwise.\n"), "\n", list("\n", #> "This is a small wrapper around ", list("tryCatch()"), #> " that captures any\n", "condition signalled while evaluating its argument. It is useful for\n", #> "situations where you expect a specific condition to be signalled,\n", #> "for debugging, and for unit testing.\n"), "\n", #> list("\n", "catch_cnd(10)\n", "catch_cnd(abort(\"an error\"))\n", #> "catch_cnd(cnd_signal(\"my_condition\", .msg = \"a condition\"))\n"), #> "\n"), chr_unserialise_unicode.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/utils-encoding.R", #> "\n", list("chr_unserialise_unicode"), "\n", list( #> "chr_unserialise_unicode"), "\n", list("Translate unicode points to UTF-8"), #> "\n", list("\n", "chr_unserialise_unicode(chr)\n"), #> "\n", list("\n", list(list("chr"), list("A character vector.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "For historical reasons, R translates strings to the native encoding\n", #> "when they are converted to symbols. This string-to-symbol\n", #> "conversion is not a rare occurrence and happens for instance to the\n", #> "names of a list of arguments converted to a call by ", #> list("do.call()"), ".\n", "\n", "If the string contains unicode characters that cannot be\n", #> "represented in the native encoding, R serialises those as an ASCII\n", #> "sequence representing the unicode point. This is why Windows users\n", #> "with western locales often see strings looking like ", #> list("<U+xxxx>"), ". To\n", "alleviate some of the pain, rlang parses strings and looks for\n", #> "serialised unicode points to translate them back to the proper\n", #> "UTF-8 representation. This transformation occurs automatically in\n", #> "functions like ", list(list("env_names()")), #> " and can be manually triggered with\n", list( #> "as_utf8_character()"), " and ", list("chr_unserialise_unicode()"), #> ".\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "This function is experimental.\n")), #> "\n", "\n", list("\n", "ascii <- \"<U+5E78>\"\n", #> "chr_unserialise_unicode(ascii)\n", "\n", "identical(chr_unserialise_unicode(ascii), \"\\u5e78\")\n"), #> "\n", list("internal"), "\n"), cnd.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-error.R, R/cnd.R", #> "\n", list("error_cnd"), "\n", list("error_cnd"), #> "\n", list("cnd"), "\n", list("warning_cnd"), "\n", #> list("message_cnd"), "\n", list("Create a condition object"), #> "\n", list("\n", "error_cnd(.subclass = NULL, ..., message = \"\", trace = NULL,\n", #> " parent = NULL)\n", "\n", "cnd(.subclass, ..., message = \"\")\n", #> "\n", "warning_cnd(.subclass = NULL, ..., message = \"\")\n", #> "\n", "message_cnd(.subclass = NULL, ..., message = \"\")\n"), #> "\n", list("\n", list(list(".subclass"), list("The condition subclass.")), #> "\n", "\n", list(list("..."), list("Named data fields stored inside the condition\n", #> "object. These dots are evaluated with ", list( #> "explicit splicing"), ".")), "\n", "\n", #> list(list("message"), list("A default message to inform the user about the\n", #> "condition when it is signalled.")), "\n", #> "\n", list(list("trace"), list("A ", list("trace"), #> " object created by ", list(list("trace_back()")), #> ".")), "\n", "\n", list(list("parent"), list( #> "A parent condition object created by ", list( #> list("abort()")), ".")), "\n"), "\n", list( #> "\n", "These constructors make it easy to create subclassed conditions.\n", #> "Conditions are objects that power the error system in R. They can\n", #> "also be used for passing messages to pre-established handlers.\n"), #> "\n", list("\n", list("cnd()"), " creates objects inheriting from ", #> list("condition"), ". Conditions\n", "created with ", #> list("error_cnd()"), ", ", list("warning_cnd()"), #> " and ", list("message_cnd()"), "\n", "inherit from ", #> list("error"), ", ", list("warning"), " or ", #> list("message"), ".\n"), "\n", list(list("Lifecycle"), #> list("\n", "\n", "\n", "The ", list(".type"), #> " and ", list(".msg"), " arguments have been renamed to ", #> list(".subclass"), "\n", "and ", list("message"), #> ". They are deprecated as of rlang 0.3.0.\n")), #> "\n", "\n", list("\n", "# Create a condition inheriting from the s3 type \"foo\":\n", #> "cnd <- cnd(\"foo\")\n", "\n", "# Signal the condition to potential handlers. Since this is a bare\n", #> "# condition the signal has no effect if no handlers are set up:\n", #> "cnd_signal(cnd)\n", "\n", "# When a relevant handler is set up, the signal causes the handler\n", #> "# to be called:\n", "with_handlers(cnd_signal(cnd), foo = exiting(function(c) \"caught!\"))\n", #> "\n", "# Handlers can be thrown or executed inplace. See with_handlers()\n", #> "# documentation for more on this.\n", "\n", #> "# Signalling an error condition aborts the current computation:\n", #> "err <- error_cnd(\"foo\", message = \"I am an error\")\n", #> "try(cnd_signal(err))\n"), "\n", list("\n", list( #> list("cnd_signal()")), ", ", list(list("with_handlers()")), #> ".\n"), "\n"), cnd_message.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-message.R", #> "\n", list("cnd_message"), "\n", list("cnd_message"), #> "\n", list("cnd_issue"), "\n", list("cnd_bullets"), #> "\n", list("Build an error message from a main issue and bullet messages"), #> "\n", list("\n", "cnd_message(cnd)\n", "\n", "cnd_issue(cnd, ...)\n", #> "\n", "cnd_bullets(cnd, ...)\n"), "\n", list( #> "\n", list(list("cnd"), list("A condition object.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", list("cnd_message()"), " assembles an error message from two components:\n", #> list("\n", list(), " The ", list("cnd_issue()"), #> " generic. Methods should return a single line.\n", #> list(), " The ", list("cnd_bullets()"), " generic. Methods should return a named vector\n", #> "of lines. These lines are automatically prefixed with a bullet by\n", #> list("cnd_message()"), " (see the section on error statements).\n"), #> "\n", "\n", list("cnd_message()"), " is automatically called by the ", #> list("conditionMessage()"), "\n", "for rlang errors so that errors thrown with ", #> list(list("abort()")), " only need to\n", "implement ", #> list("cnd_issue()"), " and ", list("cnd_bullets()"), #> ". It can also be called\n", "in custom ", list( #> "conditionMessage()"), " methods.\n"), "\n", #> list(list("Error statements"), list("\n", "\n", "\n", #> "This experimental infrastructure is based on the idea that\n", #> "sentences in error messages are best kept short and simple. From\n", #> "this point of view, the best way to present the information is as a\n", #> "bullet list of simple sentences containing a single clause.\n", #> list("cnd_message()"), " helps following this structure by building an error\n", #> "message from two parts: the ", list("issue"), #> " and the ", list("bullets"), ".\n", "\n", list( #> "cnd_issue()"), " is the generic for the main error message. It should\n", #> "be as generic as possible, but since it is a generic it is easy to\n", #> "override by error subclasses.\n", "\n", "The ", #> list("cnd_bullets()"), " methods should return a character vector of\n", #> "sentences. These are automatically prefixed with bullets by\n", #> list("cnd_message()"), ", according to the following scheme:\n", #> list("\n", list(), " Elements named ", list("\"i\""), #> " are prefixed with a blue \"info\" symbol.\n", #> list(), " Elements named ", list("\"x\""), #> " are prefixed with a red \"cross\" symbol.\n", #> list(), " Unnamed elements are prefixed with a \"*\" symbol.\n"), #> "\n", "\n", "While you are free to lay out the bullets in the order that you\n", #> "like, \"x\" bullets should usually precede \"i\" bullets.\n")), #> "\n", "\n", list(list("Overriding ", list("cnd_bullets()")), #> list("\n", "\n", "\n", "Sometimes the generation of an error message depends on the state\n", #> "of the type checking. In that case, it can be tricky to lazily\n", #> "generate error messages with ", list("cnd_bullets()"), #> ": you can either\n", "overspecify your error class hierarchies with one class per state,\n", #> "or replicate the type-checking control flow within the\n", #> list("cnd_bullets()"), " method. None of these options are ideal.\n", #> "\n", "A better option is to define a ", list( #> ".bullets"), " field in your error\n", "object. This should be a function (or a lambda-formula which will\n", #> "be passed to ", list(list("as_function()")), #> ") with the same signature as\n", list("cnd_bullets()"), #> " methods. This function overrides the\n", #> list("cnd_bullets()"), " generic and can generate an error message tailored\n", #> "to the state in which the error was constructed.\n", #> "\n", "Note that as a rule, ", list("cnd_issue()"), #> " should be a general thematic\n", "issues that does not depend on state. For this reason, it isn't\n", #> "possible to define an overriding method in the condition object.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> "\n", "This infrastructure is experimental. In particular, the output of\n", #> list("cnd_message()"), " is likely to change in the future and you shouldn't\n", #> "test it verbatim in a way that makes R CMD check fail. Instead, use\n", #> list(list("testthat::verify_output()")), " to monitor the output without causing\n", #> "CRAN check failures when it changes.\n")), "\n", #> "\n", list("internal"), "\n"), cnd_muffle.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-handlers.R", #> "\n", list("cnd_muffle"), "\n", list("cnd_muffle"), #> "\n", list("Muffle a condition"), "\n", list("\n", #> "cnd_muffle(cnd)\n"), "\n", list("\n", list(list( #> "cnd"), list("A condition to muffle.")), "\n"), #> "\n", list("\n", "Unlike ", list(list("exiting()")), #> " handlers, ", list(list("calling()")), " handlers must be explicit\n", #> "that they have handled a condition to stop it from propagating to\n", #> "other handlers. Use ", list("cnd_muffle()"), #> " within a calling handler (or as\n", "a calling handler, see examples) to prevent any other handlers from\n", #> "being called for that condition.\n"), "\n", #> list(list("Mufflable conditions"), list("\n", "\n", #> "\n", "Most conditions signalled by base R are muffable, although the name\n", #> "of the restart varies. cnd_muffle() will automatically call the\n", #> "correct restart for you. It is compatible with the following\n", #> "conditions:\n", list("\n", list(), " ", list( #> "warning"), " and ", list("message"), " conditions. In this case ", #> list("cnd_muffle()"), "\n", "is equivalent to ", #> list(list("base::suppressMessages()")), " and\n", #> list(list("base::suppressWarnings()")), ".\n", #> list(), " Bare conditions signalled with ", #> list("signal()"), " or ", list(list("cnd_signal()")), #> ". Note\n", "that conditions signalled with ", #> list(list("base::signalCondition()")), " are not\n", #> "mufflable.\n", list(), " Interrupts are sometimes signalled with a ", #> list("resume"), " restart on\n", "recent R versions. When this is the case, you can muffle the\n", #> "interrupt with ", list("cnd_muffle()"), ". Check if a restart is available\n", #> "with ", list("base::findRestart(\"resume\")"), #> ".\n"), "\n", "\n", "If you call ", list("cnd_muffle()"), #> " with a condition that is not mufflable\n", #> "you will cause a new error to be signalled.\n", #> list("\n", list(), " Errors are not mufflable since they are signalled in critical\n", #> "situations where execution cannot continue safely.\n", #> list(), " Conditions captured with ", list( #> list("base::tryCatch()")), ", ", list(list( #> "with_handlers()")), " or\n", list(list("catch_cnd()")), #> " are no longer mufflable. Muffling restarts ", #> list("must"), "\n", "be called from a ", list( #> "calling"), " handler.\n"), "\n")), "\n", #> "\n", list("\n", "fn <- function() {\n", " inform(\"Beware!\", \"my_particular_msg\")\n", #> " inform(\"On your guard!\")\n", " \"foobar\"\n", #> "}\n", "\n", "# Let's install a muffling handler for the condition thrown by `fn()`.\n", #> "# This will suppress all `my_particular_wng` warnings but let other\n", #> "# types of warnings go through:\n", "with_handlers(fn(),\n", #> " my_particular_msg = calling(function(cnd) {\n", #> " inform(\"Dealt with this particular message\")\n", #> " cnd_muffle(cnd)\n", " })\n", ")\n", "\n", #> "# Note how execution of `fn()` continued normally after dealing\n", #> "# with that particular message.\n", "\n", "# cnd_muffle() can also be passed to with_handlers() as a calling\n", #> "# handler:\n", "with_handlers(fn(),\n", " my_particular_msg = calling(cnd_muffle)\n", #> ")\n"), "\n"), cnd_signal.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-signal.R", #> "\n", list("cnd_signal"), "\n", list("cnd_signal"), #> "\n", list("Signal a condition object"), "\n", list( #> "\n", "cnd_signal(cnd, .cnd, .mufflable)\n"), #> "\n", list("\n", list(list("cnd"), list("A condition object (see ", #> list(list("cnd()")), ").")), "\n", "\n", list( #> list(".cnd, .mufflable"), list("These arguments are deprecated.")), #> "\n"), "\n", list("\n", "The type of signal depends on the class of the condition:\n", #> list("\n", list(), " A message is signalled if the condition inherits from\n", #> list("\"message\""), ". This is equivalent to signalling with ", #> list(list("inform()")), " or\n", list(list( #> "base::message()")), ".\n", list(), " A warning is signalled if the condition inherits from\n", #> list("\"warning\""), ". This is equivalent to signalling with ", #> list(list("warn()")), " or\n", list(list("base::warning()")), #> ".\n", list(), " An error is signalled if the condition inherits from\n", #> list("\"error\""), ". This is equivalent to signalling with ", #> list(list("abort()")), " or\n", list(list("base::stop()")), #> ".\n", list(), " An interrupt is signalled if the condition inherits from\n", #> list("\"interrupt\""), ". This is equivalent to signalling with\n", #> list(list("interrupt()")), ".\n"), "\n", "\n", #> "Use ", list(list("cnd_type()")), " to determine the type of a condition.\n"), #> "\n", list(list("Lifecycle"), list("\n", "\n", list( #> "\n", list(), " ", list(".cnd"), " has been renamed to ", #> list("cnd"), " and is deprecated as of rlang 0.3.0.\n", #> list(), " The ", list(".mufflable"), " argument is deprecated as of rlang 0.3.0 and no\n", #> "longer has any effect. Non-critical conditions are always\n", #> "signalled with a muffle restart.\n", list(), #> " Creating a condition object with ", list(list( #> "cnd_signal()")), " is deprecated as\n", "of rlang 0.3.0. Please use ", #> list(list("signal()")), " instead.\n"), "\n")), #> "\n", "\n", list("\n", "# The type of signal depends on the class. If the condition\n", #> "# inherits from \"warning\", a warning is issued:\n", #> "cnd <- warning_cnd(\"my_warning_class\", message = \"This is a warning\")\n", #> "cnd_signal(cnd)\n", "\n", "# If it inherits from \"error\", an error is raised:\n", #> "cnd <- error_cnd(\"my_error_class\", message = \"This is an error\")\n", #> "try(cnd_signal(cnd))\n"), "\n", list("\n", list( #> list("abort()")), ", ", list(list("warn()")), #> " and ", list(list("inform()")), " for creating and\n", #> "signalling structured R conditions. See ", list( #> list("with_handlers()")), " for\n", "establishing condition handlers.\n"), #> "\n"), cnd_type.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd.R", "\n", #> list("cnd_type"), "\n", list("cnd_type"), "\n", list( #> "What type is a condition?"), "\n", list("\n", #> "cnd_type(cnd)\n"), "\n", list("\n", list(list( #> "cnd"), list("A condition object.")), "\n"), #> "\n", list("\n", "A string, either ", list("\"condition\""), #> ", ", list("\"message\""), ", ", list("\"warning\""), #> ",\n", list("\"error\""), " or ", list("\"interrupt\""), #> ".\n"), "\n", list("\n", "Use ", list("cnd_type()"), #> " to check what type a condition is.\n"), "\n", #> list("\n", "cnd_type(catch_cnd(abort(\"Abort!\")))\n", #> "cnd_type(catch_cnd(interrupt()))\n"), "\n"), #> done.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/s3.R", "\n", #> list("done"), "\n", list("done"), "\n", list("is_done_box"), #> "\n", list("Box a final value for early termination"), #> "\n", list("\n", "done(x)\n", "\n", "is_done_box(x, empty = NULL)\n"), #> "\n", list("\n", list(list("x"), list("For ", list( #> "done()"), ", a value to box. For ", list("is_done_box()"), #> ", a\n", "value to test.")), "\n", "\n", list( #> list("empty"), list("Whether the box is empty. If ", #> list("NULL"), ", ", list("is_done_box()"), #> "\n", "returns ", list("TRUE"), " for all done boxes. If ", #> list("TRUE"), ", it returns ", list("TRUE"), #> "\n", "only for empty boxes. Otherwise it returns ", #> list("TRUE"), " only for\n", "non-empty boxes.")), #> "\n"), "\n", list("\n", "A ", list("boxed"), #> " value.\n"), "\n", list("\n", "A value boxed with ", #> list("done()"), " signals to its caller that it\n", #> "should stop iterating. Use it to shortcircuit a loop.\n"), #> "\n", list("\n", "done(3)\n", "\n", "x <- done(3)\n", #> "is_done_box(x)\n"), "\n"), dots_definitions.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/dots.R", "\n", #> list("dots_definitions"), "\n", list("dots_definitions"), #> "\n", list("Capture definition objects"), "\n", list( #> "\n", "dots_definitions(..., .named = FALSE, .ignore_empty = c(\"trailing\",\n", #> " \"none\", \"all\"))\n"), "\n", list("\n", #> list(list("..."), list("For ", list("enexprs()"), #> ", ", list("ensyms()"), " and ", list("enquos()"), #> ", names of\n", "arguments to capture without evaluation (including ", #> list("..."), "). For\n", list("exprs()"), " and ", #> list("quos()"), ", the expressions to capture unevaluated\n", #> "(including expressions contained in ", list( #> "..."), ").")), "\n", "\n", list(list(".named"), #> list("Whether to ensure all dots are named. Unnamed\n", #> "elements are processed with ", list(list( #> "quo_name()")), " to build a default\n", #> "name. See also ", list(list("quos_auto_name()")), #> ".")), "\n", "\n", list(list(".ignore_empty"), #> list("Whether to ignore empty arguments. Can be one\n", #> "of ", list("\"trailing\""), ", ", list("\"none\""), #> ", ", list("\"all\""), ". If ", list("\"trailing\""), #> ", only the\n", "last argument is ignored if it is empty. Note that ", #> list("\"trailing\""), "\n", "applies only to arguments passed in ", #> list("..."), ", not to named\n", "arguments. On the other hand, ", #> list("\"all\""), " also applies to named\n", #> "arguments.")), "\n"), "\n", list("\n", "Capture definition objects\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> list("dots_definitions()"), " is experimental. Expect API changes.\n")), #> "\n", "\n", list("internal"), "\n"), dots_n.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/dots.R", "\n", #> list("dots_n"), "\n", list("dots_n"), "\n", list( #> "How many arguments are currently forwarded in dots?"), #> "\n", list("\n", "dots_n(...)\n"), "\n", list("\n", #> list(list("..."), list("Forwarded arguments.")), #> "\n"), "\n", list("\n", "This returns the number of arguments currently forwarded in ", #> list("..."), "\n", "as an integer.\n"), "\n", #> list("\n", "fn <- function(...) dots_n(..., baz)\n", #> "fn(foo, bar)\n"), "\n"), dots_values.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/dots.R", "\n", #> list("dots_values"), "\n", list("dots_values"), "\n", #> list("Evaluate dots with preliminary splicing"), #> "\n", list("\n", "dots_values(..., .ignore_empty = c(\"trailing\", \"none\", \"all\"),\n", #> " .preserve_empty = FALSE, .homonyms = c(\"keep\", \"first\", \"last\",\n", #> " \"error\"), .check_assign = FALSE)\n"), "\n", #> list("\n", list(list("..."), list("Arguments to evaluate and process splicing operators.")), #> "\n", "\n", list(list(".ignore_empty"), list( #> "Whether to ignore empty arguments. Can be one\n", #> "of ", list("\"trailing\""), ", ", list("\"none\""), #> ", ", list("\"all\""), ". If ", list("\"trailing\""), #> ", only the\n", "last argument is ignored if it is empty.")), #> "\n", "\n", list(list(".preserve_empty"), list( #> "Whether to preserve the empty arguments that\n", #> "were not ignored. If ", list("TRUE"), ", empty arguments are stored with\n", #> list(list("missing_arg()")), " values. If ", #> list("FALSE"), " (the default) an error is\n", #> "thrown when an empty argument is detected.")), #> "\n", "\n", list(list(".homonyms"), list("How to treat arguments with the same name. The\n", #> "default, ", list("\"keep\""), ", preserves these arguments. Set ", #> list(".homonyms"), " to\n", list("\"first\""), #> " to only keep the first occurrences, to ", #> list("\"last\""), " to keep\n", "the last occurrences, and to ", #> list("\"error\""), " to raise an informative\n", #> "error and indicate what arguments have duplicated names.")), #> "\n", "\n", list(list(".check_assign"), list( #> "Whether to check for ", list("<-"), " calls passed in\n", #> "dots. When ", list("TRUE"), " and a ", list( #> "<-"), " call is detected, a warning is\n", #> "issued to advise users to use ", list("="), #> " if they meant to match a\n", "function parameter, or wrap the ", #> list("<-"), " call in braces otherwise.\n", #> "This ensures assignments are explicit.")), #> "\n"), "\n", list("\n", "This is a tool for advanced users. It captures dots, processes\n", #> "unquoting and splicing operators, and evaluates them. Unlike\n", #> list(list("dots_list()")), ", it does not flatten spliced objects, instead they\n", #> "are attributed a ", list("spliced"), " class (see ", #> list(list("splice()")), "). You can process\n", #> "spliced objects manually, perhaps with a custom predicate (see\n", #> list(list("flatten_if()")), ").\n"), "\n", list( #> "\n", "dots <- dots_values(!!! list(1, 2), 3)\n", #> "dots\n", "\n", "# Flatten the objects marked as spliced:\n", #> "flatten_if(dots, is_spliced)\n"), "\n"), duplicate.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/sexp.R", "\n", #> list("duplicate"), "\n", list("duplicate"), "\n", #> list("Duplicate an R object"), "\n", list("\n", "duplicate(x, shallow = FALSE)\n"), #> "\n", list("\n", list(list("x"), list("Any R object. However, uncopyable types like symbols and\n", #> "environments are returned as is (just like with ", #> list("<-"), ").")), "\n", "\n", list(list("shallow"), #> list("This is relevant for recursive data structures like\n", #> "lists, calls and pairlists. A shallow copy only duplicates the\n", #> "top-level data structure. The objects contained in the list are\n", #> "still the same.")), "\n"), "\n", list("\n", #> "In R semantics, objects are copied by value. This means that\n", #> "modifying the copy leaves the original object intact. Since\n", #> "copying data in memory is an expensive operation, copies in R are\n", #> "as lazy as possible. They only happen when the new object is\n", #> "actually modified. However, some operations (like ", #> list(list("node_poke_car()")), "\n", "or ", list( #> list("node_poke_cdr()")), ") do not support copy-on-write. In those cases,\n", #> "it is necessary to duplicate the object manually in order to\n", #> "preserve copy-by-value semantics.\n"), "\n", #> list("\n", "Some objects are not duplicable, like symbols and environments.\n", #> list("duplicate()"), " returns its input for these unique objects.\n"), #> "\n", list("\n", "pairlist\n"), "\n", list("internal"), #> "\n"), empty_env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("empty_env"), "\n", list("empty_env"), #> "\n", list("Get the empty environment"), "\n", list( #> "\n", "empty_env()\n"), "\n", list("\n", "The empty environment is the only one that does not have a parent.\n", #> "It is always used as the tail of an environment chain such as the\n", #> "search path (see ", list(list("search_envs()")), #> ").\n"), "\n", list("\n", "# Create environments with nothing in scope:\n", #> "child_env(empty_env())\n"), "\n"), entrace.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd-entrace.R", #> "\n", list("entrace"), "\n", list("entrace"), "\n", #> list("cnd_entrace"), "\n", list("Add backtrace from error handler"), #> "\n", list("\n", "entrace(cnd, ..., top = NULL, bottom = NULL)\n", #> "\n", "cnd_entrace(cnd, ..., top = NULL, bottom = NULL)\n"), #> "\n", list("\n", list(list("cnd"), list("When ", #> list("entrace()"), " is used as a calling handler, ", #> list("cnd"), " is\n", "the condition to handle.")), #> "\n", "\n", list(list("..."), list("Unused. These dots are for future extensions.")), #> "\n", "\n", list(list("top"), list("The first frame environment to be included in the\n", #> "backtrace. This becomes the top of the backtrace tree and\n", #> "represents the oldest call in the backtrace.\n", #> "\n", "This is needed in particular when you call ", #> list("trace_back()"), "\n", "indirectly or from a larger context, for example in tests or\n", #> "inside an RMarkdown document where you don't want all of the\n", #> "knitr evaluation mechanisms to appear in the backtrace.")), #> "\n", "\n", list(list("bottom"), list("The last frame environment to be included in the\n", #> "backtrace. This becomes the rightmost leaf of the backtrace tree\n", #> "and represents the youngest call in the backtrace.\n", #> "\n", "Set this when you would like to capture a backtrace without the\n", #> "capture context.\n", "\n", "Can also be an integer that will be passed to ", #> list(list("caller_env()")), ".")), "\n"), "\n", #> list("\n", list("entrace()"), " interrupts an error throw to add an ", #> list("rlang backtrace"), " to the error. The error throw is\n", #> "immediately resumed. ", list("cnd_entrace()"), #> " adds a backtrace to a\n", "condition object, without any other effect. Both functions should\n", #> "be called directly from an error handler.\n", #> "\n", "Set the ", list("error"), " global option to ", #> list("quote(rlang::entrace())"), " to\n", "transform base errors to rlang errors. These enriched errors\n", #> "include a backtrace. The RProfile is a good place to set the\n", #> "handler. See ", list("rlang_backtrace_on_error"), #> " for details.\n", "\n", list("entrace()"), " also works as a ", #> list("calling"), " handler, though it\n", "is often more practical to use the higher-level function\n", #> list(list("with_abort()")), ".\n"), "\n", list( #> "\n", "if (FALSE) { # Not run\n", "\n", "# Set the error handler in your RProfile like this:\n", #> "if (requireNamespace(\"rlang\", quietly = TRUE)) {\n", #> " options(error = rlang::entrace)\n", "}\n", #> "\n", "}\n"), "\n", list("\n", list(list("with_abort()")), #> " to promote conditions to rlang errors.\n", #> list(list("cnd_entrace()")), " to manually add a backtrace to a condition.\n"), #> "\n"), env.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env"), "\n", list("env"), "\n", list("child_env"), #> "\n", list("new_environment"), "\n", list("Create a new environment"), #> "\n", list("\n", "env(...)\n", "\n", "child_env(.parent, ...)\n", #> "\n", "new_environment(data = list(), parent = empty_env())\n"), #> "\n", list("\n", list(list("..., data"), list("Named values. You can supply one unnamed to specify\n", #> "a custom parent, otherwise it defaults to the current\n", #> "environment. These dots support ", list("tidy dots"), #> "\n", "features.")), "\n", "\n", list(list(".parent, parent"), #> list("A parent environment. Can be an object\n", #> "supported by ", list(list("as_environment()")), #> ".")), "\n"), "\n", list("\n", "These functions create new environments.\n", #> list("\n", list(), " ", list("env()"), " creates a child of the current environment by default\n", #> "and takes a variable number of named objects to populate it.\n", #> list(), " ", list("new_environment()"), " creates a child of the empty environment by\n", #> "default and takes a named list of objects to populate it.\n"), #> "\n"), "\n", list(list("Environments as objects"), #> list("\n", "\n", "\n", "Environments are containers of uniquely named objects. Their most\n", #> "common use is to provide a scope for the evaluation of R\n", #> "expressions. Not all languages have first class environments,\n", #> "i.e. can manipulate scope as regular objects. Reification of scope\n", #> "is one of the most powerful features of R as it allows you to change\n", #> "what objects a function or expression sees when it is evaluated.\n", #> "\n", "Environments also constitute a data structure in their own\n", #> "right. They are a collection of uniquely named objects, subsettable\n", #> "by name and modifiable by reference. This latter property (see\n", #> "section on reference semantics) is especially useful for creating\n", #> "mutable OO systems (cf the ", list(list("https://github.com/wch/R6"), #> list("R6 package")), "\n", "and the ", list( #> list("http://ggplot2.tidyverse.org/articles/extending-ggplot2.html"), #> list("ggproto system")), "\n", "for extending ggplot2).\n")), #> "\n", "\n", list(list("Inheritance"), list("\n", #> "\n", "\n", "All R environments (except the ", #> list("empty environment"), ") are\n", "defined with a parent environment. An environment and its\n", #> "grandparents thus form a linear hierarchy that is the basis for\n", #> list(list("https://en.wikipedia.org/wiki/Scope_(computer_science)"), #> list("lexical scoping")), " in\n", "R. When R evaluates an expression, it looks up symbols in a given\n", #> "environment. If it cannot find these symbols there, it keeps\n", #> "looking them up in parent environments. This way, objects defined\n", #> "in child environments have precedence over objects defined in\n", #> "parent environments.\n", "\n", "The ability of overriding specific definitions is used in the\n", #> "tidyeval framework to create powerful domain-specific grammars. A\n", #> "common use of masking is to put data frame columns in scope. See\n", #> "for example ", list(list("as_data_mask()")), #> ".\n")), "\n", "\n", list(list("Reference semantics"), #> list("\n", "\n", "\n", "Unlike regular objects such as vectors, environments are an\n", #> list("uncopyable"), " object type. This means that if you\n", #> "have multiple references to a given environment (by assigning the\n", #> "environment to another symbol with ", list( #> "<-"), " or passing the environment\n", "as argument to a function), modifying the bindings of one of those\n", #> "references changes all other references as well.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> list("\n", list(), " ", list("child_env()"), #> " is in the questioning stage. It is redundant now\n", #> "that ", list("env()"), " accepts parent environments.\n"), #> "\n")), "\n", "\n", list("\n", "# env() creates a new environment which has the current environment\n", #> "# as parent\n", "env <- env(a = 1, b = \"foo\")\n", #> "env$b\n", "identical(env_parent(env), current_env())\n", #> "\n", "# Supply one unnamed argument to override the default:\n", #> "env <- env(base_env(), a = 1, b = \"foo\")\n", #> "identical(env_parent(env), base_env())\n", "\n", #> "\n", "# child_env() lets you specify a parent:\n", #> "child <- child_env(env, c = \"bar\")\n", "identical(env_parent(child), env)\n", #> "\n", "# This child environment owns `c` but inherits `a` and `b` from `env`:\n", #> "env_has(child, c(\"a\", \"b\", \"c\", \"d\"))\n", #> "env_has(child, c(\"a\", \"b\", \"c\", \"d\"), inherit = TRUE)\n", #> "\n", "# `parent` is passed to as_environment() to provide handy\n", #> "# shortcuts. Pass a string to create a child of a package\n", #> "# environment:\n", "child_env(\"rlang\")\n", #> "env_parent(child_env(\"rlang\"))\n", "\n", "# Or `NULL` to create a child of the empty environment:\n", #> "child_env(NULL)\n", "env_parent(child_env(NULL))\n", #> "\n", "# The base package environment is often a good default choice for a\n", #> "# parent environment because it contains all standard base\n", #> "# functions. Also note that it will never inherit from other loaded\n", #> "# package environments since R keeps the base package at the tail\n", #> "# of the search path:\n", "base_child <- child_env(\"base\")\n", #> "env_has(base_child, c(\"lapply\", \"(\"), inherit = TRUE)\n", #> "\n", "# On the other hand, a child of the empty environment doesn't even\n", #> "# see a definition for `(`\n", "empty_child <- child_env(NULL)\n", #> "env_has(empty_child, c(\"lapply\", \"(\"), inherit = TRUE)\n", #> "\n", "# Note that all other package environments inherit from base_env()\n", #> "# as well:\n", "rlang_child <- child_env(\"rlang\")\n", #> "env_has(rlang_child, \"env\", inherit = TRUE) # rlang function\n", #> "env_has(rlang_child, \"lapply\", inherit = TRUE) # base function\n", #> "\n", "\n", "# Both env() and child_env() support tidy dots features:\n", #> "objs <- list(b = \"foo\", c = \"bar\")\n", "env <- env(a = 1, !!! objs)\n", #> "env$c\n", "\n", "# You can also unquote names with the definition operator `:=`\n", #> "var <- \"a\"\n", "env <- env(!!var := \"A\")\n", #> "env$a\n", "\n", "\n", "# Use new_environment() to create containers with the empty\n", #> "# environment as parent:\n", "env <- new_environment()\n", #> "env_parent(env)\n", "\n", "# Like other new_ constructors, it takes an object rather than dots:\n", #> "new_environment(list(a = \"foo\", b = \"bar\"))\n"), #> "\n", list("\n", list(list("env_has()")), ", ", list( #> list("env_bind()")), ".\n"), "\n"), env_bind.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_bind"), "\n", list("env_bind"), "\n", #> list("env_bind_lazy"), "\n", list("env_bind_active"), #> "\n", list("Bind symbols to objects in an environment"), #> "\n", list("\n", "env_bind(.env, ...)\n", "\n", "env_bind_lazy(.env, ..., .eval_env = caller_env())\n", #> "\n", "env_bind_active(.env, ...)\n"), "\n", #> list("\n", list(list(".env"), list("An environment.")), #> "\n", "\n", list(list("..."), list("Pairs of names and expressions, values or functions.\n", #> "Pass ", list(list("zap()")), " objects to remove bindings.\n", #> "\n", "These dots support ", list("tidy dots"), #> " features.")), "\n", "\n", list(list(".eval_env"), #> list("The environment where the expressions will be\n", #> "evaluated when the symbols are forced.")), #> "\n"), "\n", list("\n", "The input object ", #> list(".env"), ", with its associated environment\n", #> "modified in place, invisibly.\n"), "\n", list( #> "\n", "These functions create bindings in an environment. The bindings are\n", #> "supplied through ", list("..."), " as pairs of names and values or expressions.\n", #> list("env_bind()"), " is equivalent to evaluating a ", #> list("<-"), " expression within\n", "the given environment. This function should take care of the\n", #> "majority of use cases but the other variants can be useful for\n", #> "specific problems.\n", list("\n", list(), " ", #> list("env_bind()"), " takes named ", list("values"), #> " which are bound in ", list(".env"), ".\n", #> list("env_bind()"), " is equivalent to ", list( #> list("base::assign()")), ".\n", list(), " ", #> list("env_bind_active()"), " takes named ", #> list("functions"), " and creates active\n", #> "bindings in ", list(".env"), ". This is equivalent to\n", #> list(list("base::makeActiveBinding()")), ". An active binding executes a\n", #> "function each time it is evaluated. The arguments are passed to\n", #> list(list("as_function()")), " so you can supply formulas instead of functions.\n", #> "\n", "Remember that functions are scoped in their own environment.\n", #> "These functions can thus refer to symbols from this enclosure\n", #> "that are not actually in scope in the dynamic environment where\n", #> "the active bindings are invoked. This allows creative solutions\n", #> "to difficult problems (see the implementations of ", #> list("dplyr::do()"), "\n", "methods for an example).\n", #> list(), " ", list("env_bind_lazy()"), " takes named ", #> list("expressions"), ". This is equivalent\n", #> "to ", list(list("base::delayedAssign()")), #> ". The arguments are captured with\n", list( #> list("exprs()")), " (and thus support call-splicing and unquoting) and\n", #> "assigned to symbols in ", list(".env"), ". These expressions are not\n", #> "evaluated immediately but lazily. Once a symbol is evaluated, the\n", #> "corresponding expression is evaluated in turn and its value is\n", #> "bound to the symbol (the expressions are thus evaluated only\n", #> "once, if at all).\n"), "\n"), "\n", list(list( #> "Side effects"), list("\n", "\n", "\n", "Since environments have reference semantics (see relevant section\n", #> "in ", list(list("env()")), " documentation), modifying the bindings of an environment\n", #> "produces effects in all other references to that environment. In\n", #> "other words, ", list("env_bind()"), " and its variants have side effects.\n", #> "\n", "Like other side-effecty functions like ", #> list("par()"), " and ", list("options()"), ",\n", #> list("env_bind()"), " and variants return the old values invisibly.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> "\n", "Passing an environment wrapper like a formula or a function instead\n", #> "of an environment is soft-deprecated as of rlang 0.3.0. This\n", #> "internal genericity was causing confusion (see issue #427). You\n", #> "should now extract the environment separately before calling these\n", #> "functions.\n")), "\n", "\n", list("\n", "# env_bind() is a programmatic way of assigning values to symbols\n", #> "# with `<-`. We can add bindings in the current environment:\n", #> "env_bind(current_env(), foo = \"bar\")\n", "foo\n", #> "\n", "# Or modify those bindings:\n", "bar <- \"bar\"\n", #> "env_bind(current_env(), bar = \"BAR\")\n", "bar\n", #> "\n", "# You can remove bindings by supplying zap sentinels:\n", #> "env_bind(current_env(), foo = zap())\n", "try(foo)\n", #> "\n", "# Unquote-splice a named list of zaps\n", #> "zaps <- rep_named(c(\"foo\", \"bar\"), list(zap()))\n", #> "env_bind(current_env(), !!!zaps)\n", "try(bar)\n", #> "\n", "# It is most useful to change other environments:\n", #> "my_env <- env()\n", "env_bind(my_env, foo = \"foo\")\n", #> "my_env$foo\n", "\n", "# A useful feature is to splice lists of named values:\n", #> "vals <- list(a = 10, b = 20)\n", "env_bind(my_env, !!!vals, c = 30)\n", #> "my_env$b\n", "my_env$c\n", "\n", "# You can also unquote a variable referring to a symbol or a string\n", #> "# as binding name:\n", "var <- \"baz\"\n", "env_bind(my_env, !!var := \"BAZ\")\n", #> "my_env$baz\n", "\n", "\n", "# The old values of the bindings are returned invisibly:\n", #> "old <- env_bind(my_env, a = 1, b = 2, baz = \"baz\")\n", #> "old\n", "\n", "# You can restore the original environment state by supplying the\n", #> "# old values back:\n", "env_bind(my_env, !!!old)\n", #> "\n", "# env_bind_lazy() assigns expressions lazily:\n", #> "env <- env()\n", "env_bind_lazy(env, name = { cat(\"forced!\\n\"); \"value\" })\n", #> "\n", "# Referring to the binding will cause evaluation:\n", #> "env$name\n", "\n", "# But only once, subsequent references yield the final value:\n", #> "env$name\n", "\n", "# You can unquote expressions:\n", #> "expr <- quote(message(\"forced!\"))\n", "env_bind_lazy(env, name = !!expr)\n", #> "env$name\n", "\n", "\n", "# By default the expressions are evaluated in the current\n", #> "# environment. For instance we can create a local binding and refer\n", #> "# to it, even though the variable is bound in a different\n", #> "# environment:\n", "who <- \"mickey\"\n", "env_bind_lazy(env, name = paste(who, \"mouse\"))\n", #> "env$name\n", "\n", "# You can specify another evaluation environment with `.eval_env`:\n", #> "eval_env <- env(who = \"minnie\")\n", "env_bind_lazy(env, name = paste(who, \"mouse\"), .eval_env = eval_env)\n", #> "env$name\n", "\n", "# Or by unquoting a quosure:\n", #> "quo <- local({\n", " who <- \"fievel\"\n", #> " quo(paste(who, \"mouse\"))\n", "})\n", "env_bind_lazy(env, name = !!quo)\n", #> "env$name\n", "\n", "# You can create active bindings with env_bind_active(). Active\n", #> "# bindings execute a function each time they are evaluated:\n", #> "fn <- function() {\n", " cat(\"I have been called\\n\")\n", #> " rnorm(1)\n", "}\n", "\n", "env <- env()\n", #> "env_bind_active(env, symbol = fn)\n", "\n", #> "# `fn` is executed each time `symbol` is evaluated or retrieved:\n", #> "env$symbol\n", "env$symbol\n", "eval_bare(quote(symbol), env)\n", #> "eval_bare(quote(symbol), env)\n", "\n", "# All arguments are passed to as_function() so you can use the\n", #> "# formula shortcut:\n", "env_bind_active(env, foo = ~ runif(1))\n", #> "env$foo\n", "env$foo\n"), "\n"), env_bind_exprs.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("env_bind_exprs"), "\n", list("env_bind_exprs"), #> "\n", list("env_bind_fns"), "\n", list("Bind a promise or active binding"), #> "\n", list("\n", "env_bind_exprs(.env, ..., .eval_env = caller_env())\n", #> "\n", "env_bind_fns(.env, ...)\n"), "\n", list( #> "\n", list(list(".env"), list("An environment.")), #> "\n", "\n", list(list("..."), list("Pairs of names and expressions, values or functions.\n", #> "Pass ", list(list("zap()")), " objects to remove bindings.\n", #> "\n", "These dots support ", list("tidy dots"), #> " features.")), "\n", "\n", list(list(".eval_env"), #> list("The environment where the expressions will be\n", #> "evaluated when the symbols are forced.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "As of rlang 0.3.0, ", list("env_bind_exprs()"), #> " and ", list("env_bind_fns()"), " have\n", "been renamed to ", #> list(list("env_bind_lazy()")), " and ", list( #> list("env_bind_active()")), " for\n", "consistency.\n"), #> "\n", list("internal"), "\n"), env_binding_are_active.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_binding_are_active"), "\n", list( #> "env_binding_are_active"), "\n", list("env_binding_are_lazy"), #> "\n", list("What kind of environment binding?"), #> "\n", list("\n", "env_binding_are_active(env, nms = NULL)\n", #> "\n", "env_binding_are_lazy(env, nms = NULL)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("Names of bindings. Defaults to all bindings in ", #> list("env"), ".")), "\n"), "\n", list("\n", #> "A logical vector as long as ", list("nms"), #> " and named after it.\n"), "\n", list("\n", list( #> "rlang:::lifecycle(\"experimental\")"), "\n"), #> "\n", list("internal"), "\n"), env_binding_lock.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_binding_lock"), "\n", list("env_binding_lock"), #> "\n", list("env_binding_unlock"), "\n", list("env_binding_are_locked"), #> "\n", list("Lock or unlock environment bindings"), #> "\n", list("\n", "env_binding_lock(env, nms = NULL)\n", #> "\n", "env_binding_unlock(env, nms = NULL)\n", #> "\n", "env_binding_are_locked(env, nms = NULL)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("Names of bindings. Defaults to all bindings in ", #> list("env"), ".")), "\n"), "\n", list("\n", #> list("env_binding_are_unlocked()"), " returns a logical vector as\n", #> "long as ", list("nms"), " and named after it. ", #> list("env_binding_lock()"), " and\n", list("env_binding_unlock()"), #> " return the old value of\n", list("env_binding_are_unlocked()"), #> " invisibly.\n"), "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "Locked environment bindings trigger an error when an attempt is\n", #> "made to redefine the binding.\n"), "\n", list( #> "\n", "# Bindings are unlocked by default:\n", #> "env <- env(a = \"A\", b = \"B\")\n", "env_binding_are_locked(env)\n", #> "\n", "# But can optionally be locked:\n", "env_binding_lock(env, \"a\")\n", #> "env_binding_are_locked(env)\n", "\n", "# If run, the following would now return an error because `a` is locked:\n", #> "# env_bind(env, a = \"foo\")\n", "# with_env(env, a <- \"bar\")\n", #> "\n", "# Let's unlock it. Note that the return value indicate which\n", #> "# bindings were locked:\n", "were_locked <- env_binding_unlock(env)\n", #> "were_locked\n", "\n", "# Now that it is unlocked we can modify it again:\n", #> "env_bind(env, a = \"foo\")\n", "with_env(env, a <- \"bar\")\n", #> "env$a\n"), "\n", list("\n", list(list("env_lock()")), #> " for locking an environment.\n"), "\n", list( #> "internal"), "\n"), env_bury.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-binding.R", #> "\n", list("env_bury"), "\n", list("env_bury"), "\n", #> list("Mask bindings by defining symbols deeper in a scope"), #> "\n", list("\n", "env_bury(.env, ...)\n"), "\n", #> list("\n", list(list(".env"), list("An environment.")), #> "\n", "\n", list(list("..."), list("Pairs of names and expressions, values or functions.\n", #> "Pass ", list(list("zap()")), " objects to remove bindings.\n", #> "\n", "These dots support ", list("tidy dots"), #> " features.")), "\n"), "\n", list("\n", "A copy of ", #> list(".env"), " enclosing the new environment containing\n", #> "bindings to ", list("..."), " arguments.\n"), #> "\n", list("\n", list("env_bury()"), " is like ", #> list(list("env_bind()")), " but it creates the bindings in a\n", #> "new child environment. This makes sure the new bindings have\n", #> "precedence over old ones, without altering existing environments.\n", #> "Unlike ", list("env_bind()"), ", this function does not have side effects and\n", #> "returns a new environment (or object wrapping that environment).\n"), #> "\n", list("\n", "orig_env <- env(a = 10)\n", "fn <- set_env(function() a, orig_env)\n", #> "\n", "# fn() currently sees `a` as the value `10`:\n", #> "fn()\n", "\n", "# env_bury() will bury the current scope of fn() behind a new\n", #> "# environment:\n", "fn <- env_bury(fn, a = 1000)\n", #> "fn()\n", "\n", "# Even though the symbol `a` is still defined deeper in the scope:\n", #> "orig_env$a\n"), "\n", list("\n", list(list("env_bind()")), #> ", ", list(list("env_unbind()")), "\n"), "\n"), #> env_clone.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_clone"), "\n", list("env_clone"), "\n", #> list("Clone an environment"), "\n", list("\n", "env_clone(env, parent = env_parent(env))\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("parent"), list("The parent of the cloned environment.")), #> "\n"), "\n", list("\n", "This creates a new environment containing exactly the same objects,\n", #> "optionally with a new parent.\n"), "\n", list( #> "\n", "env <- env(!!! mtcars)\n", "clone <- env_clone(env)\n", #> "identical(env, clone)\n", "identical(env$cyl, clone$cyl)\n"), #> "\n"), env_depth.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_depth"), "\n", list("env_depth"), "\n", #> list("Depth of an environment chain"), "\n", list( #> "\n", "env_depth(env)\n"), "\n", list("\n", list( #> list("env"), list("An environment.")), "\n"), #> "\n", list("\n", "An integer.\n"), "\n", list("\n", #> "This function returns the number of environments between ", #> list("env"), " and\n", "the ", list("empty environment"), #> ", including ", list("env"), ". The depth of\n", #> list("env"), " is also the number of parents of ", #> list("env"), " (since the empty\n", "environment counts as a parent).\n"), #> "\n", list("\n", "env_depth(empty_env())\n", "env_depth(pkg_env(\"rlang\"))\n"), #> "\n", list("\n", "The section on inheritance in ", #> list(list("env()")), " documentation.\n"), "\n"), #> env_get.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-binding.R", #> "\n", list("env_get"), "\n", list("env_get"), "\n", #> list("env_get_list"), "\n", list("Get an object in an environment"), #> "\n", list("\n", "env_get(env = caller_env(), nm, default, inherit = FALSE)\n", #> "\n", "env_get_list(env = caller_env(), nms, default, inherit = FALSE)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nm, nms"), list("Names of bindings. ", #> list("nm"), " must be a single string.")), #> "\n", "\n", list(list("default"), list("A default value in case there is no binding for ", #> list("nm"), "\n", "in ", list("env"), ".")), #> "\n", "\n", list(list("inherit"), list("Whether to look for bindings in the parent\n", #> "environments.")), "\n"), "\n", list("\n", #> "An object if it exists. Otherwise, throws an error.\n"), #> "\n", list("\n", list("env_get()"), " extracts an object from an enviroment ", #> list("env"), ". By\n", "default, it does not look in the parent environments.\n", #> list("env_get_list()"), " extracts multiple objects from an environment into\n", #> "a named list.\n"), "\n", list("\n", "parent <- child_env(NULL, foo = \"foo\")\n", #> "env <- child_env(parent, bar = \"bar\")\n", #> "\n", "# This throws an error because `foo` is not directly defined in env:\n", #> "# env_get(env, \"foo\")\n", "\n", "# However `foo` can be fetched in the parent environment:\n", #> "env_get(env, \"foo\", inherit = TRUE)\n", "\n", #> "# You can also avoid an error by supplying a default value:\n", #> "env_get(env, \"foo\", default = \"FOO\")\n"), #> "\n"), env_has.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-binding.R", #> "\n", list("env_has"), "\n", list("env_has"), "\n", #> list("Does an environment have or see bindings?"), #> "\n", list("\n", "env_has(env = caller_env(), nms, inherit = FALSE)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("A character vector containing the names of the bindings\n", #> "to remove.")), "\n", "\n", list(list("inherit"), #> list("Whether to look for bindings in the parent\n", #> "environments.")), "\n"), "\n", list("\n", #> "A named logical vector as long as ", list("nms"), #> ".\n"), "\n", list("\n", list("env_has()"), " is a vectorised predicate that queries whether an\n", #> "environment owns bindings personally (with ", #> list("inherit"), " set to\n", list("FALSE"), #> ", the default), or sees them in its own environment or in\n", #> "any of its parents (with ", list("inherit = TRUE"), #> ").\n"), "\n", list("\n", "parent <- child_env(NULL, foo = \"foo\")\n", #> "env <- child_env(parent, bar = \"bar\")\n", #> "\n", "# env does not own `foo` but sees it in its parent environment:\n", #> "env_has(env, \"foo\")\n", "env_has(env, \"foo\", inherit = TRUE)\n"), #> "\n"), env_inherits.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_inherits"), "\n", list("env_inherits"), #> "\n", list("Does environment inherit from another environment?"), #> "\n", list("\n", "env_inherits(env, ancestor)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("ancestor"), list("Another environment from which ", #> list("x"), " might inherit.")), "\n"), "\n", #> list("\n", "This returns ", list("TRUE"), " if ", #> list("x"), " has ", list("ancestor"), " among its parents.\n"), #> "\n"), env_lock.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_lock"), "\n", list("env_lock"), "\n", list( #> "env_is_locked"), "\n", list("Lock an environment"), #> "\n", list("\n", "env_lock(env)\n", "\n", "env_is_locked(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "The old value of ", #> list("env_is_locked()"), " invisibly.\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "Locked environments cannot be modified. An important example is\n", #> "namespace environments which are locked by R when loaded in a\n", #> "session. Once an environment is locked it normally cannot be\n", #> "unlocked.\n", "\n", "Note that only the environment as a container is locked, not the\n", #> "individual bindings. You can't remove or add a binding but you can\n", #> "still modify the values of existing bindings. See\n", #> list(list("env_binding_lock()")), " for locking individual bindings.\n"), #> "\n", list("\n", "# New environments are unlocked by default:\n", #> "env <- env(a = 1)\n", "env_is_locked(env)\n", #> "\n", "# Use env_lock() to lock them:\n", "env_lock(env)\n", #> "env_is_locked(env)\n", "\n", "# Now that `env` is locked, it is no longer possible to remove or\n", #> "# add bindings. If run, the following would fail:\n", #> "# env_unbind(env, \"a\")\n", "# env_bind(env, b = 2)\n", #> "\n", "# Note that even though the environment as a container is locked,\n", #> "# the individual bindings are still unlocked and can be modified:\n", #> "env$a <- 10\n"), "\n", list("\n", list(list( #> "env_binding_lock()")), "\n"), "\n"), env_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-special.R", #> "\n", list("env_name"), "\n", list("env_name"), "\n", #> list("env_label"), "\n", list("Label of an environment"), #> "\n", list("\n", "env_name(env)\n", "\n", "env_label(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "Special environments like the global environment have their own\n", #> "names. ", list("env_name()"), " returns:\n", #> list("\n", list(), " \"global\" for the global environment.\n", #> list(), " \"empty\" for the empty environment.\n", #> list(), " \"base\" for the base package environment (the last environment on\n", #> "the search path).\n", list(), " \"namespace:pkg\" if ", #> list("env"), " is the namespace of the package \"pkg\".\n", #> list(), " The ", list("name"), " attribute of ", #> list("env"), " if it exists. This is how the\n", #> list("package environments"), " and the ", #> list("imports environments"), " store their names. The name of package\n", #> "environments is typically \"package:pkg\".\n", #> list(), " The empty string ", list("\"\""), #> " otherwise.\n"), "\n", "\n", list("env_label()"), #> " is exactly like ", list("env_name()"), " but returns the memory\n", #> "address of anonymous environments as fallback.\n"), #> "\n", list("\n", "# Some environments have specific names:\n", #> "env_name(global_env())\n", "env_name(ns_env(\"rlang\"))\n", #> "\n", "# Anonymous environments don't have names but are labelled by their\n", #> "# address in memory:\n", "env_name(env())\n", #> "env_label(env())\n"), "\n"), env_names.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_names"), "\n", list("env_names"), #> "\n", list("env_length"), "\n", list("Names and numbers of symbols bound in an environment"), #> "\n", list("\n", "env_names(env)\n", "\n", "env_length(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "A character vector of object names.\n"), #> "\n", list("\n", list("env_names()"), " returns object names from an enviroment ", #> list("env"), " as a\n", "character vector. All names are returned, even those starting with\n", #> "a dot. ", list("env_length()"), " returns the number of bindings.\n"), #> "\n", list(list("Names of symbols and objects"), #> list("\n", "\n", "\n", "Technically, objects are bound to symbols rather than strings,\n", #> "since the R interpreter evaluates symbols (see ", #> list(list("is_expression()")), " for a\n", #> "discussion of symbolic objects versus literal objects). However it\n", #> "is often more convenient to work with strings. In rlang\n", #> "terminology, the string corresponding to a symbol is called the\n", #> list("name"), " of the symbol (or by extension the name of an object bound\n", #> "to a symbol).\n")), "\n", "\n", list(list( #> "Encoding"), list("\n", "\n", "\n", "There are deep encoding issues when you convert a string to symbol\n", #> "and vice versa. Symbols are ", list("always"), #> " in the native encoding. If\n", "that encoding (let's say latin1) cannot support some characters,\n", #> "these characters are serialised to ASCII. That's why you sometimes\n", #> "see strings looking like ", list("<U+1234>"), #> ", especially if you're running\n", "Windows (as R doesn't support UTF-8 as native encoding on that\n", #> "platform).\n", "\n", "To alleviate some of the encoding pain, ", #> list("env_names()"), " always\n", "returns a UTF-8 character vector (which is fine even on Windows)\n", #> "with ASCII unicode points translated back to UTF-8.\n")), #> "\n", "\n", list("\n", "env <- env(a = 1, b = 2)\n", #> "env_names(env)\n"), "\n"), env_parent.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env.R", "\n", list( #> "env_parent"), "\n", list("env_parent"), "\n", #> list("env_tail"), "\n", list("env_parents"), "\n", #> list("Get parent environments"), "\n", list("\n", #> "env_parent(env = caller_env(), n = 1)\n", "\n", #> "env_tail(env = caller_env(), last = global_env(), sentinel = NULL)\n", #> "\n", "env_parents(env = caller_env(), last = global_env())\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("n"), list("The number of generations to go up.")), #> "\n", "\n", list(list("last"), list("The environment at which to stop. Defaults to the\n", #> "global environment. The empty environment is always a stopping\n", #> "condition so it is safe to leave the default even when taking the\n", #> "tail or the parents of an environment on the search path.\n", #> "\n", list("env_tail()"), " returns the environment which has ", #> list("last"), " as parent\n", "and ", list( #> "env_parents()"), " returns the list of environments up to ", #> list("last"), ".")), "\n", "\n", list(list( #> "sentinel"), list("This argument is defunct, please use ", #> list("last"), " instead.")), "\n"), "\n", list( #> "\n", "An environment for ", list("env_parent()"), #> " and ", list("env_tail()"), ", a list\n", "of environments for ", #> list("env_parents()"), ".\n"), "\n", list("\n", #> list("\n", list(), " ", list("env_parent()"), #> " returns the parent environment of ", list( #> "env"), " if called\n", "with ", list("n = 1"), #> ", the grandparent with ", list("n = 2"), ", etc.\n", #> list(), " ", list("env_tail()"), " searches through the parents and returns the one\n", #> "which has ", list(list("empty_env()")), " as parent.\n", #> list(), " ", list("env_parents()"), " returns the list of all parents, including the\n", #> "empty environment. This list is named using ", #> list(list("env_name()")), ".\n"), "\n", "\n", #> "See the section on ", list("inheritance"), " in ", #> list(list("env()")), "'s documentation.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "The ", list("sentinel"), " argument of ", list( #> "env_tail()"), " has been deprecated in\n", #> "rlang 0.2.0 and renamed to ", list("last"), #> ". It is defunct as of rlang 0.4.0.\n")), "\n", #> "\n", list("\n", "# Get the parent environment with env_parent():\n", #> "env_parent(global_env())\n", "\n", "# Or the tail environment with env_tail():\n", #> "env_tail(global_env())\n", "\n", "# By default, env_parent() returns the parent environment of the\n", #> "# current evaluation frame. If called at top-level (the global\n", #> "# frame), the following two expressions are equivalent:\n", #> "env_parent()\n", "env_parent(base_env())\n", #> "\n", "# This default is more handy when called within a function. In this\n", #> "# case, the enclosure environment of the function is returned\n", #> "# (since it is the parent of the evaluation frame):\n", #> "enclos_env <- env()\n", "fn <- set_env(function() env_parent(), enclos_env)\n", #> "identical(enclos_env, fn())\n"), "\n"), env_poke.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_poke"), "\n", list("env_poke"), "\n", #> list("Poke an object in an environment"), "\n", list( #> "\n", "env_poke(env = caller_env(), nm, value, inherit = FALSE,\n", #> " create = !inherit)\n"), "\n", list("\n", list( #> list("env"), list("An environment.")), "\n", #> "\n", list(list("nm"), list("Names of bindings. ", #> list("nm"), " must be a single string.")), #> "\n", "\n", list(list("value"), list("The value for a new binding.")), #> "\n", "\n", list(list("inherit"), list("Whether to look for bindings in the parent\n", #> "environments.")), "\n", "\n", list(list("create"), #> list("Whether to create a binding if it does not already\n", #> "exist in the environment.")), "\n"), "\n", #> list("\n", "The old value of ", list("nm"), " or a ", #> list("zap sentinel"), " if the\n", "binding did not exist yet.\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", list("env_poke()"), " will assign or reassign a binding in ", #> list("env"), " if ", list("create"), "\n", "is ", #> list("TRUE"), ". If ", list("create"), " is ", #> list("FALSE"), " and a binding does not already\n", #> "exists, an error is issued.\n"), "\n", list( #> "\n", "If ", list("inherit"), " is ", list("TRUE"), #> ", the parents environments are checked for\n", #> "an existing binding to reassign. If not found and ", #> list("create"), " is\n", list("TRUE"), ", a new binding is created in ", #> list("env"), ". The default value for\n", list( #> "create"), " is a function of ", list("inherit"), #> ": ", list("FALSE"), " when inheriting,\n", list( #> "TRUE"), " otherwise.\n", "\n", "This default makes sense because the inheriting case is mostly\n", #> "for overriding an existing binding. If not found, something\n", #> "probably went wrong and it is safer to issue an error. Note that\n", #> "this is different to the base R operator ", #> list("<<-"), " which will create\n", "a binding in the global environment instead of the current\n", #> "environment when no existing binding is found in the parents.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> list("env_poke()"), " is experimental. We are still experimenting with\n", #> "reducing the number of redundant functions by using quasiquotation.\n", #> "It is possible ", list("env_poke()"), " will be deprecated in favour of\n", #> list("env_bind()"), " and name-unquoting with ", #> list(":="), ".\n")), "\n", "\n", list("internal"), #> "\n"), env_print.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_print"), "\n", list("env_print"), "\n", #> list("Pretty-print an environment"), "\n", list("\n", #> "env_print(env = caller_env())\n"), "\n", list( #> "\n", list(list("env"), list("An environment, or object that can be converted to an\n", #> "environment by ", list(list("get_env()")), #> ".")), "\n"), "\n", list("\n", "This prints:\n", #> list("\n", list(), " The ", list("label"), " and the parent label.\n", #> list(), " Whether the environment is ", list( #> "locked"), ".\n", list(), " The bindings in the environment (up to 20 bindings). They are\n", #> "printed succintly using ", list("pillar::type_sum()"), #> " (if available,\n", "otherwise uses an internal version of that generic). In addition\n", #> list("fancy bindings"), " (actives and promises) are\n", #> "indicated as such.\n", list(), " Locked bindings get a ", #> list("[L]"), " tag\n"), "\n"), "\n"), env_unbind.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-binding.R", #> "\n", list("env_unbind"), "\n", list("env_unbind"), #> "\n", list("Remove bindings from an environment"), #> "\n", list("\n", "env_unbind(env = caller_env(), nms, inherit = FALSE)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("nms"), list("A character vector containing the names of the bindings\n", #> "to remove.")), "\n", "\n", list(list("inherit"), #> list("Whether to look for bindings in the parent\n", #> "environments.")), "\n"), "\n", list("\n", #> "The input object ", list("env"), " with its associated environment\n", #> "modified in place, invisibly.\n"), "\n", list( #> "\n", list("env_unbind()"), " is the complement of ", #> list(list("env_bind()")), ". Like ", list("env_has()"), #> ",\n", "it ignores the parent environments of ", #> list("env"), " by default. Set\n", list("inherit"), #> " to ", list("TRUE"), " to track down bindings in parent environments.\n"), #> "\n", list("\n", "data <- set_names(as.list(letters), letters)\n", #> "env_bind(environment(), !!! data)\n", "env_has(environment(), letters)\n", #> "\n", "# env_unbind() removes bindings:\n", "env_unbind(environment(), letters)\n", #> "env_has(environment(), letters)\n", "\n", "# With inherit = TRUE, it removes bindings in parent environments\n", #> "# as well:\n", "parent <- child_env(NULL, foo = \"a\")\n", #> "env <- child_env(parent, foo = \"b\")\n", "env_unbind(env, \"foo\", inherit = TRUE)\n", #> "env_has(env, \"foo\", inherit = TRUE)\n"), "\n"), #> env_unlock.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env.R", "\n", #> list("env_unlock"), "\n", list("env_unlock"), "\n", #> list("Unlock an environment"), "\n", list("\n", "env_unlock(env)\n"), #> "\n", list("\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "Whether the environment has been unlocked.\n"), #> "\n", list("\n", "This function should only be used in development tools or\n", #> "interactively.\n"), "\n", list("internal"), #> "\n"), eval_bare.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval.R", #> "\n", list("eval_bare"), "\n", list("eval_bare"), #> "\n", list("Evaluate an expression in an environment"), #> "\n", list("\n", "eval_bare(expr, env = parent.frame())\n"), #> "\n", list("\n", list(list("expr"), list("An expression to evaluate.")), #> "\n", "\n", list(list("env"), list("The environment in which to evaluate the expression.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", list("eval_bare()"), " is a lower-level version of function ", #> list(list("base::eval()")), ".\n", "Technically, it is a simple wrapper around the C function\n", #> list("Rf_eval()"), ". You generally don't need to use ", #> list("eval_bare()"), " instead\n", "of ", list( #> "eval()"), ". Its main advantage is that it handles stack-sensitive\n", #> "(calls such as ", list("return()"), ", ", list( #> "on.exit()"), " or ", list("parent.frame()"), #> ") more\n", "consistently when you pass an enviroment of a frame on the call\n", #> "stack.\n"), "\n", list("\n", "These semantics are possible because ", #> list("eval_bare()"), " creates only one\n", "frame on the call stack whereas ", #> list("eval()"), " creates two frames, the\n", #> "second of which has the user-supplied environment as frame\n", #> "environment. When you supply an existing frame environment to\n", #> list("base::eval()"), " there will be two frames on the stack with the same\n", #> "frame environment. Stack-sensitive functions only detect the\n", #> "topmost of these frames. We call these evaluation semantics\n", #> "\"stack inconsistent\".\n", "\n", "Evaluating expressions in the actual frame environment has useful\n", #> "practical implications for ", list("eval_bare()"), #> ":\n", list("\n", list(), " ", list("return()"), #> " calls are evaluated in frame environments that might\n", #> "be burried deep in the call stack. This causes a long return that\n", #> "unwinds multiple frames (triggering the ", #> list("on.exit()"), " event for\n", "each frame). By contrast ", #> list("eval()"), " only returns from the ", #> list("eval()"), "\n", "call, one level up.\n", #> list(), " ", list("on.exit()"), ", ", list( #> "parent.frame()"), ", ", list("sys.call()"), #> ", and generally all\n", "the stack inspection functions ", #> list("sys.xxx()"), " are evaluated in the\n", #> "correct frame environment. This is similar to how this type of\n", #> "calls can be evaluated deep in the call stack because of lazy\n", #> "evaluation, when you force an argument that has been passed\n", #> "around several times.\n"), "\n", "\n", "The flip side of the semantics of ", #> list("eval_bare()"), " is that it can't\n", "evaluate ", #> list("break"), " or ", list("next"), " expressions even if called within a\n", #> "loop.\n"), "\n", list("\n", "# eval_bare() works just like base::eval() but you have to create\n", #> "# the evaluation environment yourself:\n", "eval_bare(quote(foo), env(foo = \"bar\"))\n", #> "\n", "# eval() has different evaluation semantics than eval_bare(). It\n", #> "# can return from the supplied environment even if its an\n", #> "# environment that is not on the call stack (i.e. because you've\n", #> "# created it yourself). The following would trigger an error with\n", #> "# eval_bare():\n", "ret <- quote(return(\"foo\"))\n", #> "eval(ret, env())\n", "# eval_bare(ret, env()) # \"no function to return from\" error\n", #> "\n", "# Another feature of eval() is that you can control surround loops:\n", #> "bail <- quote(break)\n", "while (TRUE) {\n", #> " eval(bail)\n", " # eval_bare(bail) # \"no loop for break/next\" error\n", #> "}\n", "\n", "# To explore the consequences of stack inconsistent semantics, let's\n", #> "# create a function that evaluates `parent.frame()` deep in the call\n", #> "# stack, in an environment corresponding to a frame in the middle of\n", #> "# the stack. For consistency with R's lazy evaluation semantics, we'd\n", #> "# expect to get the caller of that frame as result:\n", #> "fn <- function(eval_fn) {\n", " list(\n", " returned_env = middle(eval_fn),\n", #> " actual_env = current_env()\n", " )\n", #> "}\n", "middle <- function(eval_fn) {\n", " deep(eval_fn, current_env())\n", #> "}\n", "deep <- function(eval_fn, eval_env) {\n", #> " expr <- quote(parent.frame())\n", " eval_fn(expr, eval_env)\n", #> "}\n", "\n", "# With eval_bare(), we do get the expected environment:\n", #> "fn(rlang::eval_bare)\n", "\n", "# But that's not the case with base::eval():\n", #> "fn(base::eval)\n"), "\n", list("\n", list(list( #> "eval_tidy()")), " for evaluation with data mask and quosure\n", #> "support.\n"), "\n"), eval_tidy.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval-tidy.R", #> "\n", list("eval_tidy"), "\n", list("eval_tidy"), #> "\n", list("Evaluate an expression with quosures and pronoun support"), #> "\n", list("\n", "eval_tidy(expr, data = NULL, env = caller_env())\n"), #> "\n", list("\n", list(list("expr"), list("An expression or quosure to evaluate.")), #> "\n", "\n", list(list("data"), list("A data frame, or named list or vector. Alternatively, a\n", #> "data mask created with ", list(list("as_data_mask()")), #> " or\n", list(list("new_data_mask()")), ". Objects in ", #> list("data"), " have priority over those in\n", #> list("env"), ". See the section about data masking.")), #> "\n", "\n", list(list("env"), list("The environment in which to evaluate ", #> list("expr"), ". This\n", "environment is not applicable for quosures because they have\n", #> "their own environments.")), "\n"), "\n", list( #> "\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", list("eval_tidy()"), " is a variant of ", #> list(list("base::eval()")), " that powers the tidy\n", #> "evaluation framework. Like ", list("eval()"), #> " it accepts user data as\n", "argument. Whereas ", #> list("eval()"), " simply transforms the data to an\n", #> "environment, ", list("eval_tidy()"), " transforms it to a ", #> list("data mask"), " with\n", list(list("as_data_mask()")), #> ". Evaluating in a data mask enables the following\n", #> "features:\n", list("\n", list(), " ", list("Quosures"), #> ". Quosures are expressions bundled with an\n", #> "environment. If ", list("data"), " is supplied, objects in the data mask\n", #> "always have precedence over the quosure environment, i.e. the\n", #> "data masks the environment.\n", list(), " ", #> list("Pronouns"), ". If ", list("data"), " is supplied, the ", #> list(".env"), " and ", list(".data"), "\n", #> "pronouns are installed in the data mask. ", #> list(".env"), " is a reference to\n", "the calling environment and ", #> list(".data"), " refers to the ", list("data"), #> " argument.\n", "These pronouns lets you be explicit about where to find\n", #> "values and throw errors if you try to access non-existent values.\n"), #> "\n"), "\n", list(list("Data masking"), list( #> "\n", "\n", "\n", "Data masking refers to how columns or objects inside ", #> list("data"), " have\n", "priority over objects defined in ", #> list("env"), " (or in the quosure\n", "environment, if applicable). If there is a column ", #> list("var"), " in ", list("data"), "\n", "and an object ", #> list("var"), " in ", list("env"), ", and ", list( #> "expr"), " refers to ", list("var"), ", the\n", #> "column has priority:", list("var <- \"this one?\"\n", #> "data <- data.frame(var = rep(\"Or that one?\", 3))\n", #> "\n", "within <- function(data, expr) {\n", #> " eval_tidy(enquo(expr), data)\n", "}\n", #> "\n", "within(data, toupper(var))\n", "#> [1] \"OR THAT ONE?\" \"OR THAT ONE?\" \"OR THAT ONE?\"\n"), #> "\n", "\n", "Because the columns or objects in ", #> list("data"), " are always found first,\n", "before objects from ", #> list("env"), ", we say that the data \"masks\" the\n", #> "environment.\n")), "\n", "\n", list(list("When should eval_tidy() be used instead of eval()?"), #> list("\n", "\n", "\n", list("base::eval()"), #> " is sufficient for simple evaluation. Use\n", #> list("eval_tidy()"), " when you'd like to support expressions referring to\n", #> "the ", list(".data"), " pronoun, or when you need to support quosures.\n", #> "\n", "If you're evaluating an expression captured with quasiquotation\n", #> "support, it is recommended to use ", list( #> "eval_tidy()"), " because users will\n", #> "likely unquote quosures.\n", "\n", "Note that unwrapping a quosure with ", #> list(list("quo_get_expr()")), " does not\n", #> "guarantee that there is no quosures inside the expression. Quosures\n", #> "might be unquoted anywhere. For instance, the following does not\n", #> "work reliably in the presence of nested quosures:", #> list("my_quoting_fn <- function(x) {\n", " x <- enquo(x)\n", #> " expr <- quo_get_expr(x)\n", " env <- quo_get_env(x)\n", #> " eval(expr, env)\n", "}\n", "\n", "# Works:\n", #> "my_quoting_fn(toupper(letters))\n", "\n", #> "# Fails because of a nested quosure:\n", #> "my_quoting_fn(toupper(!!quo(letters)))\n"), #> "\n")), "\n", "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", list("rlang 0.3.0"), "\n", #> "\n", "Passing an environment to ", list("data"), #> " is deprecated. Please construct an\n", "rlang data mask with ", #> list(list("new_data_mask()")), ".\n")), "\n", #> "\n", list("\n", "\n", "# With simple quoted expressions eval_tidy() works the same way as\n", #> "# eval():\n", "apple <- \"apple\"\n", "kiwi <- \"kiwi\"\n", #> "expr <- quote(paste(apple, kiwi))\n", "expr\n", #> "\n", "eval(expr)\n", "eval_tidy(expr)\n", "\n", #> "# Both accept a data mask as argument:\n", "data <- list(apple = \"CARROT\", kiwi = \"TOMATO\")\n", #> "eval(expr, data)\n", "eval_tidy(expr, data)\n", #> "\n", "\n", "# In addition eval_tidy() has support for quosures:\n", #> "with_data <- function(data, expr) {\n", " quo <- enquo(expr)\n", #> " eval_tidy(quo, data)\n", "}\n", "with_data(NULL, apple)\n", #> "with_data(data, apple)\n", "with_data(data, list(apple, kiwi))\n", #> "\n", "# Secondly eval_tidy() installs handy pronouns that allow users to\n", #> "# be explicit about where to find symbols:\n", #> "with_data(data, .data$apple)\n", "with_data(data, .env$apple)\n", #> "\n", "\n", "# Note that instead of using `.env` it is often equivalent and may\n", #> "# be preferred to unquote a value. There are two differences. First\n", #> "# unquoting happens earlier, when the quosure is created. Secondly,\n", #> "# subsetting `.env` with the `$` operator may be brittle because\n", #> "# `$` does not look through the parents of the environment.\n", #> "#\n", "# For instance using `.env$name` in a magrittr pipeline is an\n", #> "# instance where this poses problem, because the magrittr pipe\n", #> "# currently (as of v1.5.0) evaluates its operands in a *child* of\n", #> "# the current environment (this child environment is where it\n", #> "# defines the pronoun `.`).\n", list("\n", " data %>% with_data(!!kiwi) # \"kiwi\"\n", #> " data %>% with_data(.env$kiwi) # NULL\n"), #> "\n"), "\n", list("\n", list("quasiquotation"), #> " for the second leg of the tidy evaluation\n", #> "framework.\n"), "\n"), exec.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval.R", #> "\n", list("exec"), "\n", list("exec"), "\n", list( #> "Execute a function"), "\n", list("\n", "exec(.fn, ..., .env = caller_env())\n"), #> "\n", list("\n", list(list(".fn"), list("A function, or function name as a string.")), #> "\n", "\n", list(list("..."), list("Arguments to function.\n", #> "\n", "These dots support ", list("tidy-dots"), #> " features.")), "\n", "\n", list(list(".env"), #> list("Environment in which to evaluate the call. This will be\n", #> "most useful if ", list("f"), " is a string, or the function has side-effects.")), #> "\n"), "\n", list("\n", "This function constructs and evaluates a call to ", #> list(".fn"), ".\n", "It has two primary uses:\n", #> list("\n", list(), " To call a function with arguments stored in a list (if the function\n", #> "doesn't support ", list("tidy-dots"), ")\n", #> list(), " To call every function stored in a list (in conjunction with ", #> list("map()"), "/\n", list(list("lapply()")), #> ")\n"), "\n"), "\n", list("\n", "args <- list(x = c(1:10, 100, NA), na.rm = TRUE)\n", #> "exec(\"mean\", !!!args)\n", "exec(\"mean\", !!!args, trim = 0.2)\n", #> "\n", "fs <- list(a = function() \"a\", b = function() \"b\")\n", #> "lapply(fs, exec)\n", "\n", "# Compare to do.call it will not automatically inline expressions\n", #> "# into the evaluated call.\n", "x <- 10\n", #> "args <- exprs(x1 = x + 1, x2 = x * 2)\n", "exec(list, !!!args)\n", #> "do.call(list, args)\n", "\n", "# exec() is not designed to generate pretty function calls. This is\n", #> "# most easily seen if you call a function that captures the call:\n", #> "f <- disp ~ cyl\n", "exec(\"lm\", f, data = mtcars)\n", #> "\n", "# If you need finer control over the generated call, you'll need to\n", #> "# construct it yourself. This may require creating a new environment\n", #> "# with carefully constructed bindings\n", "data_env <- env(data = mtcars)\n", #> "eval(expr(lm(!!f, data)), data_env)\n"), "\n"), #> exiting.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("exiting"), "\n", list("exiting"), "\n", #> list("Exiting handler"), "\n", list("\n", "exiting(handler)\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", "\n", list("exiting()"), " is no longer necessary as handlers are exiting by default.\n"), #> "\n", list("internal"), "\n"), expr_interp.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quasiquotation.R", #> "\n", list("expr_interp"), "\n", list("expr_interp"), #> "\n", list("Process unquote operators in a captured expression"), #> "\n", list("\n", "expr_interp(x, env = NULL)\n"), #> "\n", list("\n", list(list("x"), list("A function, raw expression, or formula to interpolate.")), #> "\n", "\n", list(list("env"), list("The environment in which unquoted expressions should be\n", #> "evaluated. By default, the formula or closure environment if a\n", #> "formula or a function, or the current environment otherwise.")), #> "\n"), "\n", list("\n", "While all capturing functions in the tidy evaluation framework\n", #> "perform unquote on capture (most notably ", #> list(list("quo()")), "),\n", list("expr_interp()"), #> " manually processes unquoting operators in\n", #> "expressions that are already captured. ", list( #> "expr_interp()"), " should be\n", "called in all user-facing functions expecting a formula as argument\n", #> "to provide the same quasiquotation functionality as NSE functions.\n"), #> "\n", list("\n", "# All tidy NSE functions like quo() unquote on capture:\n", #> "quo(list(!!(1 + 2)))\n", "\n", "# expr_interp() is meant to provide the same functionality when you\n", #> "# have a formula or expression that might contain unquoting\n", #> "# operators:\n", "f <- ~list(!!(1 + 2))\n", #> "expr_interp(f)\n", "\n", "# Note that only the outer formula is unquoted (which is a reason\n", #> "# to use expr_interp() as early as possible in all user-facing\n", #> "# functions):\n", "f <- ~list(~!!(1 + 2), !!(1 + 2))\n", #> "expr_interp(f)\n", "\n", "\n", "# Another purpose for expr_interp() is to interpolate a closure's\n", #> "# body. This is useful to inline a function within another. The\n", #> "# important limitation is that all formal arguments of the inlined\n", #> "# function should be defined in the receiving function:\n", #> "other_fn <- function(x) toupper(x)\n", "\n", #> "fn <- expr_interp(function(x) {\n", " x <- paste0(x, \"_suffix\")\n", #> " !!! body(other_fn)\n", "})\n", "fn\n", "fn(\"foo\")\n"), #> "\n"), expr_label.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/expr.R", #> "\n", list("expr_label"), "\n", list("expr_label"), #> "\n", list("expr_name"), "\n", list("expr_text"), #> "\n", list("Turn an expression to a label"), "\n", #> list("\n", "expr_label(expr)\n", "\n", "expr_name(expr)\n", #> "\n", "expr_text(expr, width = 60L, nlines = Inf)\n"), #> "\n", list("\n", list(list("expr"), list("An expression to labellise.")), #> "\n", "\n", list(list("width"), list("Width of each line.")), #> "\n", "\n", list(list("nlines"), list("Maximum number of lines to extract.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("expr_text()"), " turns the expression into a single string, which\n", #> "might be multi-line. ", list("expr_name()"), #> " is suitable for formatting\n", "names. It works best with symbols and scalar types, but also\n", #> "accepts calls. ", list("expr_label()"), " formats the expression nicely for use\n", #> "in messages.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "These functions are in the questioning stage because they are\n", #> "redundant with the ", list("quo_"), " variants and do not handle quosures.\n")), #> "\n", "\n", list("\n", "# To labellise a function argument, first capture it with\n", #> "# substitute():\n", "fn <- function(x) expr_label(substitute(x))\n", #> "fn(x:y)\n", "\n", "# Strings are encoded\n", #> "expr_label(\"a\\nb\")\n", "\n", "# Names and expressions are quoted with ``\n", #> "expr_label(quote(x))\n", "expr_label(quote(a + b + c))\n", #> "\n", "# Long expressions are collapsed\n", "expr_label(quote(foo({\n", #> " 1 + 2\n", " print(x)\n", "})))\n"), "\n"), #> expr_print.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/expr.R", #> "\n", list("expr_print"), "\n", list("expr_print"), #> "\n", list("expr_deparse"), "\n", list("Print an expression"), #> "\n", list("\n", "expr_print(x, width = peek_option(\"width\"))\n", #> "\n", "expr_deparse(x, width = peek_option(\"width\"))\n"), #> "\n", list("\n", list(list("x"), list("An object or expression to print.")), #> "\n", "\n", list(list("width"), list("The width of the deparsed or printed expression.\n", #> "Defaults to the global option ", list("width"), #> ".")), "\n"), "\n", list("\n", list("expr_print()"), #> ", powered by ", list("expr_deparse()"), ", is an alternative\n", #> "printer for R expressions with a few improvements over the base R\n", #> "printer.\n", list("\n", list(), " It colourises ", #> list("quosures"), " according to their environment.\n", #> "Quosures from the global environment are printed normally while\n", #> "quosures from local environments are printed in unique colour (or\n", #> "in italic when all colours are taken).\n", #> list(), " It wraps inlined objects in angular brackets. For instance, an\n", #> "integer vector unquoted in a function call (e.g.\n", #> list("expr(foo(!!(1:3)))"), ") is printed like this: ", #> list("foo(<int: 1L, 2L, 3L>)"), " while by default R prints the code to create that vector:\n", #> list("foo(1:3)"), " which is ambiguous.\n", #> list(), " It respects the width boundary (from the global option ", #> list("width"), ")\n", "in more cases.\n"), #> "\n"), "\n", list("\n", "# It supports any object. Non-symbolic objects are always printed\n", #> "# within angular brackets:\n", "expr_print(1:3)\n", #> "expr_print(function() NULL)\n", "\n", "# Contrast this to how the code to create these objects is printed:\n", #> "expr_print(quote(1:3))\n", "expr_print(quote(function() NULL))\n", #> "\n", "# The main cause of non-symbolic objects in expressions is\n", #> "# quasiquotation:\n", "expr_print(expr(foo(!!(1:3))))\n", #> "\n", "\n", "# Quosures from the global environment are printed normally:\n", #> "expr_print(quo(foo))\n", "expr_print(quo(foo(!!quo(bar))))\n", #> "\n", "# Quosures from local environments are colourised according to\n", #> "# their environments (if you have crayon installed):\n", #> "local_quo <- local(quo(foo))\n", "expr_print(local_quo)\n", #> "\n", "wrapper_quo <- local(quo(bar(!!local_quo, baz)))\n", #> "expr_print(wrapper_quo)\n"), "\n"), exprs_auto_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quotation.R", "\n", #> list("exprs_auto_name"), "\n", list("exprs_auto_name"), #> "\n", list("quos_auto_name"), "\n", list("Ensure that all elements of a list of expressions are named"), #> "\n", list("\n", "exprs_auto_name(exprs, width = NULL, printer = NULL)\n", #> "\n", "quos_auto_name(quos, width = NULL)\n"), #> "\n", list("\n", list(list("exprs"), list("A list of expressions.")), #> "\n", "\n", list(list("width"), list("Deprecated. Maximum width of names.")), #> "\n", "\n", list(list("printer"), list("Deprecated. A function that takes an expression\n", #> "and converts it to a string. This function must take an\n", #> "expression as the first argument and ", list( #> "width"), " as the second\n", "argument.")), #> "\n", "\n", list(list("quos"), list("A list of quosures.")), #> "\n"), "\n", list("\n", "This gives default names to unnamed elements of a list of\n", #> "expressions (or expression wrappers such as formulas or\n", #> "quosures). ", list("exprs_auto_name()"), " deparses the expressions with\n", #> list(list("expr_name()")), " by default. ", list( #> "quos_auto_name()"), " deparses with\n", list( #> list("quo_name()")), ".\n"), "\n"), f_rhs.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/formula.R", "\n", #> list("f_rhs"), "\n", list("f_rhs"), "\n", list("f_rhs<-"), #> "\n", list("f_lhs"), "\n", list("f_lhs<-"), "\n", #> list("f_env"), "\n", list("f_env<-"), "\n", list( #> "Get or set formula components"), "\n", list( #> "\n", "f_rhs(f)\n", "\n", "f_rhs(x) <- value\n", #> "\n", "f_lhs(f)\n", "\n", "f_lhs(x) <- value\n", #> "\n", "f_env(f)\n", "\n", "f_env(x) <- value\n"), #> "\n", list("\n", list(list("f, x"), list("A formula")), #> "\n", "\n", list(list("value"), list("The value to replace with.")), #> "\n"), "\n", list("\n", list("f_rhs"), " and ", #> list("f_lhs"), " return language objects (i.e. atomic\n", #> "vectors of length 1, a name, or a call). ", #> list("f_env"), " returns an\n", "environment.\n"), #> "\n", list("\n", list("f_rhs"), " extracts the righthand side, ", #> list("f_lhs"), " extracts the lefthand\n", "side, and ", #> list("f_env"), " extracts the environment. All functions throw an\n", #> "error if ", list("f"), " is not a formula.\n"), #> "\n", list("\n", "f_rhs(~ 1 + 2 + 3)\n", "f_rhs(~ x)\n", #> "f_rhs(~ \"A\")\n", "f_rhs(1 ~ 2)\n", "\n", "f_lhs(~ y)\n", #> "f_lhs(x ~ y)\n", "\n", "f_env(~ x)\n"), "\n"), #> f_text.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/formula.R", #> "\n", list("f_text"), "\n", list("f_text"), "\n", #> list("f_name"), "\n", list("f_label"), "\n", list( #> "Turn RHS of formula into a string or label"), #> "\n", list("\n", "f_text(x, width = 60L, nlines = Inf)\n", #> "\n", "f_name(x)\n", "\n", "f_label(x)\n"), "\n", #> list("\n", list(list("x"), list("A formula.")), "\n", #> "\n", list(list("width"), list("Width of each line.")), #> "\n", "\n", list(list("nlines"), list("Maximum number of lines to extract.")), #> "\n"), "\n", list("\n", "Equivalent of ", list( #> list("expr_text()")), " and ", list(list("expr_label()")), #> " for formulas.\n"), "\n", list("\n", "f <- ~ a + b + bc\n", #> "f_text(f)\n", "f_label(f)\n", "\n", "# Names a quoted with ``\n", #> "f_label(~ x)\n", "# Strings are encoded\n", #> "f_label(~ \"a\\nb\")\n", "# Long expressions are collapsed\n", #> "f_label(~ foo({\n", " 1 + 2\n", " print(x)\n", #> "}))\n"), "\n"), flatten.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-squash.R", #> "\n", list("flatten"), "\n", list("flatten"), "\n", #> list("flatten_lgl"), "\n", list("flatten_int"), "\n", #> list("flatten_dbl"), "\n", list("flatten_cpl"), "\n", #> list("flatten_chr"), "\n", list("flatten_raw"), "\n", #> list("squash"), "\n", list("squash_lgl"), "\n", list( #> "squash_int"), "\n", list("squash_dbl"), "\n", #> list("squash_cpl"), "\n", list("squash_chr"), "\n", #> list("squash_raw"), "\n", list("flatten_if"), "\n", #> list("squash_if"), "\n", list("Flatten or squash a list of lists into a simpler vector"), #> "\n", list("\n", "flatten(x)\n", "\n", "flatten_lgl(x)\n", #> "\n", "flatten_int(x)\n", "\n", "flatten_dbl(x)\n", #> "\n", "flatten_cpl(x)\n", "\n", "flatten_chr(x)\n", #> "\n", "flatten_raw(x)\n", "\n", "squash(x)\n", #> "\n", "squash_lgl(x)\n", "\n", "squash_int(x)\n", #> "\n", "squash_dbl(x)\n", "\n", "squash_cpl(x)\n", #> "\n", "squash_chr(x)\n", "\n", "squash_raw(x)\n", #> "\n", "flatten_if(x, predicate = is_spliced)\n", #> "\n", "squash_if(x, predicate = is_spliced)\n"), #> "\n", list("\n", list(list("x"), list("A list to flatten or squash. The contents of the list can\n", #> "be anything for unsuffixed functions ", list( #> "flatten()"), " and ", list("squash()"), "\n", #> "(as a list is returned), but the contents must match the type for\n", #> "the other functions.")), "\n", "\n", list(list( #> "predicate"), list("A function of one argument returning whether it\n", #> "should be spliced.")), "\n"), "\n", list("\n", #> list("flatten()"), " returns a list, ", list( #> "flatten_lgl()"), " a logical\n", "vector, ", #> list("flatten_int()"), " an integer vector, ", #> list("flatten_dbl()"), " a\n", "double vector, and ", #> list("flatten_chr()"), " a character vector. Similarly\n", #> "for ", list("squash()"), " and the typed variants (", #> list("squash_lgl()"), " etc).\n"), "\n", list( #> "\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("flatten()"), " removes one level hierarchy from a list, while\n", #> list("squash()"), " removes all levels. These functions are similar to\n", #> list(list("unlist()")), " but they are type-stable so you always know what the\n", #> "type of the output is.\n"), "\n", list(list( #> "Life cycle"), list("\n", "\n", "\n", "These functions are in the questioning stage. They have slightly\n", #> "different semantics than the flattening functions in purrr and we\n", #> "are currently rethinking our approach to flattening with the new\n", #> "typing facilities of the vctrs package.\n")), #> "\n", "\n", list("\n", "x <- replicate(2, sample(4), simplify = FALSE)\n", #> "x\n", "\n", "flatten(x)\n", "flatten_int(x)\n", #> "\n", "# With flatten(), only one level gets removed at a time:\n", #> "deep <- list(1, list(2, list(3)))\n", "flatten(deep)\n", #> "flatten(flatten(deep))\n", "\n", "# But squash() removes all levels:\n", #> "squash(deep)\n", "squash_dbl(deep)\n", "\n", #> "# The typed flatten functions remove one level and coerce to an atomic\n", #> "# vector at the same time:\n", "flatten_dbl(list(1, list(2)))\n", #> "\n", "# Only bare lists are flattened, but you can splice S3 lists\n", #> "# explicitly:\n", "foo <- set_attrs(list(\"bar\"), class = \"foo\")\n", #> "str(flatten(list(1, foo, list(100))))\n", "str(flatten(list(1, splice(foo), list(100))))\n", #> "\n", "# Instead of splicing manually, flatten_if() and squash_if() let\n", #> "# you specify a predicate function:\n", "is_foo <- function(x) inherits(x, \"foo\") || is_bare_list(x)\n", #> "str(flatten_if(list(1, foo, list(100)), is_foo))\n", #> "\n", "# squash_if() does the same with deep lists:\n", #> "deep_foo <- list(1, list(foo, list(foo, 100)))\n", #> "str(deep_foo)\n", "\n", "str(squash(deep_foo))\n", #> "str(squash_if(deep_foo, is_foo))\n"), "\n", #> list("internal"), "\n"), fn_body.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/fn.R", "\n", #> list("fn_body"), "\n", list("fn_body"), "\n", list( #> "fn_body<-"), "\n", list("Get or set function body"), #> "\n", list("\n", "fn_body(fn = caller_fn())\n", "\n", #> "fn_body(fn) <- value\n"), "\n", list("\n", list( #> list("fn"), list("A function. It is lookep up in the calling frame if not\n", #> "supplied.")), "\n", "\n", list(list("value"), #> list("New formals or formals names for ", list( #> "fn"), ".")), "\n"), "\n", list("\n", list( #> "fn_body()"), " is a simple wrapper around ", #> list(list("base::body()")), ". It always\n", #> "returns a ", list("{"), " expression and throws an error when the input is a\n", #> "primitive function (whereas ", list("body()"), #> " returns ", list("NULL"), "). The setter\n", #> "version preserves attributes, unlike ", list( #> "body<-"), ".\n"), "\n", list("\n", "# fn_body() is like body() but always returns a block:\n", #> "fn <- function() do()\n", "body(fn)\n", "fn_body(fn)\n", #> "\n", "# It also throws an error when used on a primitive function:\n", #> "try(fn_body(base::list))\n"), "\n"), fn_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list( #> "fn_env"), "\n", list("fn_env"), "\n", list("fn_env<-"), #> "\n", list("Return the closure environment of a function"), #> "\n", list("\n", "fn_env(fn)\n", "\n", "fn_env(x) <- value\n"), #> "\n", list("\n", list(list("fn, x"), list("A function.")), #> "\n", "\n", list(list("value"), list("A new closure environment for the function.")), #> "\n"), "\n", list("\n", "Closure environments define the scope of functions (see ", #> list(list("env()")), ").\n", "When a function call is evaluated, R creates an evaluation frame\n", #> "(see ", list(list("ctxt_stack()")), ") that inherits from the closure environment.\n", #> "This makes all objects defined in the closure environment and all\n", #> "its parents available to code executed within the function.\n"), #> "\n", list("\n", list("fn_env()"), " returns the closure environment of ", #> list("fn"), ". There is also\n", "an assignment method to set a new closure environment.\n"), #> "\n", list("\n", "env <- child_env(\"base\")\n", #> "fn <- with_env(env, function() NULL)\n", "identical(fn_env(fn), env)\n", #> "\n", "other_env <- child_env(\"base\")\n", "fn_env(fn) <- other_env\n", #> "identical(fn_env(fn), other_env)\n"), "\n"), #> fn_fmls.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/fn.R", "\n", #> list("fn_fmls"), "\n", list("fn_fmls"), "\n", list( #> "fn_fmls_names"), "\n", list("fn_fmls_syms"), #> "\n", list("fn_fmls<-"), "\n", list("fn_fmls_names<-"), #> "\n", list("Extract arguments from a function"), #> "\n", list("\n", "fn_fmls(fn = caller_fn())\n", "\n", #> "fn_fmls_names(fn = caller_fn())\n", "\n", "fn_fmls_syms(fn = caller_fn())\n", #> "\n", "fn_fmls(fn) <- value\n", "\n", "fn_fmls_names(fn) <- value\n"), #> "\n", list("\n", list(list("fn"), list("A function. It is lookep up in the calling frame if not\n", #> "supplied.")), "\n", "\n", list(list("value"), #> list("New formals or formals names for ", list( #> "fn"), ".")), "\n"), "\n", list("\n", list( #> "fn_fmls()"), " returns a named list of formal arguments.\n", #> list("fn_fmls_names()"), " returns the names of the arguments.\n", #> list("fn_fmls_syms()"), " returns formals as a named list of symbols. This\n", #> "is especially useful for forwarding arguments in ", #> list("constructed calls"), ".\n"), "\n", list( #> "\n", "Unlike ", list("formals()"), ", these helpers throw an error with primitive\n", #> "functions instead of returning ", list("NULL"), #> ".\n"), "\n", list("\n", "# Extract from current call:\n", #> "fn <- function(a = 1, b = 2) fn_fmls()\n", "fn()\n", #> "\n", "# fn_fmls_syms() makes it easy to forward arguments:\n", #> "call2(\"apply\", !!! fn_fmls_syms(lapply))\n", #> "\n", "# You can also change the formals:\n", #> "fn_fmls(fn) <- list(A = 10, B = 20)\n", "fn()\n", #> "\n", "fn_fmls_names(fn) <- c(\"foo\", \"bar\")\n", #> "fn()\n"), "\n", list("\n", list(list("call_args()")), #> " and ", list(list("call_args_names()")), "\n"), #> "\n"), frame_position.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("frame_position"), "\n", list("frame_position"), #> "\n", list("Find the position or distance of a frame on the evaluation stack"), #> "\n", list("\n", "frame_position(frame, from = c(\"global\", \"current\"))\n"), #> "\n", list("\n", list(list("frame"), list("The environment of a frame. Can be any object with a\n", #> list(list("get_env()")), " method. Note that for frame objects, the position from\n", #> "the global frame is simply ", list("frame$pos"), #> ". Alternatively, ", list("frame"), "\n", "can be an integer that represents the position on the stack (and\n", #> "is thus returned as is if ", list("from"), " is \"global\".")), #> "\n", "\n", list(list("from"), list("Whether to compute distance from the global frame (the\n", #> "bottom of the evaluation stack), or from the current frame (the\n", #> "top of the evaluation stack).")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "The frame position on the stack can be computed by counting frames\n", #> "from the global frame (the bottom of the stack, the default) or\n", #> "from the current frame (the top of the stack).\n"), #> "\n", list("\n", "While this function returns the position of the frame on the\n", #> "evaluation stack, it can safely be called with intervening frames\n", #> "as those will be discarded.\n"), "\n", list( #> list("Life cycle"), list("\n", "\n", "\n", "These functions are deprecated and replaced by ", #> list(list("trace_back()")), ".\n")), "\n", #> "\n", list("\n", "fn <- function() g(environment())\n", #> "g <- function(env) frame_position(env)\n", "\n", #> "# frame_position() returns the position of the frame on the evaluation stack:\n", #> "fn()\n", "identity(identity(fn()))\n", "\n", #> "# Note that it trims off intervening calls before counting so you\n", #> "# can safely nest it within other calls:\n", #> "g <- function(env) identity(identity(frame_position(env)))\n", #> "fn()\n", "\n", "# You can also ask for the position from the current frame rather\n", #> "# than the global frame:\n", "fn <- function() g(environment())\n", #> "g <- function(env) h(env)\n", "h <- function(env) frame_position(env, from = \"current\")\n", #> "fn()\n"), "\n", list("internal"), "\n"), friendly_type.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("friendly_type"), "\n", list("friendly_type"), #> "\n", list("Format a type for error messages"), "\n", #> list("\n", "friendly_type(type)\n"), "\n", list("\n", #> list(list("type"), list("A type as returned by ", #> list(list("typeof()")), ".")), "\n"), "\n", #> list("\n", "A string of the prettified type, qualified with an\n", #> "indefinite article.\n"), "\n", list("\n", "Format a type for error messages\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", list( #> "\n", list(), " ", list("friendly_type()"), " is experimental.\n"), #> "\n")), "\n", "\n", list("\n", "friendly_type(\"logical\")\n", #> "friendly_type(\"integer\")\n", "friendly_type(\"string\")\n"), #> "\n", list("internal"), "\n"), get_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env.R", "\n", list( #> "get_env"), "\n", list("get_env"), "\n", list( #> "set_env"), "\n", list("env_poke_parent"), "\n", #> list("Get or set the environment of an object"), #> "\n", list("\n", "get_env(env, default = NULL)\n", #> "\n", "set_env(env, new_env = caller_env())\n", #> "\n", "env_poke_parent(env, new_env)\n"), "\n", #> list("\n", list(list("env"), list("An environment.")), #> "\n", "\n", list(list("default"), list("The default environment in case ", #> list("env"), " does not wrap\n", "an environment. If ", #> list("NULL"), " and no environment could be extracted,\n", #> "an error is issued.")), "\n", "\n", list(list( #> "new_env"), list("An environment to replace ", #> list("env"), " with.")), "\n"), "\n", list( #> "\n", "These functions dispatch internally with methods for functions,\n", #> "formulas and frames. If called with a missing argument, the\n", #> "environment of the current evaluation frame (see ", #> list(list("ctxt_stack()")), ") is\n", "returned. If you call ", #> list("get_env()"), " with an environment, it acts as\n", #> "the identity function and the environment is simply returned (this\n", #> "helps simplifying code when writing generic functions for\n", #> "environments).\n"), "\n", list("\n", "While ", #> list("set_env()"), " returns a modified copy and does not have side\n", #> "effects, ", list("env_poke_parent()"), " operates changes the environment by\n", #> "side effect. This is because environments are\n", #> list("uncopyable"), ". Be careful not to change environments\n", #> "that you don't own, e.g. a parent environment of a function from a\n", #> "package.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", list("\n", list(), " Using ", #> list("get_env()"), " without supplying ", list( #> "env"), " is deprecated as\n", "of rlang 0.3.0. Please use ", #> list(list("current_env()")), " to retrieve the\n", #> "current environment.\n", list(), " Passing environment wrappers like formulas or functions instead\n", #> "of bare environments is deprecated as of rlang 0.3.0. This\n", #> "internal genericity was causing confusion (see issue #427). You\n", #> "should now extract the environment separately before calling\n", #> "these functions.\n"), "\n")), "\n", "\n", #> list("\n", "# Environment of closure functions:\n", #> "fn <- function() \"foo\"\n", "get_env(fn)\n", #> "\n", "# Or of quosures or formulas:\n", "get_env(~foo)\n", #> "get_env(quo(foo))\n", "\n", "\n", "# Provide a default in case the object doesn't bundle an environment.\n", #> "# Let's create an unevaluated formula:\n", "f <- quote(~foo)\n", #> "\n", "# The following line would fail if run because unevaluated formulas\n", #> "# don't bundle an environment (they didn't have the chance to\n", #> "# record one yet):\n", "# get_env(f)\n", "\n", #> "# It is often useful to provide a default when you're writing\n", #> "# functions accepting formulas as input:\n", #> "default <- env()\n", "identical(get_env(f, default), default)\n", #> "\n", "# set_env() can be used to set the enclosure of functions and\n", #> "# formulas. Let's create a function with a particular environment:\n", #> "env <- child_env(\"base\")\n", "fn <- set_env(function() NULL, env)\n", #> "\n", "# That function now has `env` as enclosure:\n", #> "identical(get_env(fn), env)\n", "identical(get_env(fn), current_env())\n", #> "\n", "# set_env() does not work by side effect. Setting a new environment\n", #> "# for fn has no effect on the original function:\n", #> "other_env <- child_env(NULL)\n", "set_env(fn, other_env)\n", #> "identical(get_env(fn), other_env)\n", "\n", #> "# Since set_env() returns a new function with a different\n", #> "# environment, you'll need to reassign the result:\n", #> "fn <- set_env(fn, other_env)\n", "identical(get_env(fn), other_env)\n"), #> "\n", list("\n", list(list("quo_get_env()")), " and ", #> list(list("quo_set_env()")), " for versions of\n", #> list(list("get_env()")), " and ", list(list("set_env()")), #> " that only work on quosures.\n"), "\n"), has_length.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/attr.R", "\n", #> list("has_length"), "\n", list("has_length"), "\n", #> list("How long is an object?"), "\n", list("\n", #> "has_length(x, n = NULL)\n"), "\n", list("\n", #> list(list("x"), list("A R object.")), "\n", "\n", #> list(list("n"), list("A specific length to test ", #> list("x"), " with. If ", list("NULL"), ",\n", #> list("has_length()"), " returns ", list("TRUE"), #> " if ", list("x"), " has length greater than\n", #> "zero, and ", list("FALSE"), " otherwise.")), #> "\n"), "\n", list("\n", "This is a function for the common task of testing the length of an\n", #> "object. It checks the length of an object in a non-generic way:\n", #> list(list("base::length()")), " methods are ignored.\n"), #> "\n", list("\n", "has_length(list())\n", "has_length(list(), 0)\n", #> "\n", "has_length(letters)\n", "has_length(letters, 20)\n", #> "has_length(letters, 26)\n"), "\n"), has_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/attr.R", "\n", #> list("has_name"), "\n", list("has_name"), "\n", list( #> "Does an object have an element with this name?"), #> "\n", list("\n", "has_name(x, name)\n"), "\n", list( #> "\n", list(list("x"), list("A data frame or another named object")), #> "\n", "\n", list(list("name"), list("Element name(s) to check")), #> "\n"), "\n", list("\n", "A logical vector of the same length as ", #> list("name"), "\n"), "\n", list("\n", "This function returns a logical value that indicates if a data\n", #> "frame or another named object contains an element with a specific\n", #> "name. Note that ", list("has_name()"), " only works with vectors. For instance,\n", #> "environments need the specialised function ", #> list(list("env_has()")), ".\n"), "\n", list("\n", #> "Unnamed objects are treated as if all names are empty strings. ", #> list("NA"), "\n", "input gives ", list("FALSE"), #> " as output.\n"), "\n", list("\n", "has_name(iris, \"Species\")\n", #> "has_name(mtcars, \"gears\")\n"), "\n"), inherits_any.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/s3.R", "\n", list( #> "inherits_any"), "\n", list("inherits_any"), #> "\n", list("inherits_all"), "\n", list("inherits_only"), #> "\n", list("Does an object inherit from a set of classes?"), #> "\n", list("\n", "inherits_any(x, class)\n", "\n", #> "inherits_all(x, class)\n", "\n", "inherits_only(x, class)\n"), #> "\n", list("\n", list(list("x"), list("An object to test for inheritance.")), #> "\n", "\n", list(list("class"), list("A character vector of classes.")), #> "\n"), "\n", list("\n", list("\n", list(), " ", #> list("inherits_any()"), " is like ", list(list( #> "base::inherits()")), " but is more explicit\n", #> "about its behaviour with multiple classes. If ", #> list("classes"), " contains\n", "several elements and the object inherits from at least one of\n", #> "them, ", list("inherits_any()"), " returns ", #> list("TRUE"), ".\n", list(), " ", list("inherits_all()"), #> " tests that an object inherits from all of the\n", #> "classes in the supplied order. This is usually the best way to\n", #> "test for inheritance of multiple classes.\n", #> list(), " ", list("inherits_only()"), " tests that the class vectors are identical. It\n", #> "is a shortcut for ", list("identical(class(x), class)"), #> ".\n"), "\n"), "\n", list("\n", "obj <- structure(list(), class = c(\"foo\", \"bar\", \"baz\"))\n", #> "\n", "# With the _any variant only one class must match:\n", #> "inherits_any(obj, c(\"foobar\", \"bazbaz\"))\n", #> "inherits_any(obj, c(\"foo\", \"bazbaz\"))\n", #> "\n", "# With the _all variant all classes must match:\n", #> "inherits_all(obj, c(\"foo\", \"bazbaz\"))\n", #> "inherits_all(obj, c(\"foo\", \"baz\"))\n", "\n", #> "# The order of classes must match as well:\n", #> "inherits_all(obj, c(\"baz\", \"foo\"))\n", "\n", #> "# inherits_only() checks that the class vectors are identical:\n", #> "inherits_only(obj, c(\"foo\", \"baz\"))\n", #> "inherits_only(obj, c(\"foo\", \"bar\", \"baz\"))\n"), #> "\n"), invoke.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/eval.R", #> "\n", list("invoke"), "\n", list("invoke"), "\n", #> list("Invoke a function with a list of arguments"), #> "\n", list("\n", "invoke(.fn, .args = list(), ..., .env = caller_env(),\n", #> " .bury = c(\".fn\", \"\"))\n"), "\n", list( #> "\n", list(list(".fn"), list("A function to invoke. Can be a function object or the\n", #> "name of a function in scope of ", list(".env"), #> ".")), "\n", "\n", list(list(".args, ..."), #> list("List of arguments (possibly named) to be passed to\n", #> list(".fn"), ".")), "\n", "\n", list(list( #> ".env"), list("The environment in which to call ", #> list(".fn"), ".")), "\n", "\n", list(list(".bury"), #> list("A character vector of length 2. The first string\n", #> "specifies which name should the function have in the call\n", #> "recorded in the evaluation stack. The second string specifies a\n", #> "prefix for the argument names. Set ", list( #> ".bury"), " to ", list("NULL"), " if you\n", #> "prefer to inline the function and its arguments in the call.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", "\n", "Normally, you invoke a R function by typing arguments manually. A\n", #> "powerful alternative is to call a function with a list of arguments\n", #> "assembled programmatically. This is the purpose of ", #> list("invoke()"), ".\n"), "\n", list("\n", "Technically, ", #> list("invoke()"), " is basically a version of ", #> list(list("base::do.call()")), "\n", "that creates cleaner call traces because it does not inline the\n", #> "function and the arguments in the call (see examples). To achieve\n", #> "this, ", list("invoke()"), " creates a child environment of ", #> list(".env"), " with ", list(".fn"), "\n", "and all arguments bound to new symbols (see ", #> list(list("env_bury()")), "). It then\n", "uses the same strategy as ", #> list(list("eval_bare()")), " to evaluate with minimal\n", #> "noise.\n"), "\n", list(list("Life cycle"), list( #> "\n", "\n", "\n", list("invoke()"), " is soft-deprecated in favour of ", #> list(list("exec()")), ". Now that we\n", "understand better the interaction between unquoting and dots\n", #> "capture, we can take a simpler approach in ", #> list("exec()"), ".\n", "\n", "If you need finer control over the generated call, you should construct\n", #> "an environment and call yourself, manually burying large objects\n", #> "or complex expressions.\n")), "\n", "\n", list( #> "\n", "# invoke() has the same purpose as do.call():\n", #> "invoke(paste, letters)\n", "\n", "# But it creates much cleaner calls:\n", #> "invoke(call_inspect, mtcars)\n", "\n", "# and stacktraces:\n", #> "fn <- function(...) sys.calls()\n", "invoke(fn, list(mtcars))\n", #> "\n", "# Compare to do.call():\n", "do.call(call_inspect, mtcars)\n", #> "do.call(fn, list(mtcars))\n", "\n", "\n", "# Specify the function name either by supplying a string\n", #> "# identifying the function (it should be visible in .env):\n", #> "invoke(\"call_inspect\", letters)\n", "\n", #> "# Or by changing the .bury argument, with which you can also change\n", #> "# the argument prefix:\n", "invoke(call_inspect, mtcars, .bury = c(\"inspect!\", \"col\"))\n"), #> "\n", list("internal"), "\n"), is_call.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("is_call"), "\n", list("is_call"), "\n", list( #> "Is object a call?"), "\n", list("\n", "is_call(x, name = NULL, n = NULL, ns = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test. If a formula, the right-hand side is\n", #> "extracted.")), "\n", "\n", list(list("name"), #> list("An optional name that the call should match. It is\n", #> "passed to ", list(list("sym()")), " before matching. This argument is vectorised\n", #> "and you can supply a vector of names to match. In this case,\n", #> list("is_call()"), " returns ", list("TRUE"), #> " if at least one name matches.")), "\n", "\n", #> list(list("n"), list("An optional number of arguments that the call should\n", #> "match.")), "\n", "\n", list(list("ns"), list( #> "The namespace of the call. If ", list("NULL"), #> ", the namespace\n", "doesn't participate in the pattern-matching. If an empty string\n", #> list("\"\""), " and ", list("x"), " is a namespaced call, ", #> list("is_call()"), " returns\n", list("FALSE"), #> ". If any other string, ", list("is_call()"), #> " checks that ", list("x"), " is\n", "namespaced within ", #> list("ns"), ".\n", "\n", "Can be a character vector of namespaces, in which case the call\n", #> "has to match at least one of them, otherwise ", #> list("is_call()"), " returns\n", list("FALSE"), #> ".")), "\n"), "\n", list("\n", "This function tests if ", #> list("x"), " is a ", list("call"), ". This is a\n", #> "pattern-matching predicate that returns ", list( #> "FALSE"), " if ", list("name"), " and ", list( #> "n"), "\n", "are supplied and the call does not match these properties.\n", #> list("is_unary_call()"), " and ", list("is_binary_call()"), #> " hardcode ", list("n"), " to 1 and 2.\n"), "\n", #> list(list("Life cycle"), list("\n", "\n", "\n", list( #> "is_lang()"), " has been soft-deprecated and renamed to ", #> list("is_call()"), " in\n", "rlang 0.2.0 and similarly for ", #> list("is_unary_lang()"), " and\n", list("is_binary_lang()"), #> ". This renaming follows the general switch from\n", #> "\"language\" to \"call\" in the rlang type nomenclature. See lifecycle\n", #> "section in ", list(list("call2()")), ".\n")), #> "\n", "\n", list("\n", "is_call(quote(foo(bar)))\n", #> "\n", "# You can pattern-match the call with additional arguments:\n", #> "is_call(quote(foo(bar)), \"foo\")\n", "is_call(quote(foo(bar)), \"bar\")\n", #> "is_call(quote(foo(bar)), quote(foo))\n", "\n", #> "# Match the number of arguments with is_call():\n", #> "is_call(quote(foo(bar)), \"foo\", 1)\n", "is_call(quote(foo(bar)), \"foo\", 2)\n", #> "\n", "\n", "# By default, namespaced calls are tested unqualified:\n", #> "ns_expr <- quote(base::list())\n", "is_call(ns_expr, \"list\")\n", #> "\n", "# You can also specify whether the call shouldn't be namespaced by\n", #> "# supplying an empty string:\n", "is_call(ns_expr, \"list\", ns = \"\")\n", #> "\n", "# Or if it should have a namespace:\n", #> "is_call(ns_expr, \"list\", ns = \"utils\")\n", #> "is_call(ns_expr, \"list\", ns = \"base\")\n", #> "\n", "# You can supply multiple namespaces:\n", #> "is_call(ns_expr, \"list\", ns = c(\"utils\", \"base\"))\n", #> "is_call(ns_expr, \"list\", ns = c(\"utils\", \"stats\"))\n", #> "\n", "# If one of them is \"\", unnamespaced calls will match as well:\n", #> "is_call(quote(list()), \"list\", ns = \"base\")\n", #> "is_call(quote(list()), \"list\", ns = c(\"base\", \"\"))\n", #> "is_call(quote(base::list()), \"list\", ns = c(\"base\", \"\"))\n", #> "\n", "\n", "# The name argument is vectorised so you can supply a list of names\n", #> "# to match with:\n", "is_call(quote(foo(bar)), c(\"bar\", \"baz\"))\n", #> "is_call(quote(foo(bar)), c(\"bar\", \"foo\"))\n", #> "is_call(quote(base::list), c(\"::\", \":::\", \"$\", \"@\"))\n"), #> "\n", list("\n", list(list("is_expression()")), "\n"), #> "\n"), is_callable.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/call.R", #> "\n", list("is_callable"), "\n", list("is_callable"), #> "\n", list("Is an object callable?"), "\n", list( #> "\n", "is_callable(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", "A callable object is an object that can appear in the function\n", #> "position of a call (as opposed to argument position). This includes\n", #> list("symbolic objects"), " that evaluate to a function or\n", #> "literal functions embedded in the call.\n"), #> "\n", list("\n", "Note that strings may look like callable objects because\n", #> "expressions of the form ", list("\"list\"()"), #> " are valid R code. However,\n", "that's only because the R parser transforms strings to symbols. It\n", #> "is not legal to manually set language heads to strings.\n"), #> "\n", list("\n", "# Symbolic objects and functions are callable:\n", #> "is_callable(quote(foo))\n", "is_callable(base::identity)\n", #> "\n", "# node_poke_car() lets you modify calls without any checking:\n", #> "lang <- quote(foo(10))\n", "node_poke_car(lang, current_env())\n", #> "\n", "# Use is_callable() to check an input object is safe to put as CAR:\n", #> "obj <- base::identity\n", "\n", "if (is_callable(obj)) {\n", #> " lang <- node_poke_car(lang, obj)\n", "} else {\n", #> " abort(\"`obj` must be callable\")\n", "}\n", #> "\n", "eval_bare(lang)\n"), "\n"), is_condition.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/cnd.R", "\n", list( #> "is_condition"), "\n", list("is_condition"), #> "\n", list("Is object a condition?"), "\n", list( #> "\n", "is_condition(x)\n"), "\n", list("\n", #> list(list("x"), list("An object to test.")), #> "\n"), "\n", list("\n", "Is object a condition?\n"), #> "\n"), is_copyable.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/types.R", #> "\n", list("is_copyable"), "\n", list("is_copyable"), #> "\n", list("Is an object copyable?"), "\n", list( #> "\n", "is_copyable(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", "When an object is modified, R generally copies it (sometimes\n", #> "lazily) to enforce ", list(list("https://en.wikipedia.org/wiki/Value_semantics"), #> list("value semantics")), ".\n", "However, some internal types are uncopyable. If you try to copy\n", #> "them, either with ", list("<-"), " or by argument passing, you actually create\n", #> "references to the original object rather than actual\n", #> "copies. Modifying these references can thus have far reaching side\n", #> "effects.\n"), "\n", list("\n", "# Let's add attributes with structure() to uncopyable types. Since\n", #> "# they are not copied, the attributes are changed in place:\n", #> "env <- env()\n", "structure(env, foo = \"bar\")\n", #> "env\n", "\n", "# These objects that can only be changed with side effect are not\n", #> "# copyable:\n", "is_copyable(env)\n", "\n", #> "structure(base::list, foo = \"bar\")\n", "str(base::list)\n"), #> "\n"), is_empty.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/types.R", #> "\n", list("is_empty"), "\n", list("is_empty"), "\n", #> list("Is object an empty vector or NULL?"), "\n", #> list("\n", "is_empty(x)\n"), "\n", list("\n", list( #> list("x"), list("object to test")), "\n"), "\n", #> list("\n", "Is object an empty vector or NULL?\n"), #> "\n", list("\n", "is_empty(NULL)\n", "is_empty(list())\n", #> "is_empty(list(NULL))\n"), "\n"), is_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_env"), "\n", list("is_env"), "\n", #> list("is_bare_env"), "\n", list("Is an object an environment?"), #> "\n", list("\n", "is_env(x)\n", "\n", "is_bare_env(x)\n"), #> "\n", list("\n", list(list("x"), list("object to test")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions were deprecated and renamed to ", #> list(list("is_environment()")), "\n", "and ", #> list(list("is_bare_environment()")), " in rlang 0.2.0. This is for consistency\n", #> "with other type predicates which are not abbreviated.\n"), #> "\n", list("internal"), "\n"), is_environment.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("is_environment"), "\n", list("is_environment"), #> "\n", list("is_bare_environment"), "\n", list("Is object an environment?"), #> "\n", list("\n", "is_environment(x)\n", "\n", "is_bare_environment(x)\n"), #> "\n", list("\n", list(list("x"), list("object to test")), #> "\n"), "\n", list("\n", list("is_bare_environment()"), #> " tests whether ", list("x"), " is an environment without a s3 or\n", #> "s4 class.\n"), "\n"), is_expr.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_expr"), "\n", list("is_expr"), "\n", #> list("Is an object an expression?"), "\n", list("\n", #> "is_expr(x)\n"), "\n", list("\n", list(list("x"), #> list("An object to test.")), "\n"), "\n", list( #> "\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "This function was deprecated and renamed to ", #> list(list("is_expression()")), " in\n", "rlang 0.2.0. This is for consistency with other type predicates\n", #> "which are not abbreviated.\n"), "\n", list("internal"), #> "\n"), is_expression.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/expr.R", #> "\n", list("is_expression"), "\n", list("is_expression"), #> "\n", list("is_syntactic_literal"), "\n", list("is_symbolic"), #> "\n", list("Is an object an expression?"), "\n", #> list("\n", "is_expression(x)\n", "\n", "is_syntactic_literal(x)\n", #> "\n", "is_symbolic(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", list("is_expression()"), " tests for expressions, the set of objects that can be\n", #> "obtained from parsing R code. An expression can be one of two\n", #> "things: either a symbolic object (for which ", #> list("is_symbolic()"), " returns\n", list("TRUE"), #> "), or a syntactic literal (testable with\n", #> list("is_syntactic_literal()"), "). Technically, calls can contain any R\n", #> "object, not necessarily symbolic objects or syntactic\n", #> "literals. However, this only happens in artificial\n", #> "situations. Expressions as we define them only contain numbers,\n", #> "strings, ", list("NULL"), ", symbols, and calls: this is the complete set of R\n", #> "objects that can be created when R parses source code (e.g. from\n", #> "using ", list(list("parse_expr()")), ").\n", #> "\n", "Note that we are using the term expression in its colloquial sense\n", #> "and not to refer to ", list(list("expression()")), #> " vectors, a data type that wraps\n", "expressions in a vector and which isn't used much in modern R code.\n"), #> "\n", list("\n", list("is_symbolic()"), " returns ", #> list("TRUE"), " for symbols and calls (objects with\n", #> "type ", list("language"), "). Symbolic objects are replaced by their value\n", #> "during evaluation. Literals are the complement of symbolic\n", #> "objects. They are their own value and return themselves during\n", #> "evaluation.\n", "\n", list("is_syntactic_literal()"), #> " is a predicate that returns ", list("TRUE"), #> " for the\n", "subset of literals that are created by R when parsing text (see\n", #> list(list("parse_expr()")), "): numbers, strings and ", #> list("NULL"), ". Along with symbols,\n", "these literals are the terminating nodes in an AST.\n", #> "\n", "Note that in the most general sense, a literal is any R object that\n", #> "evaluates to itself and that can be evaluated in the empty\n", #> "environment. For instance, ", list("quote(c(1, 2))"), #> " is not a literal, it is\n", "a call. However, the result of evaluating it in ", #> list(list("base_env()")), " is a\n", "literal(in this case an atomic vector).\n", #> "\n", "Pairlists are also a kind of language objects. However, since they\n", #> "are mostly an internal data structure, ", list( #> "is_expression()"), " returns ", list("FALSE"), #> "\n", "for pairlists. You can use ", list("is_pairlist()"), #> " to explicitly check for\n", "them. Pairlists are the data structure for function arguments. They\n", #> "usually do not arise from R code because subsetting a call is a\n", #> "type-preserving operation. However, you can obtain the pairlist of\n", #> "arguments by taking the CDR of the call object from C code. The\n", #> "rlang function ", list(list("node_cdr()")), #> " will do it from R. Another way in\n", "which pairlist of arguments arise is by extracting the argument\n", #> "list of a closure with ", list(list("base::formals()")), #> " or ", list(list("fn_fmls()")), ".\n"), "\n", #> list("\n", "q1 <- quote(1)\n", "is_expression(q1)\n", #> "is_syntactic_literal(q1)\n", "\n", "q2 <- quote(x)\n", #> "is_expression(q2)\n", "is_symbol(q2)\n", "\n", #> "q3 <- quote(x + 1)\n", "is_expression(q3)\n", #> "is_call(q3)\n", "\n", "\n", "# Atomic expressions are the terminating nodes of a call tree:\n", #> "# NULL or a scalar atomic vector:\n", "is_syntactic_literal(\"string\")\n", #> "is_syntactic_literal(NULL)\n", "\n", "is_syntactic_literal(letters)\n", #> "is_syntactic_literal(quote(call()))\n", "\n", #> "# Parsable literals have the property of being self-quoting:\n", #> "identical(\"foo\", quote(\"foo\"))\n", "identical(1L, quote(1L))\n", #> "identical(NULL, quote(NULL))\n", "\n", "# Like any literals, they can be evaluated within the empty\n", #> "# environment:\n", "eval_bare(quote(1L), empty_env())\n", #> "\n", "# Whereas it would fail for symbolic expressions:\n", #> "# eval_bare(quote(c(1L, 2L)), empty_env())\n", #> "\n", "\n", "# Pairlists are also language objects representing argument lists.\n", #> "# You will usually encounter them with extracted formals:\n", #> "fmls <- formals(is_expression)\n", "typeof(fmls)\n", #> "\n", "# Since they are mostly an internal data structure, is_expression()\n", #> "# returns FALSE for pairlists, so you will have to check explicitly\n", #> "# for them:\n", "is_expression(fmls)\n", "is_pairlist(fmls)\n"), #> "\n", list("\n", list(list("is_call()")), " for a call predicate.\n"), #> "\n"), is_formula.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/formula.R", #> "\n", list("is_formula"), "\n", list("is_formula"), #> "\n", list("is_bare_formula"), "\n", list("Is object a formula?"), #> "\n", list("\n", "is_formula(x, scoped = NULL, lhs = NULL)\n", #> "\n", "is_bare_formula(x, scoped = NULL, lhs = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("scoped"), list("A boolean indicating whether the quosure is scoped,\n", #> "that is, has a valid environment attribute. If ", #> list("NULL"), ", the scope\n", "is not inspected.")), #> "\n", "\n", list(list("lhs"), list("A boolean indicating whether the ", #> list("formula"), "\n", "or ", list("definition"), #> " has a left-hand side. If ", list("NULL"), #> ",\n", "the LHS is not inspected.")), "\n"), #> "\n", list("\n", list("is_formula()"), " tests if ", #> list("x"), " is a call to ", list("~"), ". ", #> list("is_bare_formula()"), "\n", "tests in addition that ", #> list("x"), " does not inherit from anything else than\n", #> list("\"formula\""), ".\n"), "\n", list("\n", #> "The ", list("scoped"), " argument patterns-match on whether the scoped bundled\n", #> "with the quosure is valid or not. Invalid scopes may happen in\n", #> "nested quotations like ", list("~~expr"), ", where the outer quosure is validly\n", #> "scoped but not the inner one. This is because ", #> list("~"), " saves the\n", "environment when it is evaluated, and quoted formulas are by\n", #> "definition not evaluated.\n"), "\n", list("\n", #> "x <- disp ~ am\n", "is_formula(x)\n", "\n", #> "is_formula(~10)\n", "is_formula(10)\n", "\n", #> "is_formula(quo(foo))\n", "is_bare_formula(quo(foo))\n", #> "\n", "# Note that unevaluated formulas are treated as bare formulas even\n", #> "# though they don't inherit from \"formula\":\n", #> "f <- quote(~foo)\n", "is_bare_formula(f)\n", #> "\n", "# However you can specify `scoped` if you need the predicate to\n", #> "# return FALSE for these unevaluated formulas:\n", #> "is_bare_formula(f, scoped = TRUE)\n", "is_bare_formula(eval(f), scoped = TRUE)\n"), #> "\n"), is_frame.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_frame"), "\n", list("is_frame"), "\n", #> list("Is object a frame?"), "\n", list("\n", "is_frame(x)\n"), #> "\n", list("\n", list(list("x"), list("Object to test")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n"), "\n", list("internal"), "\n"), is_function.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list( #> "is_function"), "\n", list("is_function"), "\n", #> list("is_closure"), "\n", list("is_primitive"), "\n", #> list("is_primitive_eager"), "\n", list("is_primitive_lazy"), #> "\n", list("Is object a function?"), "\n", list("\n", #> "is_function(x)\n", "\n", "is_closure(x)\n", #> "\n", "is_primitive(x)\n", "\n", "is_primitive_eager(x)\n", #> "\n", "is_primitive_lazy(x)\n"), "\n", list("\n", #> list(list("x"), list("Object to be tested.")), #> "\n"), "\n", list("\n", "The R language defines two different types of functions: primitive\n", #> "functions, which are low-level, and closures, which are the regular\n", #> "kind of functions.\n"), "\n", list("\n", "Closures are functions written in R, named after the way their\n", #> "arguments are scoped within nested environments (see\n", #> "https://en.wikipedia.org/wiki/Closure_(computer_programming)). The\n", #> "root environment of the closure is called the closure\n", #> "environment. When closures are evaluated, a new environment called\n", #> "the evaluation frame is created with the closure environment as\n", #> "parent. This is where the body of the closure is evaluated. These\n", #> "closure frames appear on the evaluation stack (see ", #> list(list("ctxt_stack()")), "),\n", "as opposed to primitive functions which do not necessarily have\n", #> "their own evaluation frame and never appear on the stack.\n", #> "\n", "Primitive functions are more efficient than closures for two\n", #> "reasons. First, they are written entirely in fast low-level\n", #> "code. Second, the mechanism by which they are passed arguments is\n", #> "more efficient because they often do not need the full procedure of\n", #> "argument matching (dealing with positional versus named arguments,\n", #> "partial matching, etc). One practical consequence of the special\n", #> "way in which primitives are passed arguments is that they\n", #> "technically do not have formal arguments, and ", #> list(list("formals()")), " will\n", "return ", #> list("NULL"), " if called on a primitive function. Finally, primitive\n", #> "functions can either take arguments lazily, like R closures do,\n", #> "or evaluate them eagerly before being passed on to the C code.\n", #> "The former kind of primitives are called \"special\" in R terminology,\n", #> "while the latter is referred to as \"builtin\". ", #> list("is_primitive_eager()"), "\n", "and ", list( #> "is_primitive_lazy()"), " allow you to check whether a primitive\n", #> "function evaluates arguments eagerly or lazily.\n", #> "\n", "You will also encounter the distinction between primitive and\n", #> "internal functions in technical documentation. Like primitive\n", #> "functions, internal functions are defined at a low level and\n", #> "written in C. However, internal functions have no representation in\n", #> "the R language. Instead, they are called via a call to\n", #> list(list("base::.Internal()")), " within a regular closure. This ensures that\n", #> "they appear as normal R function objects: they obey all the usual\n", #> "rules of argument passing, and they appear on the evaluation stack\n", #> "as any other closures. As a result, ", list( #> list("fn_fmls()")), " does not need to\n", #> "look in the ", list(".ArgsEnv"), " environment to obtain a representation of\n", #> "their arguments, and there is no way of querying from R whether\n", #> "they are lazy ('special' in R terminology) or eager ('builtin').\n", #> "\n", "You can call primitive functions with ", #> list(list(".Primitive()")), " and internal\n", #> "functions with ", list(list(".Internal()")), #> ". However, calling internal functions\n", "in a package is forbidden by CRAN's policy because they are\n", #> "considered part of the private API. They often assume that they\n", #> "have been called with correctly formed arguments, and may cause R\n", #> "to crash if you call them with unexpected objects.\n"), #> "\n", list("\n", "# Primitive functions are not closures:\n", #> "is_closure(base::c)\n", "is_primitive(base::c)\n", #> "\n", "# On the other hand, internal functions are wrapped in a closure\n", #> "# and appear as such from the R side:\n", "is_closure(base::eval)\n", #> "\n", "# Both closures and primitives are functions:\n", #> "is_function(base::c)\n", "is_function(base::eval)\n", #> "\n", "# Primitive functions never appear in evaluation stacks:\n", #> "is_primitive(base::`[[`)\n", "is_primitive(base::list)\n", #> "list(ctxt_stack())[[1]]\n", "\n", "# While closures do:\n", #> "identity(identity(ctxt_stack()))\n", "\n", "# Many primitive functions evaluate arguments eagerly:\n", #> "is_primitive_eager(base::c)\n", "is_primitive_eager(base::list)\n", #> "is_primitive_eager(base::`+`)\n", "\n", "# However, primitives that operate on expressions, like quote() or\n", #> "# substitute(), are lazy:\n", "is_primitive_lazy(base::quote)\n", #> "is_primitive_lazy(base::substitute)\n"), "\n"), #> is_installed.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("is_installed"), "\n", list("is_installed"), #> "\n", list("Is a package installed in the library?"), #> "\n", list("\n", "is_installed(pkg)\n"), "\n", list( #> "\n", list(list("pkg"), list("The name of a package.")), #> "\n"), "\n", list("\n", list("TRUE"), " if the package is installed, ", #> list("FALSE"), " otherwise.\n"), "\n", list("\n", #> "This checks that a package is installed with minimal side effects.\n", #> "If installed, the package will be loaded but not attached.\n"), #> "\n", list("\n", "is_installed(\"utils\")\n", "is_installed(\"ggplot5\")\n"), #> "\n"), is_integerish.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/types.R", #> "\n", list("is_integerish"), "\n", list("is_integerish"), #> "\n", list("is_bare_integerish"), "\n", list("is_scalar_integerish"), #> "\n", list("Is a vector integer-like?"), "\n", list( #> "\n", "is_integerish(x, n = NULL, finite = NULL)\n", #> "\n", "is_bare_integerish(x, n = NULL, finite = NULL)\n", #> "\n", "is_scalar_integerish(x, finite = NULL)\n"), #> "\n", list("\n", list(list("x"), list("Object to be tested.")), #> "\n", "\n", list(list("n"), list("Expected length of a vector.")), #> "\n", "\n", list(list("finite"), list("Whether all values of the vector are finite. The\n", #> "non-finite values are ", list("NA"), ", ", #> list("Inf"), ", ", list("-Inf"), " and ", list( #> "NaN"), ". Setting this\n", "to something other than ", #> list("NULL"), " can be expensive because the whole\n", #> "vector needs to be traversed and checked.")), #> "\n"), "\n", list("\n", "These predicates check whether R considers a number vector to be\n", #> "integer-like, according to its own tolerance check (which is in\n", #> "fact delegated to the C library). This function is not adapted to\n", #> "data analysis, see the help for ", list(list( #> "base::is.integer()")), " for examples\n", #> "of how to check for whole numbers.\n", "\n", #> "Things to consider when checking for integer-like doubles:\n", #> list("\n", list(), " This check can be expensive because the whole double vector has\n", #> "to be traversed and checked.\n", list(), " Large double values may be integerish but may still not be\n", #> "coercible to integer. This is because integers in R only support\n", #> "values up to ", list("2^31 - 1"), " while numbers stored as double can be\n", #> "much larger.\n"), "\n"), "\n", list("\n", #> "is_integerish(10L)\n", "is_integerish(10.0)\n", #> "is_integerish(10.0, n = 2)\n", "is_integerish(10.000001)\n", #> "is_integerish(TRUE)\n"), "\n", list("\n", list( #> list("is_bare_numeric()")), " for testing whether an object is a\n", #> "base numeric type (a bare double or integer vector).\n"), #> "\n"), is_interactive.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/state.R", #> "\n", list("is_interactive"), "\n", list("is_interactive"), #> "\n", list("scoped_interactive"), "\n", list("with_interactive"), #> "\n", list("Is R running interactively?"), "\n", #> list("\n", "is_interactive()\n", "\n", "scoped_interactive(value = TRUE, frame = caller_env())\n", #> "\n", "with_interactive(expr, value = TRUE)\n"), #> "\n", list("\n", list(list("value"), list("A single ", #> list("TRUE"), " or ", list("FALSE"), ". This overrides the return\n", #> "value of ", list("is_interactive()"), ".")), #> "\n", "\n", list(list("frame"), list("The environment of a running function which defines\n", #> "the scope of the temporary options. When the function returns,\n", #> "the options are reset to their original values.")), #> "\n", "\n", list(list("expr"), list("An expression to evaluate with interactivity set to\n", #> list("value"), ".")), "\n"), "\n", list("\n", #> "Like ", list(list("base::interactive()")), ", ", #> list("is_interactive()"), " returns ", list("TRUE"), #> " when\n", "the function runs interactively and ", #> list("FALSE"), " when it runs in batch\n", "mode. It also checks, in this order:\n", #> list("\n", list(), " The ", list("rlang_interactive"), #> " global option. If set to a single ", list( #> "TRUE"), "\n", "or ", list("FALSE"), ", ", #> list("is_interactive()"), " returns that value immediately. This\n", #> "escape hatch is useful in unit tests or to manually turn on\n", #> "interactive features in RMarkdown outputs.\n", #> list(), " Whether knitr, an RStudio notebook, or testthat is in progress.\n"), #> "\n", "\n", list("with_interactive()"), " and ", #> list("scoped_interactive()"), " set the global\n", #> "option conveniently.\n"), "\n"), is_lang.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_lang"), "\n", list("is_lang"), "\n", #> list("is_unary_lang"), "\n", list("is_binary_lang"), #> "\n", list("quo_is_lang"), "\n", list("Is object a call?"), #> "\n", list("\n", "is_lang(x, name = NULL, n = NULL, ns = NULL)\n", #> "\n", "is_unary_lang(x, name = NULL, ns = NULL)\n", #> "\n", "is_binary_lang(x, name = NULL, ns = NULL)\n", #> "\n", "quo_is_lang(quo)\n"), "\n", list("\n", #> list(list("x"), list("An object to test. If a formula, the right-hand side is\n", #> "extracted.")), "\n", "\n", list(list("name"), #> list("An optional name that the call should match. It is\n", #> "passed to ", list(list("sym()")), " before matching. This argument is vectorised\n", #> "and you can supply a vector of names to match. In this case,\n", #> list("is_call()"), " returns ", list("TRUE"), #> " if at least one name matches.")), "\n", #> "\n", list(list("n"), list("An optional number of arguments that the call should\n", #> "match.")), "\n", "\n", list(list("ns"), list( #> "The namespace of the call. If ", list("NULL"), #> ", the namespace\n", "doesn't participate in the pattern-matching. If an empty string\n", #> list("\"\""), " and ", list("x"), " is a namespaced call, ", #> list("is_call()"), " returns\n", list("FALSE"), #> ". If any other string, ", list("is_call()"), #> " checks that ", list("x"), " is\n", "namespaced within ", #> list("ns"), ".\n", "\n", "Can be a character vector of namespaces, in which case the call\n", #> "has to match at least one of them, otherwise ", #> list("is_call()"), " returns\n", list("FALSE"), #> ".")), "\n", "\n", list(list("quo"), list("A quosure to test.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions are deprecated, please use ", #> list(list("is_call()")), " and its ", list("n"), #> "\n", "argument instead.\n"), "\n", list("internal"), #> "\n"), is_named.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/attr.R", #> "\n", list("is_named"), "\n", list("is_named"), "\n", #> list("is_dictionaryish"), "\n", list("have_name"), #> "\n", list("Is object named?"), "\n", list("\n", #> "is_named(x)\n", "\n", "is_dictionaryish(x)\n", #> "\n", "have_name(x)\n"), "\n", list("\n", list( #> list("x"), list("An object to test.")), "\n"), #> "\n", list("\n", list("is_named()"), " and ", list( #> "is_dictionaryish()"), " are scalar predicates\n", #> "and return ", list("TRUE"), " or ", list("FALSE"), #> ". ", list("have_name()"), " is vectorised and\n", #> "returns a logical vector as long as the input.\n"), #> "\n", list("\n", list("is_named()"), " checks that ", #> list("x"), " has names attributes, and that none of\n", #> "the names are missing or empty (", list("NA"), #> " or ", list("\"\""), "). ", list("is_dictionaryish()"), #> "\n", "checks that an object is a dictionary: that it has actual names and\n", #> "in addition that there are no duplicated names. ", #> list("have_name()"), "\n", "is a vectorised version of ", #> list("is_named()"), ".\n"), "\n", list("\n", #> "# A data frame usually has valid, unique names\n", #> "is_named(mtcars)\n", "have_name(mtcars)\n", #> "is_dictionaryish(mtcars)\n", "\n", "# But data frames can also have duplicated columns:\n", #> "dups <- cbind(mtcars, cyl = seq_len(nrow(mtcars)))\n", #> "is_dictionaryish(dups)\n", "\n", "# The names are still valid:\n", #> "is_named(dups)\n", "have_name(dups)\n", "\n", #> "\n", "# For empty objects the semantics are slightly different.\n", #> "# is_dictionaryish() returns TRUE for empty objects:\n", #> "is_dictionaryish(list())\n", "\n", "# But is_named() will only return TRUE if there is a names\n", #> "# attribute (a zero-length character vector in this case):\n", #> "x <- set_names(list(), character(0))\n", "is_named(x)\n", #> "\n", "\n", "# Empty and missing names are invalid:\n", #> "invalid <- dups\n", "names(invalid)[2] <- \"\"\n", #> "names(invalid)[5] <- NA\n", "\n", "# is_named() performs a global check while have_name() can show you\n", #> "# where the problem is:\n", "is_named(invalid)\n", #> "have_name(invalid)\n", "\n", "# have_name() will work even with vectors that don't have a names\n", #> "# attribute:\n", "have_name(letters)\n"), "\n"), #> is_namespace.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/env-special.R", #> "\n", list("is_namespace"), "\n", list("is_namespace"), #> "\n", list("Is an object a namespace environment?"), #> "\n", list("\n", "is_namespace(x)\n"), "\n", list( #> "\n", list(list("x"), list("An object to test.")), #> "\n"), "\n", list("\n", "Is an object a namespace environment?\n"), #> "\n"), is_pairlist.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/node.R", #> "\n", list("is_pairlist"), "\n", list("is_pairlist"), #> "\n", list("is_node"), "\n", list("is_node_list"), #> "\n", list("Is object a node or pairlist?"), "\n", #> list("\n", "is_pairlist(x)\n", "\n", "is_node(x)\n", #> "\n", "is_node_list(x)\n"), "\n", list("\n", #> list(list("x"), list("Object to test.")), "\n"), #> "\n", list("\n", list("\n", list(), " ", list("is_pairlist()"), #> " checks that ", list("x"), " has type ", list( #> "pairlist"), ".\n", list(), " ", list("is_node()"), #> " checks that ", list("x"), " has type ", list( #> "pairlist"), " or ", list("language"), ".\n", #> "It tests whether ", list("x"), " is a node that has a CAR and a CDR,\n", #> "including callable nodes (language objects).\n", #> list(), " ", list("is_node_list()"), " checks that ", #> list("x"), " has type ", list("pairlist"), " or ", #> list("NULL"), ".\n", list("NULL"), " is the empty node list.\n"), #> "\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "These functions are experimental. We are still figuring out a good\n", #> "naming convention to refer to the different lisp-like lists in R.\n")), #> "\n", "\n", list("\n", list(list("is_call()")), " tests for language nodes.\n"), #> "\n", list("internal"), "\n"), is_reference.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("is_reference"), "\n", list("is_reference"), #> "\n", list("Is an object referencing another?"), #> "\n", list("\n", "is_reference(x, y)\n"), "\n", list( #> "\n", list(list("x, y"), list("R objects.")), #> "\n"), "\n", list("\n", "There are typically two situations where two symbols may refer to\n", #> "the same object.\n", list("\n", list(), " R objects usually have copy-on-write semantics. This is an\n", #> "optimisation that ensures that objects are only copied if\n", #> "needed. When you copy a vector, no memory is actually copied\n", #> "until you modify either the original object or the copy is\n", #> "modified.\n", "\n", "Note that the copy-on-write optimisation is an implementation\n", #> "detail that is not guaranteed by the specification of the R\n", #> "language.\n", list(), " Assigning an ", list( #> "uncopyable"), " object (like an\n", "environment) creates a reference. These objects are never copied\n", #> "even if you modify one of the references.\n"), #> "\n"), "\n", list("\n", "# Reassigning an uncopyable object such as an environment creates a\n", #> "# reference:\n", "env <- env()\n", "ref <- env\n", #> "is_reference(ref, env)\n", "\n", "# Due to copy-on-write optimisation, a copied vector can\n", #> "# temporarily reference the original vector:\n", #> "vec <- 1:10\n", "copy <- vec\n", "is_reference(copy, vec)\n", #> "\n", "# Once you modify on of them, the copy is triggered in the\n", #> "# background and the objects cease to reference each other:\n", #> "vec[[1]] <- 100\n", "is_reference(copy, vec)\n"), #> "\n"), is_stack.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("is_stack"), "\n", list("is_stack"), "\n", #> list("is_eval_stack"), "\n", list("is_call_stack"), #> "\n", list("Is object a stack?"), "\n", list("\n", #> "is_stack(x)\n", "\n", "is_eval_stack(x)\n", #> "\n", "is_call_stack(x)\n"), "\n", list("\n", #> list(list("x"), list("An object to test")), "\n"), #> "\n", list("\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n"), "\n"), is_symbol.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/sym.R", "\n", #> list("is_symbol"), "\n", list("is_symbol"), "\n", #> list("Is object a symbol?"), "\n", list("\n", "is_symbol(x, name = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("name"), list("An optional name or vector of names that the symbol\n", #> "should match.")), "\n"), "\n", list("\n", #> "Is object a symbol?\n"), "\n"), is_true.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/types.R", "\n", #> list("is_true"), "\n", list("is_true"), "\n", list( #> "is_false"), "\n", list("Is object identical to TRUE or FALSE?"), #> "\n", list("\n", "is_true(x)\n", "\n", "is_false(x)\n"), #> "\n", list("\n", list(list("x"), list("object to test")), #> "\n"), "\n", list("\n", "These functions bypass R's automatic conversion rules and check\n", #> "that ", list("x"), " is literally ", list("TRUE"), #> " or ", list("FALSE"), ".\n"), "\n", list("\n", #> "is_true(TRUE)\n", "is_true(1)\n", "\n", "is_false(FALSE)\n", #> "is_false(0)\n"), "\n"), is_weakref.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/weakref.R", "\n", #> list("is_weakref"), "\n", list("is_weakref"), "\n", #> list("Is object a weak reference?"), "\n", list("\n", #> "is_weakref(x)\n"), "\n", list("\n", list(list( #> "x"), list("An object to test.")), "\n"), "\n", #> list("\n", "Is object a weak reference?\n"), "\n"), #> lang.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("lang"), "\n", list("lang"), "\n", list( #> "new_language"), "\n", list("Create a call"), #> "\n", list("\n", "lang(.fn, ..., .ns = NULL)\n", #> "\n", "new_language(head, tail = NULL)\n"), "\n", #> list("\n", list(list(".fn"), list("Function to call. Must be a callable object: a string,\n", #> "symbol, call, or a function.")), "\n", "\n", #> list(list("..."), list("Arguments to the call either in or out of a list. These dots\n", #> "support ", list("tidy dots"), " features. Empty arguments are preserved.")), #> "\n", "\n", list(list(".ns"), list("Namespace with which to prefix ", #> list(".fn"), ". Must be a string\n", "or symbol.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions are deprecated, please use ", #> list(list("call2()")), " and\n", list(list("new_call()")), #> " instead.\n"), "\n", list("internal"), "\n"), #> lang_head.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("lang_head"), "\n", list("lang_head"), #> "\n", list("lang_tail"), "\n", list("Return the head or tail of a call"), #> "\n", list("\n", "lang_head(lang)\n", "\n", "lang_tail(lang)\n"), #> "\n", list("\n", list(list("lang"), list("A call.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "As of rlang 0.2.0 these functions are retired (deprecated for now)\n", #> "because they are low level accessors that are rarely needed for end\n", #> "users.\n"), "\n"), lang_modify.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("lang_modify"), "\n", list("lang_modify"), #> "\n", list("lang_standardise"), "\n", list("lang_fn"), #> "\n", list("lang_name"), "\n", list("lang_args"), #> "\n", list("lang_args_names"), "\n", list("Manipulate or access a call"), #> "\n", list("\n", "lang_modify(.lang, ..., .standardise = FALSE)\n", #> "\n", "lang_standardise(lang)\n", "\n", "lang_fn(lang)\n", #> "\n", "lang_name(lang)\n", "\n", "lang_args(lang)\n", #> "\n", "lang_args_names(lang)\n"), "\n", list( #> "\n", list(list("..."), list("Named or unnamed expressions (constants, names or calls)\n", #> "used to modify the call. Use ", list(list( #> "zap()")), " to remove arguments. These\n", #> "dots support ", list("tidy dots"), " features. Empty arguments are\n", #> "allowed and preserved.")), "\n", "\n", list( #> list(".standardise"), list("Soft-deprecated as of rlang 0.3.0. Please\n", #> "call ", list(list("call_standardise()")), #> " manually.")), "\n", "\n", list(list("lang, .lang"), #> list("The ", list("call"), " or ", list(".call"), #> " argument of the renamed\n", "functions.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions are deprecated, please use ", #> list(list("call_modify()")), ",\n", list(list( #> "call_standardise()")), ", or ", list(list( #> "call_fn()")), " instead.\n"), "\n", list("internal"), #> "\n"), last_error.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/cnd-abort.R", #> "\n", list("last_error"), "\n", list("last_error"), #> "\n", list("last_trace"), "\n", list("Last ", list( #> "abort()"), " error"), "\n", list("\n", "last_error()\n", #> "\n", "last_trace()\n"), "\n", list("\n", list( #> "\n", list(), " ", list("last_error()"), " returns the last error thrown with ", #> list(list("abort()")), ". The\n", "error is printed with a backtrace in simplified form.\n", #> list(), " ", list("last_trace()"), " is a shortcut to return the backtrace stored in\n", #> "the last error. This backtrace is printed in full form.\n"), #> "\n"), "\n"), lifecycle.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle.R", #> "\n", list("lifecycle"), "\n", list("lifecycle"), #> "\n", list("Life cycle of the rlang package"), "\n", #> list("\n", list("rlang:::lifecycle(\"maturing\")"), #> "\n", "\n", "The rlang package is currently maturing. Unless otherwise stated,\n", #> "this applies to all its exported functions. Maturing functions are\n", #> "susceptible to API changes. Only use these in packages if you're\n", #> "prepared to make changes as the package evolves. See sections below\n", #> "for a list of functions marked as stable.\n", #> "\n", "The documentation pages of retired functions contain life cycle\n", #> "sections that explain the reasons for their retirements.\n"), #> "\n", list(list("Stable functions"), list("\n", "\n", #> "\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", list("\n", list(), " ", list(list("eval_tidy()")), #> "\n", list(), " ", list("!!"), ", ", list("!!!"), #> "\n", list(), " ", list(list("enquo()")), ", ", #> list(list("quo()")), ", ", list(list("quos()")), #> "\n", list(), " ", list(list("enexpr()")), #> ", ", list(list("expr()")), ", ", list(list( #> "exprs()")), "\n", list(), " ", list(list( #> "sym()")), ", ", list(list("syms()")), "\n", #> list(), " ", list(list("new_quosure()")), ", ", #> list(list("is_quosure()")), "\n", list(), " ", #> list(list("missing_arg()")), ", ", list(list( #> "is_missing()")), "\n", list(), " ", list( #> list("quo_get_expr()")), ", ", list(list( #> "quo_set_expr()")), "\n", list(), " ", list( #> list("quo_get_env()")), ", ", list(list("quo_set_env()")), #> "\n", list(), " ", list(list("eval_bare()")), #> "\n", list(), " ", list(list("set_names()")), #> ", ", list(list("names2()")), "\n", list(), #> " ", list(list("as_function()")), ", ", list( #> list("new_function()")), "\n"), "\n")), "\n", #> "\n", list(list("Experimental functions"), list("\n", #> "\n", "\n", list("rlang:::lifecycle(\"experimental\")"), #> "\n", "\n", "These functions are not yet part of the rlang API. Expect breaking\n", #> "changes.\n", list("\n", list(), " ", list(list( #> "with_env()")), ", ", list(list("locally()")), #> ", ", list(list("env_poke()")), "\n", list(), #> " ", list(list("pkg_env()")), ", ", list(list( #> "pkg_env_name()")), ", ", list(list("ns_env()")), #> ", ", list(list("ns_imports_env()")), ", ", #> list(list("ns_env_name()")), "\n", list(), #> " ", list(list("is_pairlist()")), ", ", list( #> list("as_pairlist()")), ", ", list(list("is_node()")), #> ", ", list(list("is_node_list()")), "\n", list(), #> " ", list(list("is_definition()")), ", ", list( #> list("new_definition()")), ", ", list(list( #> "is_formulaish()")), ",\n", list(list("dots_definitions()")), #> "\n", list(), " ", list(list("scoped_options()")), #> ", ", list(list("with_options()")), ", ", list( #> list("push_options()")), ",\n", list(list( #> "peek_options()")), ", ", list(list("peek_option()")), #> "\n", list(), " ", list(list("as_bytes()")), #> ", ", list(list("chr_unserialise_unicode()")), #> "\n", list(), " ", list(list("caller_fn()")), #> ", ", list(list("current_fn()")), "\n"), "\n")), #> "\n", "\n", list(list("Questioning stage"), list( #> "\n", "\n", "\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("In the questioning stage as of rlang 0.4.0"), #> "\n", "\n", "These functions are likely to be moved to the vctrs package:\n", #> list("\n", list(), " ", list(list("lgl()")), #> ", ", list(list("int()")), ", etc.\n", list(), #> " ", list(list("new_logical()")), ", ", list( #> list("new_integer()")), ", etc.\n", list(), #> " ", list("na_lgl"), ", ", list("na_int"), #> ", ", list(list("is_lgl_na()")), ", ", list( #> list("is_int_na()")), ", etc.\n"), "\n", #> "\n", list("In the questioning stage as of rlang 0.3.0"), #> "\n", list("\n", list(), " ", list(list("child_env()")), #> "\n", list(), " ", list(list("flatten()")), #> ", ", list(list("squash()")), ", and their atomic vector variants\n", #> list(), " ", list(list("modify()")), " and ", #> list(list("prepend()")), "\n", list(), " ", #> list(list("with_restarts()")), ", ", list(list( #> "rst_list()")), ", ", list(list("rst_exists()")), #> ", ", list(list("rst_jump()")), ",\n", list( #> list("rst_maybe_jump()")), ", ", list(list( #> "rst_abort()")), ". It is not clear yet whether we\n", #> "want to recommend restarts as a style of programming in R.\n", #> list(), " ", list(list("return_from()")), " and ", #> list(list("return_to()")), ".\n", list(), " ", #> list(list("expr_label()")), ", ", list(list( #> "expr_name()")), ", and ", list(list("expr_text()")), #> ".\n"), "\n", "\n", list("In the questioning stage as of rlang 0.2.0"), #> "\n", list("\n", list(), " ", list(list("UQ()")), #> ", ", list(list("UQS()")), "\n", list(), " ", #> list(list("dots_splice()")), ", ", list(list( #> "splice()")), "\n"), "\n")), "\n", "\n", #> list(list("Soft-deprecated functions and arguments"), #> list("\n", "\n", "\n", list("rlang:::lifecycle(\"soft-deprecated\")"), #> "\n", "\n", list("Soft-deprecated in rlang 0.4.0"), #> "\n", list("\n", list(), " ", list(list("exiting()")), #> ": Handlers are now treated as exiting by default.\n", #> list(), " ", list(list("invoke()")), ": Use the simpler ", #> list(list("exec()")), " instead.\n", list(), #> " ", list(list("as_logical()")), ", ", list( #> list("as_integer()")), ", etc. => ", list( #> "vctrs::vec_cast()"), ".\n", list(), " ", #> list(list("type_of()")), ", ", list(list( #> "switch_type()")), ", ", list(list("coerce_type()")), #> ", ", list(list("switch_class()")), ",\n", #> list(list("coerce_class()")), "\n"), "\n")), #> "\n", "\n", list(list("Deprecated functions and arguments"), #> list("\n", "\n", "\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", list("Bumped to deprecated in rlang 0.4.0"), #> "\n", list("\n", list(), " ", list(list("modify()")), #> " and ", list(list("prepend()")), ".\n", #> list(), " ", list("new_logical_along()"), #> ", ", list("new_integer_along()"), ",\n", #> list("new_double_along()"), ", ", list("new_complex_along()"), #> ",\n", list("new_character_along()"), ", ", #> list("new_raw_along()"), ", ", list("new_list_along()"), #> ".\n", list(), " ", list(list("lang_modify()")), #> " => ", list(list("call_modify()")), "\n", #> list(), " ", list(list("lang_standardise()")), #> " => ", list(list("call_standardise()")), #> "\n", list(), " ", list(list("lang_fn()")), #> " => ", list(list("call_fn()")), "\n", list(), #> " ", list(list("lang_name()")), " => ", list( #> list("call_name()")), "\n", list(), " ", #> list(list("lang_args()")), " => ", list(list( #> "call_args()")), "\n", list(), " ", list( #> list("lang_args_names()")), " => ", list( #> list("call_args_names()")), "\n", list(), #> " ", list(list("lang_head()")), ", ", list( #> list("lang_tail()")), "\n", list(), " ", #> list(list("lang()")), " => ", list(list("call2()")), #> "\n", list(), " ", list(list("new_language()")), #> " => ", list(list("new_call()")), "\n", list(), #> " ", list(list("is_lang()")), " => ", list( #> list("is_call()")), "\n", list(), " ", #> list(list("is_unary_lang()")), " => Use the ", #> list("n"), " argument of ", list(list("is_call()")), #> "\n", list(), " ", list(list("is_binary_lang()")), #> " => Use the ", list("n"), " argument of ", #> list(list("is_call()")), "\n", list(), " ", #> list(list("quo_is_lang()")), " => ", list( #> list("quo_is_call()")), "\n", list(), " ", #> list(list("call_modify()")), ": ", list(".standardise"), #> " and ", list(".env"), " arguments.\n", list(), #> " ", list(list("is_expr()")), " => ", list( #> list("is_expression()")), "\n", list(), #> " ", list("quo_expr()"), " => ", list(list( #> "quo_squash()")), "\n", list(), " ", list( #> list("parse_quosure()")), " => ", list( #> list("parse_quo()")), "\n", list(), " ", #> list(list("parse_quosures()")), " => ", list( #> list("parse_quos()")), "\n", list(), " Assigning non-quosure objects to quosure lists.\n", #> list(), " ", list("as.character()"), " on quosures.\n", #> list(), " ", list(list("cnd_signal()")), #> ": ", list(".cnd"), " => ", list("cnd"), #> "\n", list(), " ", list(list("cnd_signal()")), #> ": The ", list(".mufflable"), " argument no longer has any effect\n", #> list(), " ", list("scoped_names()"), " => ", #> list(list("base::search()")), "\n", list(), #> " ", list("is_scoped()"), " => ", list(list( #> "is_attached()")), "\n", list(), " ", list( #> "scoped_env()"), " => ", list(list("search_env()")), #> "\n", list(), " ", list("scoped_envs()"), #> " => ", list(list("search_envs()")), "\n", #> list(), " ", list("env_bind_exprs()"), " => ", #> list(list("env_bind_lazy()")), "\n", list(), #> " ", list("env_bind_fns()"), " => ", list( #> list("env_bind_active()")), "\n", list(), #> " Passing a function or formula to ", list( #> "env_depth()"), ",\n", list("env_poke_parent()"), #> ", ", list("env_parent<-"), ", ", list("env_tail()"), #> ", ", list("set_env()"), ",\n", list("env_clone()"), #> ", ", list("env_inherits()"), ", ", list( #> "env_bind()"), ",\n", list("scoped_bindings()"), #> ", ", list("with_bindings()"), ", ", list( #> "env_poke()"), ",\n", list("env_has()"), #> ", ", list("env_get()"), ", ", list("env_names()"), #> ", ", list("env_bind_exprs()"), " and\n", #> list("env_bind_fns()"), ". This internal genericity was causing confusion\n", #> "(see issue #427). You should now extract the environment\n", #> "separately before calling these functions.\n", #> list(), " ", list(list("get_env()")), ": The ", #> list("env"), " argument no longer has a default and must be supplied\n", #> list(), " ", list(list("is_frame()")), ", ", #> list(list("global_frame()")), ", ", list( #> list("current_frame()")), ",\n", list(list( #> "ctxt_frame()")), ", ", list(list("call_frame()")), #> ", ", list(list("frame_position()")), ",\n", #> list(list("caller_frame()")), "\n", list(), #> " ", list(list("ctxt_depth()")), ", ", list( #> list("call_depth()")), ", ", list(list( #> "ctxt_stack()")), ", ", list(list("call_stack()")), #> ",\n", list(list("stack_trim()")), "\n", #> list(), " ", list(list("set_attrs()")), ", ", #> list(list("mut_attrs()")), "\n", list(), #> " The ", list("width"), " and ", list("printer"), #> " arguments of ", list(list("exprs_auto_name()")), #> " and\n", list(list("quos_auto_name()")), #> " no longer have any effect. For the same\n", #> "reason, passing a width as ", list(".named"), #> " argument of dots collectors\n", "like ", #> list("quos()"), " is deprecated.\n", list(), #> " ", list("as_overscope()"), " => ", list( #> list("as_data_mask()")), "\n", list(), #> " ", list("new_overscope()"), " => ", list( #> list("new_data_mask()")), "\n", list(), #> " ", list("overscope_eval_next()"), " => ", #> list(list("eval_tidy()")), "\n", list(), #> " ", list("overscope_clean()"), "\n"), "\n")), #> "\n", "\n", list(list("Defunct functions and arguments"), #> list("\n", "\n", "\n", list("rlang:::lifecycle(\"defunct\")"), #> "\n", "\n", list("Defunct as of rlang 0.4.0"), #> "\n", list("\n", list(), " ", list("length()"), #> " and ", list("names()"), " on tidy eval ", #> list(".data"), " pronouns.\n", list(), " Supplying a named ", #> list("!!!"), " call.\n", list(), " ", list( #> list("as_data_mask()")), ": ", list("parent"), #> " argument\n", list(), " ", list(list("new_data_mask()")), #> ": ", list("parent"), " argument\n", list(), #> " ", list(list("env_tail()")), ": ", list( #> "sentinel"), " => ", list("last"), "\n", #> list(), " ", list(list("abort()")), ", ", #> list(list("warn()")), ", ", list(list("inform()")), #> ": ", list("msg"), ", ", list("type"), " => ", #> list(".msg"), ", ", list(".type"), "\n", #> list(), " ", list(list("abort()")), ", ", #> list(list("warn()")), ", ", list(list("inform()")), #> ", ", list(list("cnd()")), ", ", list(list( #> "error_cnd()")), ",\n", list(list("warning_cnd()")), #> ", ", list(list("message_cnd()")), ": ", #> list("call"), " argument.\n", list(), " ", #> list(list("is_character()")), ", ", list( #> list("is_string()")), ", and variants: The ", #> list("encoding"), "\n", "argument.\n"), "\n")), #> "\n", "\n", list(list("Archived"), list("\n", "\n", #> "\n", list("rlang:::lifecycle(\"archived\")"), #> "\n", "\n", "These functions were entirely removed from the package. You will\n", #> "find them in the commit history and previous releases.\n", #> "\n", list("Archived as of rlang 0.4.0"), "\n", #> list("\n", list(), " ", list("UQE()"), "\n", #> list(), " ", list("as_dictionary()"), ", ", #> list("is_dictionary()"), "\n", list(), " ", #> list("as_quosureish()"), ", ", list("is_quosureish()"), #> "\n", list(), " ", list("eval_tidy_()"), "\n", #> list(), " ", list("mut_utf8_locale()"), ", ", #> list("mut_latin1_locale()"), ", ", list("mut_mbcs_locale()"), #> "\n", list(), " ", list("set_chr_encoding()"), #> ", ", list("chr_encoding()"), ", ", list("set_str_encoding()"), #> ", ", list("str_encoding()"), "\n", list(), #> " ", list("as_native_character()"), ", ", list( #> "as_utf8_string()"), ", ", list("as_native_string()"), #> "\n", list(), " ", list("lang_type_of()"), #> ", ", list("switch_lang()"), ", ", list("coerce_lang()"), #> "\n"), "\n", "\n", list("Archived as of rlang 0.3.0:"), #> "\n", list("\n", list(), " ", list("cnd_inform()"), #> ", ", list("cnd_warn()"), " and ", list("cnd_abort()"), #> "\n", list(), " ", list("new_cnd()"), " => ", #> list(list("cnd()")), "\n", list(), " ", list( #> "cnd_message()"), " => ", list(list("message_cnd()")), #> "\n", list(), " ", list("cnd_warning()"), " => ", #> list(list("warning_cnd()")), "\n", list(), #> " ", list("cnd_error()"), " => ", list(list( #> "error_cnd()")), "\n", list(), " ", list( #> "rst_muffle()"), " => ", list(list("cnd_muffle()")), #> "\n", list(), " ", list("inplace()"), " => ", #> list(list("calling()")), ". The ", list("muffle"), #> " argument of ", list("inplace()"), "\n", "has not been implemented in ", #> list("calling()"), " and is now defunct.\n", #> list(), " ", list(list("cnd_signal()")), ": ", #> list(".msg"), " and ", list(".call"), ".\n", #> list(), " ", list(list("cnd()")), ", ", list( #> list("error_cnd()")), ", ", list(list("warning_cnd()")), #> " and ", list(list("message_cnd()")), ":\n", #> list(".msg"), " => ", list("message"), ".\n"), #> "\n")), "\n", "\n"), missing.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/vec-na.R", #> "\n", list("data"), "\n", list("missing"), "\n", #> list("missing"), "\n", list("na_lgl"), "\n", list( #> "na_int"), "\n", list("na_dbl"), "\n", list("na_chr"), #> "\n", list("na_cpl"), "\n", list("Missing values"), #> "\n", list("An object of class ", list("logical"), #> " of length 1."), "\n", list("\n", "na_lgl\n", #> "\n", "na_int\n", "\n", "na_dbl\n", "\n", "na_chr\n", #> "\n", "na_cpl\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "Missing values are represented in R with the general symbol\n", #> list("NA"), ". They can be inserted in almost all data containers: all\n", #> "atomic vectors except raw vectors can contain missing values. To\n", #> "achieve this, R automatically converts the general ", #> list("NA"), " symbol to a\n", "typed missing value appropriate for the target vector. The objects\n", #> "provided here are aliases for those typed ", #> list("NA"), " objects.\n"), "\n", list("\n", #> "Typed missing values are necessary because R needs sentinel values\n", #> "of the same type (i.e. the same machine representation of the data)\n", #> "as the containers into which they are inserted. The official typed\n", #> "missing values are ", list("NA_integer_"), ", ", #> list("NA_real_"), ", ", list("NA_character_"), #> " and\n", list("NA_complex_"), ". The missing value for logical vectors is simply the\n", #> "default ", list("NA"), ". The aliases provided in rlang are consistently named\n", #> "and thus simpler to remember. Also, ", list( #> "na_lgl"), " is provided as an\n", "alias to ", #> list("NA"), " that makes intent clearer.\n", #> "\n", "Since ", list("na_lgl"), " is the default ", #> list("NA"), ", expressions such as ", list("c(NA, NA)"), #> "\n", "yield logical vectors as no data is available to give a clue of the\n", #> "target type. In the same way, since lists and environments can\n", #> "contain any types, expressions like ", list( #> "list(NA)"), " store a logical\n", list("NA"), #> ".\n"), "\n", list(list("Life cycle"), list("\n", #> "\n", "\n", "These shortcuts might be moved to the vctrs package at some\n", #> "point. This is why they are marked as questioning.\n")), #> "\n", "\n", list("\n", "typeof(NA)\n", "typeof(na_lgl)\n", #> "typeof(na_int)\n", "\n", "# Note that while the base R missing symbols cannot be overwritten,\n", #> "# that's not the case for rlang's aliases:\n", #> "na_dbl <- NA\n", "typeof(na_dbl)\n"), "\n", #> list("datasets"), "\n"), missing_arg.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/arg.R", "\n", #> list("missing_arg"), "\n", list("missing_arg"), "\n", #> list("is_missing"), "\n", list("maybe_missing"), #> "\n", list("Generate or handle a missing argument"), #> "\n", list("\n", "missing_arg()\n", "\n", "is_missing(x)\n", #> "\n", "maybe_missing(x, default = missing_arg())\n"), #> "\n", list("\n", list(list("x"), list("An object that might be the missing argument.")), #> "\n", "\n", list(list("default"), list("The object to return if the input is missing,\n", #> "defaults to ", list("missing_arg()"), ".")), #> "\n"), "\n", list("\n", "These functions help using the missing argument as a regular R\n", #> "object.\n", list("\n", list(), " ", list("missing_arg()"), #> " generates a missing argument.\n", list(), #> " ", list("is_missing()"), " is like ", list( #> list("base::missing()")), " but also supports\n", #> "testing for missing arguments contained in other objects like\n", #> "lists.\n", list(), " ", list("maybe_missing()"), #> " is useful to pass down an input that might be\n", #> "missing to another function, potentially substituting by a\n", #> "default value. It avoids triggering an \"argument is missing\" error.\n"), #> "\n"), "\n", list(list("Other ways to reify the missing argument"), #> list("\n", "\n", list("\n", list(), " ", list( #> "base::quote(expr = )"), " is the canonical way to create a missing\n", #> "argument object.\n", list(), " ", list("expr()"), #> " called without argument creates a missing argument.\n", #> list(), " ", list("quo()"), " called without argument creates an empty quosure, i.e. a\n", #> "quosure containing the missing argument object.\n"), #> "\n")), "\n", "\n", list(list("Fragility of the missing argument object"), #> list("\n", "\n", "\n", "The missing argument is an object that triggers an error if and\n", #> "only if it is the result of evaluating a symbol. No error is\n", #> "produced when a function call evaluates to the missing argument\n", #> "object. This means that expressions like ", #> list("x[[1]] <- missing_arg()"), "\n", "are perfectly safe. Likewise, ", #> list("x[[1]]"), " is safe even if the result\n", #> "is the missing object.\n", "\n", "However, as soon as the missing argument is passed down between\n", #> "functions through an argument, you're at risk of triggering a\n", #> "missing error. This is because arguments are passed through\n", #> "symbols. To work around this, ", list("is_missing()"), #> " and ", list("maybe_missing(x)"), "\n", "use a bit of magic to determine if the input is the missing\n", #> "argument without triggering a missing error.\n", #> "\n", list("maybe_missing()"), " is particularly useful for prototyping\n", #> "meta-programming algorithms in R. The missing argument is a likely\n", #> "input when computing on the language because it is a standard\n", #> "object in formals lists. While C functions are always allowed to\n", #> "return the missing argument and pass it to other C functions, this\n", #> "is not the case on the R side. If you're implementing your\n", #> "meta-programming algorithm in R, use ", list( #> "maybe_missing()"), " when an\n", "input might be the missing argument object.\n")), #> "\n", "\n", list(list("Life cycle"), list("\n", "\n", #> list("\n", list(), " ", list("missing_arg()"), #> " and ", list("is_missing()"), " are stable.\n", #> list(), " Like the rest of rlang, ", list("maybe_missing()"), #> " is maturing.\n"), "\n")), "\n", "\n", list( #> "\n", "# The missing argument usually arises inside a function when the\n", #> "# user omits an argument that does not have a default:\n", #> "fn <- function(x) is_missing(x)\n", "fn()\n", #> "\n", "# Creating a missing argument can also be useful to generate calls\n", #> "args <- list(1, missing_arg(), 3, missing_arg())\n", #> "quo(fn(!!! args))\n", "\n", "# Other ways to create that object include:\n", #> "quote(expr = )\n", "expr()\n", "\n", "# It is perfectly valid to generate and assign the missing\n", #> "# argument in a list.\n", "x <- missing_arg()\n", #> "l <- list(missing_arg())\n", "\n", "# Just don't evaluate a symbol that contains the empty argument.\n", #> "# Evaluating the object `x` that we created above would trigger an\n", #> "# error.\n", "# x # Not run\n", "\n", "# On the other hand accessing a missing argument contained in a\n", #> "# list does not trigger an error because subsetting is a function\n", #> "# call:\n", "l[[1]]\n", "is.null(l[[1]])\n", #> "\n", "# In case you really need to access a symbol that might contain the\n", #> "# empty argument object, use maybe_missing():\n", #> "maybe_missing(x)\n", "is.null(maybe_missing(x))\n", #> "is_missing(maybe_missing(x))\n", "\n", "\n", #> "# Note that base::missing() only works on symbols and does not\n", #> "# support complex expressions. For this reason the following lines\n", #> "# would throw an error:\n", "\n", "#> missing(missing_arg())\n", #> "#> missing(l[[1]])\n", "\n", "# while is_missing() will work as expected:\n", #> "is_missing(missing_arg())\n", "is_missing(l[[1]])\n"), #> "\n"), mut_node_car.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("mut_node_car"), "\n", list("mut_node_car"), #> "\n", list("mut_node_cdr"), "\n", list("mut_node_caar"), #> "\n", list("mut_node_cadr"), "\n", list("mut_node_cdar"), #> "\n", list("mut_node_cddr"), "\n", list("mut_node_tag"), #> "\n", list("Mutate node components"), "\n", list( #> "\n", "mut_node_car(x, newcar)\n", "\n", "mut_node_cdr(x, newcdr)\n", #> "\n", "mut_node_caar(x, newcar)\n", "\n", "mut_node_cadr(x, newcar)\n", #> "\n", "mut_node_cdar(x, newcdr)\n", "\n", "mut_node_cddr(x, newcdr)\n", #> "\n", "mut_node_tag(x, newtag)\n"), "\n", list( #> "\n", list(list("x"), list("A language or pairlist node. Note that these functions are\n", #> "barebones and do not perform any type checking.")), #> "\n", "\n", list(list("newcar"), list("The new CAR or CDR for the node. These\n", #> "can be any R objects.")), "\n", "\n", list( #> list("newcdr"), list("The new CAR or CDR for the node. These\n", #> "can be any R objects.")), "\n", "\n", list( #> list("newtag"), list("The new tag for the node. This should be a symbol.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions were deprecated and renamed with ", #> list("node_poke_"), "\n", "prefix in rlang 0.2.0. This change follows a new naming convention\n", #> "where mutation is referred to as \"poking\".\n"), #> "\n", list("internal"), "\n"), names2.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/attr.R", #> "\n", list("names2"), "\n", list("names2"), "\n", #> list("Get names of a vector"), "\n", list("\n", "names2(x)\n"), #> "\n", list("\n", list(list("x"), list("A vector.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", "This names getter always returns a character vector, even when an\n", #> "object does not have a ", list("names"), " attribute. In this case, it returns\n", #> "a vector of empty names ", list("\"\""), ". It also standardises missing names to\n", #> list("\"\""), ".\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", list("names2()"), " is stable.\n")), #> "\n", "\n", list("\n", "names2(letters)\n", "\n", #> "# It also takes care of standardising missing names:\n", #> "x <- set_names(1:3, c(\"a\", NA, \"b\"))\n", #> "names2(x)\n"), "\n"), `new-vector-along-retired.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("new-vector-along-retired"), "\n", list( #> "new-vector-along-retired"), "\n", list("new_logical_along"), #> "\n", list("new_integer_along"), "\n", list("new_double_along"), #> "\n", list("new_character_along"), "\n", list("new_complex_along"), #> "\n", list("new_raw_along"), "\n", list("new_list_along"), #> "\n", list("Create vectors matching the length of a given vector"), #> "\n", list("\n", "new_logical_along(x, names = base::names(x))\n", #> "\n", "new_integer_along(x, names = base::names(x))\n", #> "\n", "new_double_along(x, names = base::names(x))\n", #> "\n", "new_character_along(x, names = base::names(x))\n", #> "\n", "new_complex_along(x, names = base::names(x))\n", #> "\n", "new_raw_along(x, names = base::names(x))\n", #> "\n", "new_list_along(x, names = base::names(x))\n"), #> "\n", list("\n", list(list("x"), list("A vector.")), #> "\n", "\n", list(list("names"), list("Names for the new vector.")), #> "\n"), "\n", list("\n", "These functions are deprecated as of rlang 0.3.0 because they\n", #> "are longer to type than the equivalent ", list( #> list("rep_along()")), " or\n", list(list("rep_named()")), #> " calls without added clarity.\n"), "\n"), `new-vector.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/vec-new.R", "\n", #> list("new-vector"), "\n", list("new-vector"), "\n", #> list("new_logical"), "\n", list("new_integer"), "\n", #> list("new_double"), "\n", list("new_character"), #> "\n", list("new_complex"), "\n", list("new_raw"), #> "\n", list("new_list"), "\n", list("Create vectors matching a given length"), #> "\n", list("\n", "new_logical(n, names = NULL)\n", #> "\n", "new_integer(n, names = NULL)\n", "\n", #> "new_double(n, names = NULL)\n", "\n", "new_character(n, names = NULL)\n", #> "\n", "new_complex(n, names = NULL)\n", "\n", #> "new_raw(n, names = NULL)\n", "\n", "new_list(n, names = NULL)\n"), #> "\n", list("\n", list(list("n"), list("The vector length.")), #> "\n", "\n", list(list("names"), list("Names for the new vector.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", "These functions construct vectors of a given length, with attributes\n", #> "specified via dots. Except for ", list("new_list()"), #> " and ", list("new_raw()"), ", the\n", "empty vectors are filled with typed ", #> list("missing"), " values. This is in\n", "contrast to the base function ", #> list(list("base::vector()")), " which creates\n", #> "zero-filled vectors.\n"), "\n", list(list("Lifecycle"), #> list("\n", "\n", "\n", "These functions are likely to be replaced by a vctrs equivalent in\n", #> "the future. They are in the questioning lifecycle stage.\n")), #> "\n", "\n", list("\n", "new_list(10)\n", "new_logical(10)\n"), #> "\n", list("\n", "rep_along\n"), "\n"), new_call.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/node.R", "\n", #> list("new_call"), "\n", list("new_call"), "\n", list( #> "Create a new call from components"), "\n", list( #> "\n", "new_call(car, cdr = NULL)\n"), "\n", list( #> "\n", list(list("car"), list("The head of the call. It should be a\n", #> list("callable"), " object: a symbol, call, or literal\n", #> "function.")), "\n", "\n", list(list("cdr"), #> list("The tail of the call, i.e. a ", list( #> "node list"), " of\n", "arguments.")), "\n"), #> "\n", list("\n", "Create a new call from components\n"), #> "\n", list("internal"), "\n"), new_formula.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/formula.R", "\n", #> list("new_formula"), "\n", list("new_formula"), "\n", #> list("Create a formula"), "\n", list("\n", "new_formula(lhs, rhs, env = caller_env())\n"), #> "\n", list("\n", list(list("lhs, rhs"), list("A call, name, or atomic vector.")), #> "\n", "\n", list(list("env"), list("An environment.")), #> "\n"), "\n", list("\n", "A formula object.\n"), #> "\n", list("\n", "Create a formula\n"), "\n", list( #> "\n", "new_formula(quote(a), quote(b))\n", "new_formula(NULL, quote(b))\n"), #> "\n", list("\n", list(list("new_quosure()")), "\n"), #> "\n"), new_function.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/fn.R", "\n", #> list("new_function"), "\n", list("new_function"), #> "\n", list("Create a function"), "\n", list("\n", #> "new_function(args, body, env = caller_env())\n"), #> "\n", list("\n", list(list("args"), list("A named list or pairlist of default arguments. Note\n", #> "that if you want arguments that don't have defaults, you'll need\n", #> "to use the special function ", list(list("pairlist2()")), #> ". If you need quoted\n", "defaults, use ", list( #> list("exprs()")), ".")), "\n", "\n", list(list( #> "body"), list("A language object representing the code inside the\n", #> "function. Usually this will be most easily generated with\n", #> list(list("base::quote()")))), "\n", "\n", list( #> list("env"), list("The parent environment of the function, defaults to the\n", #> "calling environment of ", list("new_function()"))), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"stable\")"), #> "\n", "\n", "This constructs a new function given its three components:\n", #> "list of arguments, body code and parent environment.\n"), #> "\n", list("\n", "f <- function() letters\n", "g <- new_function(NULL, quote(letters))\n", #> "identical(f, g)\n", "\n", "# Pass a list or pairlist of named arguments to create a function\n", #> "# with parameters. The name becomes the parameter name and the\n", #> "# argument the default value for this parameter:\n", #> "new_function(list(x = 10), quote(x))\n", "new_function(pairlist2(x = 10), quote(x))\n", #> "\n", "# Use `exprs()` to create quoted defaults. Compare:\n", #> "new_function(pairlist2(x = 5 + 5), quote(x))\n", #> "new_function(exprs(x = 5 + 5), quote(x))\n", #> "\n", "# Pass empty arguments to omit defaults. `list()` doesn't allow\n", #> "# empty arguments but `pairlist2()` does:\n", #> "new_function(pairlist2(x = , y = 5 + 5), quote(x + y))\n", #> "new_function(exprs(x = , y = 5 + 5), quote(x + y))\n"), #> "\n"), new_node.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/node.R", #> "\n", list("new_node"), "\n", list("new_node"), "\n", #> list("node_car"), "\n", list("node_cdr"), "\n", list( #> "node_caar"), "\n", list("node_cadr"), "\n", #> list("node_cdar"), "\n", list("node_cddr"), "\n", #> list("node_poke_car"), "\n", list("node_poke_cdr"), #> "\n", list("node_poke_caar"), "\n", list("node_poke_cadr"), #> "\n", list("node_poke_cdar"), "\n", list("node_poke_cddr"), #> "\n", list("node_tag"), "\n", list("node_poke_tag"), #> "\n", list("Helpers for pairlist and language nodes"), #> "\n", list("\n", "new_node(car, cdr = NULL)\n", "\n", #> "node_car(x)\n", "\n", "node_cdr(x)\n", "\n", #> "node_caar(x)\n", "\n", "node_cadr(x)\n", "\n", #> "node_cdar(x)\n", "\n", "node_cddr(x)\n", "\n", #> "node_poke_car(x, newcar)\n", "\n", "node_poke_cdr(x, newcdr)\n", #> "\n", "node_poke_caar(x, newcar)\n", "\n", "node_poke_cadr(x, newcar)\n", #> "\n", "node_poke_cdar(x, newcdr)\n", "\n", "node_poke_cddr(x, newcdr)\n", #> "\n", "node_tag(x)\n", "\n", "node_poke_tag(x, newtag)\n"), #> "\n", list("\n", list(list("car, newcar, cdr, newcdr"), #> list("The new CAR or CDR for the node. These\n", #> "can be any R objects.")), "\n", "\n", list( #> list("x"), list("A language or pairlist node. Note that these functions are\n", #> "barebones and do not perform any type checking.")), #> "\n", "\n", list(list("newtag"), list("The new tag for the node. This should be a symbol.")), #> "\n"), "\n", list("\n", "Setters like ", list( #> "node_poke_car()"), " invisibly return ", list( #> "x"), " modified\n", "in place. Getters return the requested node component.\n"), #> "\n", list("\n", list("Important"), ": These functions are for expert R programmers only.\n", #> "You should only use them if you feel comfortable manipulating low\n", #> "level R data structures at the C level. We export them at the R level\n", #> "in order to make it easy to prototype C code. They don't perform\n", #> "any type checking and can crash R very easily (try to take the CAR\n", #> "of an integer vector --- save any important objects beforehand!).\n"), #> "\n", list("\n", list(list("duplicate()")), " for creating copy-safe objects and\n", #> list(list("base::pairlist()")), " for an easier way of creating a linked list of\n", #> "nodes.\n"), "\n", list("internal"), "\n"), new_quosures.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "new_quosures"), "\n", list("new_quosures"), #> "\n", list("as_quosures"), "\n", list("is_quosures"), #> "\n", list("Create a list of quosures"), "\n", list( #> "\n", "new_quosures(x)\n", "\n", "as_quosures(x, env, named = FALSE)\n", #> "\n", "is_quosures(x)\n"), "\n", list("\n", list( #> list("x"), list("A list of quosures or objects to coerce to quosures.")), #> "\n", "\n", list(list("env"), list("The default environment for the new quosures.")), #> "\n", "\n", list(list("named"), list("Whether to name the list with ", #> list(list("quos_auto_name()")), ".")), "\n"), #> "\n", list("\n", "This small S3 class provides methods for ", #> list("["), " and ", list("c()"), " and ensures\n", #> "the following invariants:\n", list("\n", list(), #> " The list only contains quosures.\n", list(), #> " It is always named, possibly with a vector of empty strings.\n"), #> "\n", "\n", list("new_quosures()"), " takes a list of quosures and adds the ", #> list("quosures"), "\n", "class and a vector of empty names if needed. ", #> list("as_quosures()"), " calls\n", list(list( #> "as_quosure()")), " on all elements before creating the ", #> list("quosures"), "\n", "object.\n"), "\n"), #> new_weakref.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/weakref.R", #> "\n", list("new_weakref"), "\n", list("new_weakref"), #> "\n", list("Create a weak reference"), "\n", list( #> "\n", "new_weakref(key, value = NULL, finalizer = NULL, on_quit = FALSE)\n"), #> "\n", list("\n", list(list("key"), list("The key for the weak reference. Must be a reference object -- that\n", #> "is, an environment or external pointer.")), #> "\n", "\n", list(list("value"), list("The value for the weak reference. This can be ", #> list("NULL"), ", if you\n", "want to use the weak reference like a weak pointer.")), #> "\n", "\n", list(list("finalizer"), list("A function that is run after the key becomes unreachable.")), #> "\n", "\n", list(list("on_quit"), list("Should the finalizer be run when R exits?")), #> "\n"), "\n", list("\n", "A weak reference is a special R object which makes it possible to keep a\n", #> "reference to an object without preventing garbage collection of that object.\n", #> "It can also be used to keep data about an object without preventing GC of the\n", #> "object, similar to WeakMaps in JavaScript.\n", #> "\n", "Objects in R are considered ", list("reachable"), #> " if they can be accessed by following\n", "a chain of references, starting from a ", #> list("root node"), "; root nodes are\n", "specially-designated R objects, and include the global environment and base\n", #> "environment. As long as the key is reachable, the value will not be garbage\n", #> "collected. This is true even if the weak reference object becomes\n", #> "unreachable. The key effectively prevents the weak reference and its value\n", #> "from being collected, according to the following chain of ownership:\n", #> list("weakref <- key -> value"), ".\n", "\n", #> "When the key becomes unreachable, the key and value in the weak reference\n", #> "object are replaced by ", list("NULL"), ", and the finalizer is scheduled to execute.\n"), #> "\n", list("\n", "e <- env()\n", "\n", "# Create a weak reference to e\n", #> "w <- new_weakref(e, finalizer = function(e) message(\"finalized\"))\n", #> "\n", "# Get the key object from the weak reference\n", #> "identical(wref_key(w), e)\n", "\n", "# When the regular reference (the `e` binding) is removed and a GC occurs,\n", #> "# the weak reference will not keep the object alive.\n", #> "rm(e)\n", "gc()\n", "identical(wref_key(w), NULL)\n", #> "\n", "\n", "# A weak reference with a key and value. The value contains data about the\n", #> "# key.\n", "k <- env()\n", "v <- list(1, 2, 3)\n", #> "w <- new_weakref(k, v)\n", "\n", "identical(wref_key(w), k)\n", #> "identical(wref_value(w), v)\n", "\n", "# When v is removed, the weak ref keeps it alive because k is still reachable.\n", #> "rm(v)\n", "gc()\n", "identical(wref_value(w), list(1, 2, 3))\n", #> "\n", "# When k is removed, the weak ref does not keep k or v alive.\n", #> "rm(k)\n", "gc()\n", "identical(wref_key(w), NULL)\n", #> "identical(wref_value(w), NULL)\n"), "\n", list( #> "\n", list(list("is_weakref()")), ", ", list( #> list("wref_key()")), " and ", list(list("wref_value()")), #> ".\n"), "\n", list("experimental"), "\n"), ns_env.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/env-special.R", #> "\n", list("ns_env"), "\n", list("ns_env"), "\n", #> list("ns_imports_env"), "\n", list("ns_env_name"), #> "\n", list("Get the namespace of a package"), "\n", #> list("\n", "ns_env(x = caller_env())\n", "\n", "ns_imports_env(x = caller_env())\n", #> "\n", "ns_env_name(x = caller_env())\n"), "\n", #> list("\n", list(list("x"), list(list("\n", list(), #> " For ", list("ns_env()"), ", the name of a package or an environment as a\n", #> "string.\n", list("\n", list(), " An environment (the current environment by default).\n", #> list(), " A function.\n"), "\n", "\n", "In the latter two cases, the environment ancestry is searched for\n", #> "a namespace with ", list(list("base::topenv()")), #> ". If the environment doesn't\n", "inherit from a namespace, this is an error.\n"))), #> "\n", "\n", list(list("env"), list("A namespace environment.")), #> "\n"), "\n", list("\n", "Namespaces are the environment where all the functions of a package\n", #> "live. The parent environments of namespaces are the ", #> list("imports"), "\n", "environments, which contain all the functions imported from other\n", #> "packages.\n"), "\n", list(list("Life cycle"), #> list("\n", "\n", "\n", "These functions are experimental and may not belong to the rlang\n", #> "package. Expect API changes.\n")), "\n", "\n", #> list("\n", list(list("pkg_env()")), "\n"), "\n", #> list("internal"), "\n"), `op-definition.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/operators.R", "\n", #> list("op-definition"), "\n", list("op-definition"), #> "\n", list("is_definition"), "\n", list("new_definition"), #> "\n", list("is_formulaish"), "\n", list("Definition operator"), #> "\n", list("\n", "is_definition(x)\n", "\n", "new_definition(lhs, rhs, env = caller_env())\n", #> "\n", "is_formulaish(x, scoped = NULL, lhs = NULL)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("lhs, rhs"), list("Expressions for the LHS and RHS of the definition.")), #> "\n", "\n", list(list("env"), list("The evaluation environment bundled with the definition.")), #> "\n"), "\n", list("\n", "The definition operator is typically used in DSL packages like\n", #> list("ggvis"), " and ", list("data.table"), ". It is also used in the tidyverse as a way\n", #> "of unquoting names (see ", list("quasiquotation"), #> ").\n", list("\n", list(), " ", list("is_definition()"), #> " returns ", list("TRUE"), " for calls to ", #> list(":="), ".\n", list(), " ", list("is_formulaish()"), #> " returns ", list("TRUE"), " for both formulas and\n", #> "colon-equals operators.\n"), "\n"), "\n", #> list("\n", "The recommended way to use it is to capture arguments as\n", #> "expressions or quosures. You can then give a special function\n", #> "definition for the ", list(":="), " symbol in an overscope. Note that if you\n", #> "capture dots with ", list(list("exprs()")), #> " or ", list(list("quos()")), ", you need to disable\n", #> "interpretation of ", list(":="), " by setting ", #> list(".unquote_names"), " to ", list("FALSE"), #> ".\n", "\n", "From rlang and data.table perspectives, this operator is not meant\n", #> "to be evaluated directly at top-level which is why the exported\n", #> "definitions issue an error.\n"), "\n", list( #> list("Life cycle"), list("\n", "\n", "\n", "These functions are experimental.\n")), #> "\n", "\n", list("\n", "\n", "# A predicate is provided to distinguish formulas from the\n", #> "# colon-equals operator:\n", "is_definition(quote(a := b))\n", #> "is_definition(a ~ b)\n", "\n", "\n", "# is_formulaish() tests for both definitions and formulas:\n", #> "is_formulaish(a ~ b)\n", "is_formulaish(quote(a := b))\n"), #> "\n", list("internal"), "\n"), `op-get-attr.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/operators.R", "\n", #> list("op-get-attr"), "\n", list("op-get-attr"), "\n", #> list("%@%"), "\n", list("%@%<-"), "\n", list("Infix attribute accessor and setter"), #> "\n", list("\n", "x %@% name\n", "\n", "x %@% name <- value\n"), #> "\n", list("\n", list(list("x"), list("Object")), #> "\n", "\n", list(list("name"), list("Attribute name")), #> "\n", "\n", list(list("value"), list("New value for attribute ", #> list("name"), ".")), "\n"), "\n", list("\n", #> "This operator extracts or sets attributes for regular objects and\n", #> "S4 fields for S4 objects.\n"), "\n", list("\n", #> "# Unlike `@`, this operator extracts attributes for any kind of\n", #> "# objects:\n", "factor(1:3) %@% \"levels\"\n", #> "mtcars %@% class\n", "\n", "mtcars %@% class <- NULL\n", #> "mtcars\n", "\n", "# It also works on S4 objects:\n", #> ".Person <- setClass(\"Person\", slots = c(name = \"character\", species = \"character\"))\n", #> "fievel <- .Person(name = \"Fievel\", species = \"mouse\")\n", #> "fievel %@% name\n"), "\n"), `op-na-default.Rd` = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/operators.R", "\n", #> list("op-na-default"), "\n", list("op-na-default"), #> "\n", list("%|%"), "\n", list("Replace missing values"), #> "\n", list("\n", "x %|% y\n"), "\n", list("\n", list( #> list("x"), list("The original values.")), "\n", #> "\n", list(list("y"), list("The replacement values. Must be of length 1 or the same length as ", #> list("x"), ".")), "\n"), "\n", list("\n", "This infix function is similar to ", #> list("%||%"), " but is vectorised\n", "and provides a default value for missing elements. It is faster\n", #> "than using ", list(list("base::ifelse()")), #> " and does not perform type conversions.\n"), #> "\n", list("\n", "c(\"a\", \"b\", NA, \"c\") %|% \"default\"\n", #> "c(1L, NA, 3L, NA, NA) %|% (6L:10L)\n"), "\n", #> list("\n", list("op-null-default"), "\n"), "\n"), #> `op-null-default.Rd` = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/operators.R", #> "\n", list("op-null-default"), "\n", list("op-null-default"), #> "\n", list("%||%"), "\n", list("Default value for ", #> list("NULL")), "\n", list("\n", "x %||% y\n"), #> "\n", list("\n", list(list("x, y"), list("If ", list( #> "x"), " is NULL, will return ", list("y"), "; otherwise returns ", #> list("x"), ".")), "\n"), "\n", list("\n", "This infix function makes it easy to replace ", #> list("NULL"), "s with a default\n", "value. It's inspired by the way that Ruby's or operation (", #> list("||"), ")\n", "works.\n"), "\n", list("\n", #> "1 %||% 2\n", "NULL %||% 2\n"), "\n"), overscope_eval_next.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("overscope_eval_next"), "\n", list("overscope_eval_next"), #> "\n", list("Evaluate next quosure in a data mask"), #> "\n", list("\n", "overscope_eval_next(overscope, quo, env = base_env())\n"), #> "\n", list("\n", list(list("overscope"), list("A valid overscope containing bindings for ", #> list("~"), ",\n", list(".top_env"), " and ", #> list("_F"), " and whose parents contain overscoped bindings\n", #> "for tidy evaluation.")), "\n", "\n", list(list( #> "quo"), list("A quosure.")), "\n", "\n", list( #> list("env"), list("The lexical enclosure in case ", #> list("quo"), " is not a validly\n", "scoped quosure. This is the ", #> list("base environment"), " by\n", "default.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", list("overscope_eval_next()"), " is deprecated as of rlang 0.2.0. Please use\n", #> list("eval_tidy()"), " to which you can now supply an overscope.\n"), #> "\n", list("internal"), "\n"), pairlist2.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/call.R", "\n", #> list("pairlist2"), "\n", list("pairlist2"), "\n", #> list("Create pairlists with splicing support"), "\n", #> list("\n", "pairlist2(...)\n"), "\n", list("\n", #> list(list("..."), list("Arguments stored in the pairlist. Empty arguments are\n", #> "preserved.")), "\n"), "\n", list("\n", "This pairlist constructor supports ", #> list("tidy dots"), " features\n", "like ", list( #> "!!!"), ". Use it to manually create argument lists for calls or\n", #> "parameter lists for functions.\n"), "\n", list( #> "\n", "# Unlike `exprs()`, `pairlist2()` evaluates its arguments.\n", #> "new_function(pairlist2(x = 1, y = 3 * 6), quote(x * y))\n", #> "new_function(exprs(x = 1, y = 3 * 6), quote(x * y))\n", #> "\n", "# It preserves missing arguments, which is useful for creating\n", #> "# parameters without defaults:\n", "new_function(pairlist2(x = , y = 3 * 6), quote(x * y))\n"), #> "\n"), parse_expr.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/parse.R", #> "\n", list("parse_expr"), "\n", list("parse_expr"), #> "\n", list("parse_exprs"), "\n", list("parse_quo"), #> "\n", list("parse_quos"), "\n", list("Parse R code"), #> "\n", list("\n", "parse_expr(x)\n", "\n", "parse_exprs(x)\n", #> "\n", "parse_quo(x, env)\n", "\n", "parse_quos(x, env)\n"), #> "\n", list("\n", list(list("x"), list("Text containing expressions to parse_expr for\n", #> list("parse_expr()"), " and ", list("parse_exprs()"), #> ". Can also be an R connection,\n", "for instance to a file. If the supplied connection is not open,\n", #> "it will be automatically closed and destroyed.")), #> "\n", "\n", list(list("env"), list("The environment for the quosures. Depending on the use\n", #> "case, a good default might be the ", list( #> "global environment"), " but you might also want to evaluate the\n", #> "R code in an isolated context (perhaps a child of the global\n", #> "environment or of the ", list("base environment"), #> ").")), "\n"), "\n", list("\n", list("parse_expr()"), #> " returns an ", list("expression"), ",\n", list( #> "parse_exprs()"), " returns a list of expressions. Note that for the\n", #> "plural variants the length of the output may be greater than the\n", #> "length of the input. This would happen is one of the strings\n", #> "contain several expressions (such as ", list( #> "\"foo; bar\""), ").\n"), "\n", list("\n", #> "These functions parse and transform text into R expressions. This\n", #> "is the first step to interpret or evaluate a piece of R code\n", #> "written by a programmer.\n"), "\n", list("\n", #> list("parse_expr()"), " returns one expression. If the text contains more\n", #> "than one expression (separated by semicolons or new lines), an error is\n", #> "issued. On the other hand ", list("parse_exprs()"), #> " can handle multiple\n", "expressions. It always returns a list of expressions (compare to\n", #> list(list("base::parse()")), " which returns a base::expression vector). All\n", #> "functions also support R connections.\n", "\n", #> "The versions suffixed with ", list("_quo"), #> " and ", list("_quos"), " return\n", list("quosures"), #> " rather than raw expressions.\n"), "\n", list( #> list("Life cycle"), list("\n", "\n", list("\n", #> list(), " ", list("parse_quosure()"), " and ", #> list("parse_quosures()"), " were soft-deprecated in\n", #> "rlang 0.2.0 and renamed to ", list("parse_quo()"), #> " and ", list("parse_quos()"), ". This\n", #> "is consistent with the rule that abbreviated suffixes indicate\n", #> "the return type of a function.\n"), "\n")), #> "\n", "\n", list("\n", "# parse_expr() can parse any R expression:\n", #> "parse_expr(\"mtcars %>% dplyr::mutate(cyl_prime = cyl / sd(cyl))\")\n", #> "\n", "# A string can contain several expressions separated by ; or \\n\n", #> "parse_exprs(\"NULL; list()\\n foo(bar)\")\n", #> "\n", "# You can also parse source files by passing a R connection. Let's\n", #> "# create a file containing R code:\n", "path <- tempfile(\"my-file.R\")\n", #> "cat(\"1; 2; mtcars\", file = path)\n", "\n", #> "# We can now parse it by supplying a connection:\n", #> "parse_exprs(file(path))\n"), "\n", list("\n", #> list(list("base::parse()")), "\n"), "\n"), parse_quosure.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("parse_quosure"), "\n", list("parse_quosure"), #> "\n", list("parse_quosures"), "\n", list("Parse text into a quosure"), #> "\n", list("\n", "parse_quosure(x, env = caller_env())\n", #> "\n", "parse_quosures(x, env = caller_env())\n"), #> "\n", list("\n", list(list("x"), list("Text containing expressions to parse_expr for\n", #> list("parse_expr()"), " and ", list("parse_exprs()"), #> ". Can also be an R connection,\n", "for instance to a file. If the supplied connection is not open,\n", #> "it will be automatically closed and destroyed.")), #> "\n", "\n", list(list("env"), list("The environment for the quosures. Depending on the use\n", #> "case, a good default might be the ", list( #> "global environment"), " but you might also want to evaluate the\n", #> "R code in an isolated context (perhaps a child of the global\n", #> "environment or of the ", list("base environment"), #> ").")), "\n"), "\n", list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "These functions were deprecated and renamed to ", #> list(list("parse_quo()")), "\n", "and ", list( #> list("parse_quos()")), " in rlang 0.2.0. This is for consistency with the\n", #> "convention that suffixes indicating return types are not\n", #> "abbreviated.\n"), "\n", list("internal"), "\n"), #> prepend.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("prepend"), "\n", list("prepend"), "\n", #> list("modify"), "\n", list("Prepend a vector"), "\n", #> list("\n", "prepend(x, values, before = 1)\n", "\n", #> "modify(.x, ...)\n"), "\n", list("\n", list(list( #> "x"), list("the vector to be modified.")), "\n", #> "\n", list(list("values"), list("to be included in the modified vector.")), #> "\n", "\n", list(list("before"), list("a subscript, before which the values are to be appended.")), #> "\n", "\n", list(list(".x"), list("A vector to modify.")), #> "\n", "\n", list(list("..."), list("List of elements to merge into ", #> list(".x"), ". Named elements\n", "already existing in ", #> list(".x"), " are used as replacements. Elements that\n", #> "have new or no names are inserted at the end. These dots support\n", #> list("tidy dots"), " features.")), "\n"), "\n", #> list("\n", list("rlang:::lifecycle(\"deprecated\")"), #> "\n", "\n", "Vector functions are now out of scope for rlang. They might be\n", #> "revived in the vctrs or funs packages.\n"), #> "\n", list("internal"), "\n"), prim_name.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/fn.R", "\n", list( #> "prim_name"), "\n", list("prim_name"), "\n", #> list("Name of a primitive function"), "\n", list( #> "\n", "prim_name(prim)\n"), "\n", list("\n", #> list(list("prim"), list("A primitive function such as ", #> list(list("base::c()")), ".")), "\n"), "\n", #> list("\n", "Name of a primitive function\n"), "\n"), #> quasiquotation.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/quasiquotation.R", #> "\n", list("quasiquotation"), "\n", list("quasiquotation"), #> "\n", list("UQ"), "\n", list("UQS"), "\n", list("!!"), #> "\n", list("!!!"), "\n", list(":="), "\n", list("qq_show"), #> "\n", list("Quasiquotation of an expression"), "\n", #> list("\n", "qq_show(expr)\n"), "\n", list("\n", list( #> list("expr"), list("An expression to be quasiquoted.")), #> "\n"), "\n", list("\n", "Quasiquotation is the mechanism that makes it possible to program\n", #> "flexibly with tidy evaluation grammars like dplyr. It is enabled in\n", #> "all functions quoting their arguments with ", #> list("enquo()"), ", ", list("enexpr()"), ",\n", #> "or the plural variants.\n", "\n", "Quasiquotation is the combination of quoting an expression while\n", #> "allowing immediate evaluation (unquoting) of part of that\n", #> "expression. We provide both syntactic operators and functional\n", #> "forms for unquoting.\n", list("\n", list(), #> " The ", list("!!"), " operator unquotes its argument. It gets evaluated\n", #> "immediately in the surrounding context.\n", #> list(), " The ", list("!!!"), " operator unquotes and splices its argument. The\n", #> "argument should represent a list or a vector. Each element will\n", #> "be embedded in the surrounding call, i.e. each element is\n", #> "inserted as an argument. If the vector is named, the names are\n", #> "used as argument names.\n", "\n", "If the vector is a classed object (like a factor), it is\n", #> "converted to a list with ", list(list("base::as.list()")), #> " to ensure proper\n", "dispatch. If it is an S4 objects, it is converted to a list with\n", #> list(list("methods::as()")), ".\n", list(), #> " The ", list("{{ }}"), " operator quotes and unquotes its argument in one\n", #> "go, a pattern that we call ", list("interpolation"), #> ". It is an alias for\n", list("!!enquo(arg)"), #> ".\n", "\n", "Like ", list("enquo()"), ", ", #> list("{{ }}"), " is used in functions to capture an\n", #> "argument as a quoted expression. This expression is immediately\n", #> "unquoted in place.\n"), "\n", "\n", "Use ", #> list("qq_show()"), " to experiment with quasiquotation or debug the\n", #> "effect of unquoting operators. ", list("qq_show()"), #> " quotes its input,\n", "processes unquoted parts, and prints the result with\n", #> list(list("expr_print()")), ". This expression printer has a clearer output than\n", #> "the base R printer (see the ", list("documentation topic"), #> ").\n"), "\n", list(list("Unquoting names"), #> list("\n", "\n", "\n", "When a function takes multiple named arguments\n", #> "(e.g. ", list("dplyr::mutate()"), "), it is difficult to supply a variable as\n", #> "name. Since the LHS of ", list("="), " is quoted, giving the name of a variable\n", #> "results in the argument having the name of the variable rather than\n", #> "the name stored in that variable. This problem is right up the\n", #> "alley for the unquoting operator ", list("!!"), #> ". If you were able to unquote\n", "the variable when supplying the name, the argument would be named\n", #> "after the content of that variable.\n", "\n", #> "Unfortunately R is very strict about the kind of expressions\n", #> "supported on the LHS of ", list("="), ". This is why we have made the more\n", #> "flexible ", list(":="), " operator an alias of ", #> list("="), ". You can use it to supply\n", #> "names, e.g. ", list("a := b"), " is equivalent to ", #> list("a = b"), ". Since its syntax is\n", "more flexible you can unquote on the LHS:", #> list("name <- \"Jane\"\n", "\n", "list2(!!name := 1 + 2)\n", #> "exprs(!!name := 1 + 2)\n", "quos(!!name := 1 + 2)\n"), #> "\n", "\n", "Like ", list("="), ", the ", list( #> ":="), " operator expects strings or symbols on its LHS.\n", #> "\n", "Note that unquoting on the LHS of ", #> list(":="), " only works in top level\n", "expressions. These are all valid:", #> list("exprs(!!nm := x)\n", "tibble(!!nm := x)\n", #> "list2(!!nm := x)\n"), "\n", "\n", "But deep-unquoting names isn't supported:", #> list("expr(foo(!!nm := x))\n", "exprs(foo(!!nm := x))\n"), #> "\n")), "\n", "\n", list(list("Theory"), list( #> "\n", "\n", "\n", "Formally, ", list("quo()"), #> " and ", list("expr()"), " are quasiquote functions, ", #> list("!!"), " is\n", "the unquote operator, and ", #> list("!!!"), " is the unquote-splice operator.\n", #> "These terms have a rich history in Lisp languages, and live on in\n", #> "modern languages like\n", list(list("https://docs.julialang.org/en/v1/manual/metaprogramming/"), #> list("Julia")), "\n", "and\n", list(list("https://docs.racket-lang.org/reference/quasiquote.html"), #> list("Racket")), ".\n")), "\n", "\n", list( #> list("Life cycle"), list("\n", "\n", list("\n", #> list(), " Calling ", list("UQ()"), " and ", #> list("UQS()"), " with the rlang namespace qualifier is\n", #> "deprecated as of rlang 0.3.0. Just use the unqualified forms\n", #> "instead:", list("# Bad\n", "rlang::expr(mean(rlang::UQ(var) * 100))\n", #> "\n", "# Ok\n", "rlang::expr(mean(UQ(var) * 100))\n", #> "\n", "# Good\n", "rlang::expr(mean(!!var * 100))\n"), #> "\n", "\n", "Supporting namespace qualifiers complicates the implementation of\n", #> "unquotation and is misleading as to the nature of unquoting\n", #> "operators (which are syntactic operators that operates at\n", #> "quotation-time rather than function calls at evaluation-time).\n", #> list(), " ", list("UQ()"), " and ", list("UQS()"), #> " were soft-deprecated in rlang 0.2.0 in order\n", #> "to make the syntax of quasiquotation more consistent. The prefix\n", #> "forms are now ", list("`!!`()"), " and ", #> list("`!!!`()"), " which is\n", "consistent with other R operators (e.g. ", #> list("`+`(a, b)"), " is the\n", "prefix form of ", #> list("a + b"), ").\n", "\n", "Note that the prefix forms are not as relevant as before because\n", #> list("!!"), " now has the right operator precedence, i.e. the same as\n", #> "unary ", list("-"), " or ", list("+"), ". It is thus safe to mingle it with other\n", #> "operators, e.g. ", list("!!a + !!b"), " does the right thing. In addition the\n", #> "parser now strips one level of parentheses around unquoted\n", #> "expressions. This way ", list("(!!\"foo\")(...)"), #> " expands to ", list("foo(...)"), ".\n", "These changes make the prefix forms less useful.\n", #> "\n", "Finally, the named functional forms ", #> list("UQ()"), " and ", list("UQS()"), " were\n", #> "misleading because they suggested that existing knowledge about\n", #> "functions is applicable to quasiquotation. This was reinforced by\n", #> "the visible definitions of these functions exported by rlang and\n", #> "by the tidy eval parser interpreting ", list( #> "rlang::UQ()"), " as ", list("!!"), ". In\n", #> "reality unquoting is ", list("not"), " a function call, it is a syntactic\n", #> "operation. The operator form makes it clearer that unquoting is\n", #> "special.\n"), "\n")), "\n", "\n", list("\n", #> "# Interpolation with {{ }} is the easiest way to forward\n", #> "# arguments to tidy eval functions:\n", "if (is_attached(\"package:dplyr\")) {\n", #> "\n", "# Forward all arguments involving data frame columns by\n", #> "# interpolating them within other data masked arguments.\n", #> "# Here we interpolate `arg` in a `summarise()` call:\n", #> "my_function <- function(data, arg) {\n", " summarise(data, avg = mean({{ arg }}, na.rm = TRUE))\n", #> "}\n", "\n", "my_function(mtcars, cyl)\n", "my_function(mtcars, cyl * 10)\n", #> "\n", "# The operator is just a shortcut for `!!enquo()`:\n", #> "my_function <- function(data, arg) {\n", " summarise(data, avg = mean(!!enquo(arg), na.rm = TRUE))\n", #> "}\n", "\n", "my_function(mtcars, cyl)\n", "\n", #> "}\n", "\n", "# Quasiquotation functions quote expressions like base::quote()\n", #> "quote(how_many(this))\n", "expr(how_many(this))\n", #> "quo(how_many(this))\n", "\n", "# In addition, they support unquoting. Let's store symbols\n", #> "# (i.e. object names) in variables:\n", "this <- sym(\"apples\")\n", #> "that <- sym(\"oranges\")\n", "\n", "# With unquotation you can insert the contents of these variables\n", #> "# inside the quoted expression:\n", "expr(how_many(!!this))\n", #> "expr(how_many(!!that))\n", "\n", "# You can also insert values:\n", #> "expr(how_many(!!(1 + 2)))\n", "quo(how_many(!!(1 + 2)))\n", #> "\n", "\n", "# Note that when you unquote complex objects into an expression,\n", #> "# the base R printer may be a bit misleading. For instance compare\n", #> "# the output of `expr()` and `quo()` (which uses a custom printer)\n", #> "# when we unquote an integer vector:\n", "expr(how_many(!!(1:10)))\n", #> "quo(how_many(!!(1:10)))\n", "\n", "# This is why it's often useful to use qq_show() to examine the\n", #> "# result of unquotation operators. It uses the same printer as\n", #> "# quosures but does not return anything:\n", #> "qq_show(how_many(!!(1:10)))\n", "\n", "\n", #> "# Use `!!!` to add multiple arguments to a function. Its argument\n", #> "# should evaluate to a list or vector:\n", "args <- list(1:3, na.rm = TRUE)\n", #> "quo(mean(!!!args))\n", "\n", "# You can combine the two\n", #> "var <- quote(xyz)\n", "extra_args <- list(trim = 0.9, na.rm = TRUE)\n", #> "quo(mean(!!var , !!!extra_args))\n", "\n", "\n", #> "# The plural versions have support for the `:=` operator.\n", #> "# Like `=`, `:=` creates named arguments:\n", #> "quos(mouse1 := bernard, mouse2 = bianca)\n", #> "\n", "# The `:=` is mainly useful to unquote names. Unlike `=` it\n", #> "# supports `!!` on its LHS:\n", "var <- \"unquote me!\"\n", #> "quos(!!var := bernard, mouse2 = bianca)\n", #> "\n", "\n", "# All these features apply to dots captured by enquos():\n", #> "fn <- function(...) enquos(...)\n", "fn(!!!args, !!var := penny)\n", #> "\n", "\n", "# Unquoting is especially useful for building an expression by\n", #> "# expanding around a variable part (the unquoted part):\n", #> "quo1 <- quo(toupper(foo))\n", "quo1\n", "\n", #> "quo2 <- quo(paste(!!quo1, bar))\n", "quo2\n", #> "\n", "quo3 <- quo(list(!!quo2, !!!syms(letters[1:5])))\n", #> "quo3\n"), "\n"), quo_expr.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/lifecycle-retired.R", #> "\n", list("quo_expr"), "\n", list("quo_expr"), "\n", #> list("Squash a quosure"), "\n", list("\n", "quo_expr(quo, warn = FALSE)\n"), #> "\n", list("\n", list(list("quo"), list("A quosure or expression.")), #> "\n", "\n", list(list("warn"), list("Whether to warn if the quosure contains other quosures\n", #> "(those will be collapsed). This is useful when you use\n", #> list("quo_squash()"), " in order to make a non-tidyeval API compatible\n", #> "with quosures. In that case, getting rid of the nested quosures\n", #> "is likely to cause subtle bugs and it is good practice to warn\n", #> "the user about it.")), "\n"), "\n", list("\n", #> list("rlang:::lifecycle(\"deprecated\")"), "\n", #> "\n", "This function is deprecated, please use ", #> list(list("quo_squash()")), " instead.\n"), "\n", #> list("internal"), "\n"), quo_label.Rd = list("% Generated by roxygen2: do not edit by hand", #> "\n", "% Please edit documentation in R/quo.R", "\n", #> list("quo_label"), "\n", list("quo_label"), "\n", #> list("quo_text"), "\n", list("quo_name"), "\n", list( #> "Format quosures for printing or labelling"), #> "\n", list("\n", "quo_label(quo)\n", "\n", "quo_text(quo, width = 60L, nlines = Inf)\n", #> "\n", "quo_name(quo)\n"), "\n", list("\n", list( #> list("quo"), list("A quosure or expression.")), #> "\n", "\n", list(list("width"), list("Width of each line.")), #> "\n", "\n", list(list("nlines"), list("Maximum number of lines to extract.")), #> "\n"), "\n", list("\n", list("rlang:::lifecycle(\"questioning\")"), #> "\n", "\n", list("Note:"), " You should now use ", #> list(list("as_label()")), " or ", list(list("as_name()")), #> " instead\n", "of ", list("quo_name()"), ". See life cycle section below.\n", #> "\n", "These functions take an arbitrary R object, typically an\n", #> list("expression"), ", and represent it as a string.\n", #> list("\n", list(), " ", list("quo_name()"), " returns an abbreviated representation of the object\n", #> "as a single line string. It is suitable for default names.\n", #> list(), " ", list("quo_text()"), " returns a multiline string. For instance block\n", #> "expressions like ", list("{ foo; bar }"), #> " are represented on 4 lines (one\n", "for each symbol, and the curly braces on their own lines).\n"), #> "\n", "\n", "These deparsers are only suitable for creating default names or\n", #> "printing output at the console. The behaviour of your functions\n", #> "should not depend on deparsed objects. If you are looking for a way\n", #> "of transforming symbols to strings, use ", list( #> list("as_string()")), " instead of\n", list( #> "quo_name()"), ". Unlike deparsing, the transformation between symbols\n", #> "and strings is non-lossy and well defined.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "These functions are in the questioning life cycle stage.\n", #> list("\n", list(), " ", list(list("as_label()")), #> " and ", list(list("as_name()")), " should be used instead of\n", #> list("quo_name()"), ". ", list("as_label()"), #> " transforms any R object to a string\n", "but should only be used to create a default name. Labelisation is\n", #> "not a well defined operation and no assumption should be made\n", #> "about the label. On the other hand, ", list( #> "as_name()"), " only works with\n", "(possibly quosured) symbols, but is a well defined and\n", #> "deterministic operation.\n", list(), " We don't have a good replacement for ", #> list("quo_text()"), " yet. See\n", list("https://github.com/r-lib/rlang/issues/636"), #> " to follow discussions\n", "about a new deparsing API.\n"), #> "\n")), "\n", "\n", list("\n", "# Quosures can contain nested quosures:\n", #> "quo <- quo(foo(!! quo(bar)))\n", "quo\n", "\n", #> "# quo_squash() unwraps all quosures and returns a raw expression:\n", #> "quo_squash(quo)\n", "\n", "# This is used by quo_text() and quo_label():\n", #> "quo_text(quo)\n", "\n", "# Compare to the unwrapped expression:\n", #> "expr_text(quo)\n", "\n", "# quo_name() is helpful when you need really short labels:\n", #> "quo_name(quo(sym))\n", "quo_name(quo(!! sym))\n"), #> "\n", list("\n", list(list("expr_label()")), ", ", #> list(list("f_label()")), "\n"), "\n"), quo_squash.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "quo_squash"), "\n", list("quo_squash"), "\n", #> list("Squash a quosure"), "\n", list("\n", "quo_squash(quo, warn = FALSE)\n"), #> "\n", list("\n", list(list("quo"), list("A quosure or expression.")), #> "\n", "\n", list(list("warn"), list("Whether to warn if the quosure contains other quosures\n", #> "(those will be collapsed). This is useful when you use\n", #> list("quo_squash()"), " in order to make a non-tidyeval API compatible\n", #> "with quosures. In that case, getting rid of the nested quosures\n", #> "is likely to cause subtle bugs and it is good practice to warn\n", #> "the user about it.")), "\n"), "\n", list("\n", #> list("quo_squash()"), " flattens all nested quosures within an expression.\n", #> "For example it transforms ", list("^foo(^bar(), ^baz)"), #> " to the bare\n", "expression ", list("foo(bar(), baz)"), #> ".\n", "\n", "This operation is safe if the squashed quosure is used for\n", #> "labelling or printing (see ", list(list("quo_label()")), #> " or ", list(list("quo_name()")), "). However\n", #> "if the squashed quosure is evaluated, all expressions of the\n", #> "flattened quosures are resolved in a single environment. This is a\n", #> "source of bugs so it is good practice to set ", #> list("warn"), " to ", list("TRUE"), " to\n", #> "let the user know about the lossy squashing.\n"), #> "\n", list(list("Life cycle"), list("\n", "\n", "\n", #> "This function replaces ", list("quo_expr()"), #> " which was deprecated in\n", "rlang 0.2.0. ", #> list("quo_expr()"), " was a misnomer because it implied that it\n", #> "was a mere expression acccessor for quosures whereas it was really\n", #> "a lossy operation that squashed all nested quosures.\n")), #> "\n", "\n", list("\n", "# Quosures can contain nested quosures:\n", #> "quo <- quo(wrapper(!!quo(wrappee)))\n", "quo\n", #> "\n", "# quo_squash() flattens all the quosures and returns a simple expression:\n", #> "quo_squash(quo)\n"), "\n"), quosure.Rd = list( #> "% Generated by roxygen2: do not edit by hand", "\n", #> "% Please edit documentation in R/quo.R", "\n", list( #> "quosure"), "\n", list("quosure"), "\n", list( #> "is_quosure"), "\n", list("quo_is_missing"), #> "\n", list("quo_is_symbol"), "\n", list("quo_is_call"), #> "\n", list("quo_is_symbolic"), "\n", list("quo_is_null"), #> "\n", list("quo_get_expr"), "\n", list("quo_get_env"), #> "\n", list("quo_set_expr"), "\n", list("quo_set_env"), #> "\n", list("Quosure getters, setters and testers"), #> "\n", list("\n", "is_quosure(x)\n", "\n", "quo_is_missing(quo)\n", #> "\n", "quo_is_symbol(quo, name = NULL)\n", "\n", #> "quo_is_call(quo, name = NULL, n = NULL, ns = NULL)\n", #> "\n", "quo_is_symbolic(quo)\n", "\n", "quo_is_null(quo)\n", #> "\n", "quo_get_expr(quo)\n", "\n", "quo_get_env(quo)\n", #> "\n", "quo_set_expr(quo, expr)\n", "\n", "quo_set_env(quo, env)\n"), #> "\n", list("\n", list(list("x"), list("An object to test.")), #> "\n", "\n", list(list("quo"), list("A quosure to test.")), #> "\n", "\n", list(list("name"), list("The name of the symbol or function call. If ", #> list("NULL"), " the\n", "name is not tested.")), #> "\n", "\n", list(list("n"), list("An optional number of arguments that the call should\n", #> "match.")), "\n", "\n", list(list("ns"), list( #> "The namespace of the call. If ", list("NULL"), #> ", the namespace\n", "doesn't participate in the pattern-matching. If an empty string\n", #> list("\"\""), " and ", list("x"), " is a namespaced call, ", #> list("is_call()"), " returns\n", list("FALSE"), #> ". If any other string, ", list("is_call()"), #> " checks that ", list("x"), " is\n", "namespaced within ", #> list("ns"), ".\n", "\n", "Can be a character vector of namespaces, in which case the call\n", #> "has to match at least one of them, otherwise ", #> list("is_call()"), " returns\n", list("FALSE"), #> ".")), "\n", "\n", list(list("expr"), list( #> "A new expression for the quosure.")), "\n", #> "\n", list(list("env"), list("A new environment for the quosure.")), #> "\n"), "\n", list("\n", "A quosure is a type of ", #> list("quoted expression"), " that includes\n", #> "a reference to the context where it was created. A quosure is thus\n", #> "guaranteed to evaluate in its original environment and can refer to\n", #> "local objects.\n", "\n", "You can access the quosure components (its expression and its\n", #> "environment) with:\n", list("\n", list(), " ", #> list(list("get_expr()")), " and ", list(list( #> "get_env()")), ". These getters also support other\n", #> "kinds of objects such as formulas.\n", list(), #> " ", list("quo_get_expr()"), " and ", list( #> "quo_get_env()"), ". These getters only work\n", #> "with quosures and throw an error with other types of input.\n"), #> "\n", "\n", "Test if an object is a quosure with ", #> list("is_quosure()"), ". If you know an\n", "object is a quosure, use the ", #> list("quo_"), " prefixed predicates to check\n", #> "its contents, ", list("quo_is_missing()"), ", ", #> list("quo_is_symbol()"), ", etc.\n"), "\n", list( #> list("Quosured constants"), list("\n", "\n", #> "\n", "A quosure usually does not carry environments for ", #> list("constant objects"), " like strings or numbers. ", #> list(list("quo()")), " and\n", list(list("enquo()")), #> " only capture an environment for ", list("symbolic expressions"), #> ". For instance, all of these return the\n", #> list("empty environment"), ":", list("quo_get_env(quo(\"constant\"))\n", #> "quo_get_env(quo(100))\n", "quo_get_env(quo(NA))\n"), #> "\n", "\n", "On the other hand, quosures capture the environment of symbolic\n", #> "expressions, i.e. expressions whose meaning depends on the\n", #> "environment in which they are evaluated and what objects are\n", #> "defined there:", list("quo_get_env(quo(some_object))\n", #> "quo_get_env(quo(some_function()))\n"), "\n")), #> "\n", "\n", list(list("Empty quosures"), list("\n", #> "\n", "\n", "When missing arguments are captured as quosures, either through\n", #> list(list("enquo()")), " or ", list(list("quos()")), #> ", they are returned as an empty quosure. These\n", #> "quosures contain the ", list("missing argument"), #> " and typically\n", "have the ", list("empty environment"), #> " as enclosure.\n")), "\n", "\n", list(list("Life cycle"), #> list("\n", "\n", list("\n", list(), " ", list( #> "is_quosure()"), " is stable.\n", list(), " ", #> list("quo_get_expr()"), " and ", list("quo_get_env()"), #> " are stable.\n"), "\n")), "\n", "\n", list( #> "\n", "quo <- quo(my_quosure)\n", "quo\n", "\n", #> "\n", "# Access and set the components of a quosure:\n", #> "quo_get_expr(quo)\n", "quo_get_env(quo)\n", #> "\n", "quo <- quo_set_expr(quo, quote(baz))\n", #> "quo <- quo_set_env(quo, empty_env())\n", "quo\n", #> "\n", "# Test wether an object is a quosure:\n", #> "is_quosure(quo)\n", "\n", "# If it is a quosure, you can use the specialised type predicates\n", #> "# to check what is inside it:\n", "quo_is_symbol(quo)\n", #> "quo_is_call(quo)\n", "quo_is_null(quo)\n", "\n", #> "# quo_is_missing() checks for a special kind of quosure, the one\n", #> "# that contains the missing argument:\n", "quo()\n", #> "quo_is_missing(quo())\n", "\n", "fn <- function(arg) enquo(arg)\n", #>