Skip to main content Module builtins Copy item path Source pub use crate::interpreter::value::BuiltinDescriptor ;pub use crate::interpreter::value::BuiltinFn ;pub use crate::interpreter::value::BuiltinImplementation ;pub use crate::interpreter::value::InterpreterBuiltinFn ;pub use crate::interpreter::value::PreEvalBuiltinFn ;args π Shared decoding helpers for builtin positional and named arguments. coercion π Coercion builtins: as.integer, as.double, as.character, etc. collections Rust std::collections exposed as R data structures. conditions π R condition system builtins β stop, warning, message, signalCondition,
condition constructors, condition accessors, and restart invocation. connections Connection object builtins β file connections, stdin/stdout/stderr, TCP sockets. dataframes π Data frame manipulation builtins β merge, subset, transform, with. datetime π Date and time builtins: Sys.Date, as.Date, as.POSIXct, format.Date, etc. digest π Cryptographic digest builtins (SHA-256, SHA-512, BLAKE3, CRC32). factors π Factor builtins β factor construction, levels, and nlevels. graphics Graphics builtins β high-level R plotting functions that accumulate
PlotItems in the interpreterβs PlotState, then display via
egui_plot (when the plot feature is enabled) or print a helpful
message (when it is not). grid Grid graphics builtins β R-facing functions for the grid graphics system. interp π Interpreter-level builtins β functions that receive BuiltinContext so
they can call back into the active interpreter without direct TLS lookups.
Each is auto-registered via #[interpreter_builtin]. io File I/O builtins β reading and writing data files (CSV, table, lines, scan)
and file system utilities (file.path, file.exists). json π JSON builtins β fromJSON() and toJSON() providing jsonlite-compatible
conversion between R values and JSON strings. math native_code π Native code builtins β .Call(), dyn.load(), dyn.unload(), etc. net π HTTP/HTTPS networking builtins β download.file() and url(). parquet π Parquet I/O builtins β read.parquet() and write.parquet() for reading
and writing Apache Parquet files as data frames. pre_eval π Pre-eval builtins β functions that intercept before argument evaluation.
Each is auto-registered via #[pre_eval_builtin].
The interpreter is accessed via the BuiltinContext passed at dispatch time. progress Text progress bar builtins backed by the indicatif crate. random π Random number generation builtins: set.seed, runif, rnorm, rbinom, sample, etc.
Uses the per-interpreter RNG state via BuiltinContext. rlang_ffi s4 π S4 OOP system β class registry, method dispatch, and object construction. serialize GNU R serialization β reading and writing RDS files. stats π Statistics builtins: cor, cov, weighted.mean, scale, complete.cases, na.omit,
and distribution functions (d/p/q for norm, unif, exp, gamma, beta, cauchy,
weibull, lnorm, chisq, t, f, binom, pois, geom, hyper). strings stubs π Stub builtins β not-yet-implemented functions that return sensible defaults
or fail explicitly. Also includes lightweight implementations of commonly
needed functions that donβt warrant their own module. system System, file, directory, path, and temp builtins. tables π Table and tabulate builtins β contingency tables and integer bin counting. tables_display π Rich table display builtins using the tabled crate. toml π TOML builtins β read.toml(), write.toml(), toml_parse(), and toml_serialize()
for reading, writing, and converting between R values and TOML. types π Type-checking builtins: is.null, is.na, is.numeric, etc. BindInput π BUILTIN_REGISTRY __BUILTIN_REG_BUILTIN_ALL π __BUILTIN_REG_BUILTIN_ALL_EQUAL π __BUILTIN_REG_BUILTIN_ANY π __BUILTIN_REG_BUILTIN_ANY_DUPLICATED π __BUILTIN_REG_BUILTIN_APERM π __BUILTIN_REG_BUILTIN_ARGS π __BUILTIN_REG_BUILTIN_ARRAY π __BUILTIN_REG_BUILTIN_ASIS π __BUILTIN_REG_BUILTIN_AS_FUNCTION π __BUILTIN_REG_BUILTIN_AS_FUNCTION_DEFAULT π __BUILTIN_REG_BUILTIN_ATTR π __BUILTIN_REG_BUILTIN_ATTRIBUTES π __BUILTIN_REG_BUILTIN_ATTR_SET π __BUILTIN_REG_BUILTIN_BODY π __BUILTIN_REG_BUILTIN_BODY_SET π __BUILTIN_REG_BUILTIN_C π __BUILTIN_REG_BUILTIN_CALL π __BUILTIN_REG_BUILTIN_CBIND π __BUILTIN_REG_BUILTIN_CHARACTER π __BUILTIN_REG_BUILTIN_CHARMATCH π __BUILTIN_REG_BUILTIN_CLASS π __BUILTIN_REG_BUILTIN_CLASS_SET π __BUILTIN_REG_BUILTIN_COL_NAMES π __BUILTIN_REG_BUILTIN_COL_NAMES_SET π __BUILTIN_REG_BUILTIN_CUT π __BUILTIN_REG_BUILTIN_DIM π __BUILTIN_REG_BUILTIN_DIMNAMES π __BUILTIN_REG_BUILTIN_DIMNAMES_SET π __BUILTIN_REG_BUILTIN_DIM_SET π __BUILTIN_REG_BUILTIN_DUPLICATED π __BUILTIN_REG_BUILTIN_ENVIRONMENT_NAME π __BUILTIN_REG_BUILTIN_ENVIRONMENT_SET π __BUILTIN_REG_BUILTIN_EXPAND_GRID π __BUILTIN_REG_BUILTIN_FIND_INTERVAL π __BUILTIN_REG_BUILTIN_FORCE π __BUILTIN_REG_BUILTIN_FORMALS π __BUILTIN_REG_BUILTIN_FORMALS_SET π __BUILTIN_REG_BUILTIN_GC π __BUILTIN_REG_BUILTIN_GCINFO π __BUILTIN_REG_BUILTIN_IDENTICAL π __BUILTIN_REG_BUILTIN_IDENTITY π __BUILTIN_REG_BUILTIN_IFELSE π __BUILTIN_REG_BUILTIN_INHERITS π __BUILTIN_REG_BUILTIN_INTEGER π __BUILTIN_REG_BUILTIN_INTERSECT π __BUILTIN_REG_BUILTIN_ISDEBUGGED π __BUILTIN_REG_BUILTIN_LENGTH π __BUILTIN_REG_BUILTIN_LIST π __BUILTIN_REG_BUILTIN_LOGICAL π __BUILTIN_REG_BUILTIN_MATCH π __BUILTIN_REG_BUILTIN_MATCH_ARG π __BUILTIN_REG_BUILTIN_MATRIX π __BUILTIN_REG_BUILTIN_MODE π __BUILTIN_REG_BUILTIN_MODIFY_LIST π __BUILTIN_REG_BUILTIN_NAMES π __BUILTIN_REG_BUILTIN_NAMES_SET π __BUILTIN_REG_BUILTIN_NCHAR π __BUILTIN_REG_BUILTIN_NCOL π __BUILTIN_REG_BUILTIN_NCOL_SAFE π __BUILTIN_REG_BUILTIN_NEW_ENV π __BUILTIN_REG_BUILTIN_NROW π __BUILTIN_REG_BUILTIN_NROW_SAFE π __BUILTIN_REG_BUILTIN_NUMERIC π __BUILTIN_REG_BUILTIN_OLD_CLASS π __BUILTIN_REG_BUILTIN_OLD_CLASS_SET π __BUILTIN_REG_BUILTIN_PAIRLIST π __BUILTIN_REG_BUILTIN_PARENT_ENV π __BUILTIN_REG_BUILTIN_PARENT_ENV_SET π __BUILTIN_REG_BUILTIN_PASTE π __BUILTIN_REG_BUILTIN_PASTE0 π __BUILTIN_REG_BUILTIN_PMATCH π __BUILTIN_REG_BUILTIN_Q π __BUILTIN_REG_BUILTIN_RBIND π __BUILTIN_REG_BUILTIN_REPLACE π __BUILTIN_REG_BUILTIN_ROW_NAMES π __BUILTIN_REG_BUILTIN_ROW_NAMES_SET π __BUILTIN_REG_BUILTIN_R_VERSION π __BUILTIN_REG_BUILTIN_SETDIFF π __BUILTIN_REG_BUILTIN_STOPIFNOT π __BUILTIN_REG_BUILTIN_STRUCTURE π __BUILTIN_REG_BUILTIN_SYS_LOCALECONV π __BUILTIN_REG_BUILTIN_TYPEOF π __BUILTIN_REG_BUILTIN_UNCLASS π __BUILTIN_REG_BUILTIN_UNDEBUG π __BUILTIN_REG_BUILTIN_UNION π __BUILTIN_REG_BUILTIN_UNLIST π __BUILTIN_REG_BUILTIN_UNNAME π __BUILTIN_REG_BUILTIN_USE_METHOD π __BUILTIN_REG_BUILTIN_VECTOR π __BUILTIN_REG_BUILTIN_XOR π __INTERP_REG_BUILTIN_CAT π __INTERP_REG_INTERP_BROWSER π __INTERP_REG_INTERP_DEBUG π __INTERP_REG_INTERP_DETACH π __INTERP_REG_INTERP_GETWD π __INTERP_REG_INTERP_HELP π __INTERP_REG_INTERP_LOAD_NAMESPACE π __INTERP_REG_INTERP_READLINE π __INTERP_REG_INTERP_REQUIRE_NAMESPACE π __INTERP_REG_INTERP_STR π __INTERP_REG_INTERP_SYS_GETENV π __INTERP_REG_INTERP_TRACEBACK π all_equal_attrs π Compare attributes of two objects. all_equal_character π Compare character vectors element-wise. all_equal_lists π Compare two lists recursively. all_equal_names_attr π Check only the βnamesβ attribute. all_equal_numeric π Compare numeric vectors using Rβs mean relative/absolute difference. all_equal_recurse π Recursively compare two R values, collecting difference messages. all_equal_vectors π Compare two vectors, collecting difference messages. as_function_impl π attrs_identical π Compare two attribute maps for identical-ness. automatic_row_names_value π bind_dimnames_value π builtin_all π Test if all values are TRUE. builtin_all_equal π Test near-equality of two objects within a tolerance. builtin_any π Test if any values are TRUE. builtin_any_duplicated π anyDuplicated(x) β index of first duplicate, or 0 if none.builtin_aperm π Transpose or permute the dimensions of an array. builtin_args π args(fn) β return the formals of a function (simplified: same as formals).
In GNU R, args() returns a function with the same formals but NULL body.
We simplify to just returning formals, which covers all practical uses.builtin_array π Create a multi-dimensional array. builtin_as_function π as.function(x, envir) β convert a list to a function.builtin_as_function_default π as.function.default β same as as.function, dispatched for default method.builtin_asis π I(x) β mark an object as βAsIsβ, inhibiting conversion.builtin_attr π Get a single attribute of an object. builtin_attr_set π Set a single attribute on an object. builtin_attributes π Get all attributes of an object as a named list. builtin_body π body(fn) β return the body of a function as a Language object.
For closures, returns the body expression. For builtins, returns NULL.builtin_body_set π body<-(fn, value) β set the body of a closure.builtin_c Combine values into a vector or list. builtin_call π call(name, ...) β construct an unevaluated function call expression.
call("f", 1, 2) returns the language object f(1, 2).builtin_cat π Concatenate and print objects to stdout. builtin_cbind π Bind vectors, matrices, or data frames by columns. builtin_character π Create a character vector of empty strings with the given length. builtin_charmatch π Character partial matching β like pmatch but returns 0 for ambiguous matches. builtin_class π Get the class of an object. builtin_class_set π Set the class attribute of an object. builtin_col_names π Get the column names of a data frame or matrix. builtin_col_names_set π Set the column names of a data frame or matrix. builtin_cut π Bin continuous values into intervals, returning a factor with interval labels. builtin_dim π Get the dimensions of a matrix, array, or data frame. builtin_dim_set π Set the dimensions of an object, converting it to a matrix or array. builtin_dimnames π Get the dimension names of a matrix, array, or data frame. builtin_dimnames_set π Set the dimension names of a matrix, array, or data frame. builtin_duplicated π Identify duplicate elements in a vector. builtin_environment_name π Get the name of an environment. builtin_environment_set π environment<-(fn, value) β set the environment of a closure.builtin_expand_grid π Create a data frame from all combinations of the supplied vectors. builtin_find_interval π Find the interval index containing each element of x. builtin_force π Return its argument unchanged. Forces evaluation of a promise.
@param x any R value
@return x, unchanged builtin_formals π formals(fn) β return the formal parameter list of a function as a named list.builtin_formals_set π formals<-(fn, value) β set the formals of a closure.builtin_gc π Trigger garbage collection (stub). builtin_gcinfo π Set or query verbose GC reporting (stub). builtin_identical π Test if two objects are exactly identical. builtin_identity π Return its argument unchanged (identity function).
@param x any R value
@return x, unchanged builtin_ifelse π Vectorized conditional: for each element of test, select the corresponding
element from yes (when TRUE) or no (when FALSE). yes and no are recycled
to the length of test. builtin_inherits π Test if an object inherits from one or more classes. builtin_integer π Create an integer vector of zeros with the given length. builtin_intersect π Set intersection: elements present in both x and y. builtin_isdebugged π Query whether a function has debug-mode enabled (stub). builtin_length π Get the length of an object. builtin_list π Construct a list from the given arguments. builtin_logical π Create a logical vector of FALSE values with the given length. builtin_match π Find positions of first matches of x in table. builtin_match_arg π Match an argument to a set of candidate values. builtin_matrix π Create a matrix from the given data. builtin_mode π Get the mode (storage type) of an object. builtin_modify_list π Modify a list by replacing/adding/removing elements from another list. builtin_names π Get the names attribute of an object. builtin_names_set π Set the names attribute of an object. builtin_nchar π Count the number of characters in each element of a character vector. builtin_ncol π Get the number of columns of a matrix, array, or data frame. builtin_ncol_safe π Get the number of columns, treating non-matrix vectors as 1-column. builtin_new_env π Create a new environment. builtin_nrow π Get the number of rows of a matrix, array, or data frame. builtin_nrow_safe π Get the number of rows, treating non-matrix vectors as 1-column matrices. builtin_numeric π Create a double vector of zeros with the given length. builtin_old_class π Get the class attribute of an object (S3 compat alias for class()).
@param x any R value
@return class attribute or NULL
@namespace base builtin_old_class_set π Set the old-style (S3) class attribute β alias for class<-.
@param x object
@param value class names or NULL
@return modified object
@namespace base builtin_pairlist π Create a pairlist from named arguments. builtin_parent_env π Get the parent (enclosing) environment of an environment. builtin_parent_env_set π Set the parent (enclosing) environment. builtin_paste π Concatenate strings with a separator. builtin_paste0 π Concatenate strings with no separator. builtin_pmatch π Partial string matching β find unique partial matches of x in table. builtin_q π Terminate the R session. builtin_r_version π Get the version of the R implementation. builtin_rbind π Bind vectors, matrices, or data frames by rows. builtin_replace π Replace values in a vector at specified indices. builtin_row_names π Get the row names of a data frame or matrix. builtin_row_names_set π Set the row names of a data frame or matrix. builtin_setdiff π Set difference: elements in x that are not in y. builtin_stopifnot π Assert that all arguments are TRUE, stopping with an error otherwise. builtin_structure π Set attributes on an object in a single call. builtin_sys_localeconv π Return locale-specific numeric formatting conventions. builtin_typeof π Get the internal type of an object. builtin_unclass π Remove the class attribute from an object. builtin_undebug π Remove debug-mode single-stepping from a function (stub). builtin_union π Set union: unique elements from both x and y. builtin_unlist π Flatten a list into an atomic vector. builtin_unname π Remove names and dimnames from an object. builtin_use_method π UseMethod() is intercepted directly by the evaluator so it can unwind the
current generic frame instead of returning like an ordinary builtin.builtin_vector π Create a vector of a given mode and length. builtin_xor π Vectorized exclusive OR. cbind_data_frames π Column-bind data frames. character_name_vector π coerce_name_strings π coerce_name_values π collect_c_names π Collect element names for c(): named arguments provide names for scalars,
existing names attributes provide names for vector elements. collect_list_elements_recursive π Recursively collect all non-list elements from a list and its nested sublists. combine_expand_grid_column π Combine a column of scalar RValues back into a single typed vector. concat_column_values π Concatenate column values from multiple data frames into a single column. data_frame_dimnames_value π data_frame_row_count π dimnames_component π empty_expand_grid π Return an empty data.frame for expand.grid with zero-length inputs. extract_param_names_from_doc π Extract parameter names from a doc stringβs @param name ... lines. find_builtin Look up a builtin descriptor by R name or alias. find_builtin_ns Look up a builtin by namespace::name (e.g. βstats::corβ). format_help Format a builtinβs doc string for display.
Convention: first line = title, rest = description/params. format_r_double_cut π Format a double for cut() labels β avoid trailing zeros but keep precision. generate_rd_docs Generate .Rd documentation files for all documented builtins. get_dim_ints π Extract integer dim values from a dim attribute has_class π interp_browser π Enter the browser for interactive debugging (stub). interp_debug π Set a function for debug-mode single-stepping (stub). interp_detach π Detach a package from the search path. interp_getwd π Get the interpreterβs current working directory. interp_help π Display help for a function. interp_load_namespace π Load a package namespace without attaching it to the search path. interp_readline π Read a line of user input from stdin. interp_require_namespace π Check if a namespace can be loaded, returning TRUE/FALSE. interp_str π Display the compact internal structure of an object. interp_sys_getenv π Get environment variable(s) from the interpreterβs environment. interp_traceback π Print the call stack of the last error. list_names_value π math_unary_op Helper for unary math builtins: applies f64 -> f64 element-wise. r_identical π Deep structural comparison of two R values. rbind_data_frames π Row-bind data frames by matching column names. register_builtin_binding π register_builtins register_operator_builtins π Register Rβs primitive operators as first-class callable functions. rvalue_to_expr π Convert an RValue back to an AST expression (for call/expression construction). sanitize_rd_filename π Sanitize a builtin name for use as a filename. set_data_frame_col_names π set_data_frame_dimnames π set_data_frame_row_names π set_key π Canonical string key for set operations β works across numeric and character types. set_list_names π set_op_extract π Determine whether set operations should work in numeric or character mode.
Returns the result type based on input types: numeric inputs stay numeric. set_result_numeric π Reconstruct a numeric vector from character representations produced by set operations. str_format_element π Format one element for str() output (used for list elements).
Returns a one-line summary: β type [1:len] previewβ for vectors,
βList of Nβ for nested lists, etc. str_vector_preview π Format a vector element preview for str() output (first 10 elements). synthesize_builtin_help Synthesize RdDoc help pages from all builtin descriptors and register
them in the help index. This gives every builtin a rich help page
(title, usage, arguments, return value) derived from rustdoc comments. updated_dimnames_component π vector_to_items π Extract scalar items from an RValue for expand.grid column construction. vectors_identical π Element-wise comparison of two atomic vectors.