Skip to main content Module math Copy item path Source MathError Structured error type for math/linear algebra operations. __BUILTIN_REG_BUILTIN_ABS π __BUILTIN_REG_BUILTIN_ACOS π __BUILTIN_REG_BUILTIN_ACOSH π __BUILTIN_REG_BUILTIN_APPEND π __BUILTIN_REG_BUILTIN_ARG π __BUILTIN_REG_BUILTIN_ARRAY_IND π __BUILTIN_REG_BUILTIN_ASIN π __BUILTIN_REG_BUILTIN_ASINH π __BUILTIN_REG_BUILTIN_AS_COMPLEX π __BUILTIN_REG_BUILTIN_ATAN π __BUILTIN_REG_BUILTIN_ATAN2 π __BUILTIN_REG_BUILTIN_ATANH π __BUILTIN_REG_BUILTIN_BESSEL_J π __BUILTIN_REG_BUILTIN_BESSEL_Y π __BUILTIN_REG_BUILTIN_BETA π __BUILTIN_REG_BUILTIN_BITW_AND π __BUILTIN_REG_BUILTIN_BITW_NOT π __BUILTIN_REG_BUILTIN_BITW_OR π __BUILTIN_REG_BUILTIN_BITW_SHIFT_L π __BUILTIN_REG_BUILTIN_BITW_SHIFT_R π __BUILTIN_REG_BUILTIN_BITW_XOR π __BUILTIN_REG_BUILTIN_CBRT π __BUILTIN_REG_BUILTIN_CEILING π __BUILTIN_REG_BUILTIN_CHOL π __BUILTIN_REG_BUILTIN_CHOOSE π __BUILTIN_REG_BUILTIN_COEF π __BUILTIN_REG_BUILTIN_COL π __BUILTIN_REG_BUILTIN_COL_MEANS π __BUILTIN_REG_BUILTIN_COL_SUMS π __BUILTIN_REG_BUILTIN_COMBN π __BUILTIN_REG_BUILTIN_COMPLEX π __BUILTIN_REG_BUILTIN_CONJ π __BUILTIN_REG_BUILTIN_COS π __BUILTIN_REG_BUILTIN_COSH π __BUILTIN_REG_BUILTIN_CROSSPROD π __BUILTIN_REG_BUILTIN_CUMALL π __BUILTIN_REG_BUILTIN_CUMANY π __BUILTIN_REG_BUILTIN_CUMMAX π __BUILTIN_REG_BUILTIN_CUMMIN π __BUILTIN_REG_BUILTIN_CUMPROD π __BUILTIN_REG_BUILTIN_CUMSUM π __BUILTIN_REG_BUILTIN_DET π __BUILTIN_REG_BUILTIN_DIAG π __BUILTIN_REG_BUILTIN_DIFF π __BUILTIN_REG_BUILTIN_DIGAMMA π __BUILTIN_REG_BUILTIN_DROPLEVELS π __BUILTIN_REG_BUILTIN_EIGEN π __BUILTIN_REG_BUILTIN_EXP π __BUILTIN_REG_BUILTIN_EXPM1 π __BUILTIN_REG_BUILTIN_FACTORIAL π __BUILTIN_REG_BUILTIN_FLOOR π __BUILTIN_REG_BUILTIN_GAMMA π __BUILTIN_REG_BUILTIN_HEAD π __BUILTIN_REG_BUILTIN_HYPOT π __BUILTIN_REG_BUILTIN_IM π __BUILTIN_REG_BUILTIN_IS_COMPLEX π __BUILTIN_REG_BUILTIN_KRONECKER π __BUILTIN_REG_BUILTIN_LBETA π __BUILTIN_REG_BUILTIN_LGAMMA π __BUILTIN_REG_BUILTIN_LOG π __BUILTIN_REG_BUILTIN_LOG2 π __BUILTIN_REG_BUILTIN_LOG1P π __BUILTIN_REG_BUILTIN_LOG10 π __BUILTIN_REG_BUILTIN_LOWER_TRI π __BUILTIN_REG_BUILTIN_MAX π __BUILTIN_REG_BUILTIN_MEAN π __BUILTIN_REG_BUILTIN_MEDIAN π __BUILTIN_REG_BUILTIN_MIN π __BUILTIN_REG_BUILTIN_MOD_COMPLEX π __BUILTIN_REG_BUILTIN_NORM π __BUILTIN_REG_BUILTIN_ORDER π __BUILTIN_REG_BUILTIN_PMAX π __BUILTIN_REG_BUILTIN_PMIN π __BUILTIN_REG_BUILTIN_PROD π __BUILTIN_REG_BUILTIN_QR π __BUILTIN_REG_BUILTIN_QUANTILE π __BUILTIN_REG_BUILTIN_RANGE π __BUILTIN_REG_BUILTIN_RANK π __BUILTIN_REG_BUILTIN_RE π __BUILTIN_REG_BUILTIN_REP π __BUILTIN_REG_BUILTIN_REP_INT π __BUILTIN_REG_BUILTIN_REP_LEN π __BUILTIN_REG_BUILTIN_REV π __BUILTIN_REG_BUILTIN_ROUND π __BUILTIN_REG_BUILTIN_ROW π __BUILTIN_REG_BUILTIN_ROW_MEANS π __BUILTIN_REG_BUILTIN_ROW_SUMS π __BUILTIN_REG_BUILTIN_SD π __BUILTIN_REG_BUILTIN_SEQ π __BUILTIN_REG_BUILTIN_SEQ_ALONG π __BUILTIN_REG_BUILTIN_SEQ_LEN π __BUILTIN_REG_BUILTIN_SIGN π __BUILTIN_REG_BUILTIN_SIGNIF π __BUILTIN_REG_BUILTIN_SIN π __BUILTIN_REG_BUILTIN_SINH π __BUILTIN_REG_BUILTIN_SLICE_INDEX π __BUILTIN_REG_BUILTIN_SOLVE π __BUILTIN_REG_BUILTIN_SORT π __BUILTIN_REG_BUILTIN_SORT_UNIQUE π __BUILTIN_REG_BUILTIN_SQRT π __BUILTIN_REG_BUILTIN_SUM π __BUILTIN_REG_BUILTIN_SVD π __BUILTIN_REG_BUILTIN_SWEEP π __BUILTIN_REG_BUILTIN_T π __BUILTIN_REG_BUILTIN_TAIL π __BUILTIN_REG_BUILTIN_TAN π __BUILTIN_REG_BUILTIN_TANH π __BUILTIN_REG_BUILTIN_TCROSSPROD π __BUILTIN_REG_BUILTIN_TRIGAMMA π __BUILTIN_REG_BUILTIN_TRUNC π __BUILTIN_REG_BUILTIN_UNIQUE π __BUILTIN_REG_BUILTIN_UPPER_TRI π __BUILTIN_REG_BUILTIN_VAR π __BUILTIN_REG_BUILTIN_WHICH π __BUILTIN_REG_BUILTIN_WHICH_MAX π __BUILTIN_REG_BUILTIN_WHICH_MIN π __INTERP_REG_INTERP_LM π __INTERP_REG_INTERP_SUMMARY_LM π apply_length_out_cloneable π Truncate or cycle-extend a Vec<T: Clone> to the requested length.out. array2_to_rvalue π Convert an ndarray Array2 back to an RValue matrix bitwise_binary_op π bitwise_binary_op_fallible π builtin_abs π Absolute value. builtin_acos π Inverse cosine (arc cosine). builtin_acosh π Inverse hyperbolic cosine. builtin_append π Append elements to a vector. builtin_arg π Argument (phase angle) of complex numbers, in radians. builtin_array_ind π Convert linear indices to array (row, col) subscripts. builtin_as_complex π Coerce to complex type. builtin_asin π Inverse sine (arc sine). builtin_asinh π Inverse hyperbolic sine. builtin_atan π Inverse tangent (arc tangent). builtin_atan2 π Two-argument inverse tangent. builtin_atanh π Inverse hyperbolic tangent. builtin_bessel_j π Bessel function of the first kind, J_nu(x). builtin_bessel_y π Bessel function of the second kind, Y_nu(x). builtin_beta π Beta function: gamma(a) * gamma(b) / gamma(a + b). builtin_bitw_and π Bitwise AND. builtin_bitw_not π Bitwise NOT (onesβ complement). builtin_bitw_or π Bitwise OR. builtin_bitw_shift_l π Bitwise left shift. builtin_bitw_shift_r π Bitwise right shift. builtin_bitw_xor π Bitwise XOR. builtin_cbrt π Cube root. builtin_ceiling π Ceiling (smallest integer not less than x). builtin_chol π chol(x) β Cholesky decomposition (upper triangular R such that x = RβR).builtin_choose π Binomial coefficient: choose(n, k) = n! / (k! * (n - k)!). builtin_coef π Extract coefficients from a model object. builtin_col π Return a matrix of column indices (same dim as input, each element = its column number). builtin_col_means π Mean of each column of a matrix or data frame. builtin_col_sums π Sum of each column of a matrix or data frame. builtin_combn π All combinations of n elements taken k at a time. builtin_complex π Construct complex numbers from real and imaginary parts. builtin_conj π Complex conjugate. builtin_cos π Cosine (in radians). builtin_cosh π Hyperbolic cosine. builtin_crossprod π crossprod(x, y) = t(x) %*% y builtin_cumall π Cumulative all: TRUE while all preceding elements are TRUE. builtin_cumany π Cumulative any: TRUE once any preceding element is TRUE. builtin_cummax π Cumulative maximum. builtin_cummin π Cumulative minimum. builtin_cumprod π Cumulative product. builtin_cumsum π Cumulative sum. builtin_det π det(x) β matrix determinant via LU decomposition.builtin_diag π Diagonal of a matrix, or construct a diagonal matrix. builtin_diff π Lagged differences. builtin_digamma π Digamma function (psi function): the logarithmic derivative of the gamma function. builtin_droplevels π Drop unused factor levels. builtin_eigen π eigen(x) β Eigenvalue decomposition via nalgebra.builtin_exp π Exponential function (e^x). builtin_expm1 π Numerically stable exp(x) - 1. builtin_factorial π Factorial: n! = 1 * 2 * β¦ * n. builtin_floor π Floor (largest integer not greater than x). builtin_gamma π Gamma function. builtin_head π Return the first n elements of a vector. builtin_hypot π Euclidean distance: sqrt(x^2 + y^2) without overflow. builtin_im π Extract the imaginary part of complex numbers. builtin_is_complex π Test if an object is of complex type. builtin_kronecker π Kronecker product of two matrices (or vectors treated as single-column matrices). builtin_lbeta π Natural logarithm of the beta function. builtin_lgamma π Natural logarithm of the absolute value of the gamma function. builtin_log π Logarithm. With one argument, computes the natural log. With a second
positional argument or named base argument, computes log in that base
via the change-of-base formula: log(x, base) = ln(x) / ln(base). builtin_log2 π Base-2 logarithm. builtin_log1p π Numerically stable log(1 + x). builtin_log10 π Base-10 logarithm. builtin_lower_tri π Lower triangle of a matrix. builtin_max π Maximum value across all arguments. builtin_mean π Arithmetic mean. builtin_median π Median value. builtin_min π Minimum value across all arguments. builtin_mod_complex π Modulus (absolute value) of complex numbers. builtin_norm π norm(x, type = "O") β matrix/vector norm.builtin_order π Permutation which rearranges a vector into ascending order. builtin_pmax π Parallel (element-wise) maximum across vectors. builtin_pmin π Parallel (element-wise) minimum across vectors. builtin_prod π Product of all elements. builtin_qr π qr(x) β QR decomposition via nalgebraβs column-pivoted QR.builtin_quantile π Sample quantiles. builtin_range π Range (minimum and maximum) of all values. builtin_rank π Return the ranks of values in a numeric vector. builtin_re π Extract the real part of complex numbers. builtin_rep π Replicate elements of a vector. builtin_rep_int π Replicate elements a specified number of times. builtin_rep_len π Replicate elements to a specified length. builtin_rev π Reverse a vector. builtin_round π Round to the specified number of decimal places using IEEE 754
round-half-to-even (bankerβs rounding): when the fractional part is
exactly 0.5, round to the nearest even number. builtin_row π Return a matrix of row indices (same dim as input, each element = its row number). builtin_row_means π Mean of each row of a matrix or data frame. builtin_row_sums π Sum of each row of a matrix or data frame. builtin_sd π Sample standard deviation (square root of var). builtin_seq π Generate a regular sequence. builtin_seq_along π Generate 1:length(along.with) as an integer vector. builtin_seq_len π Generate 1:n as an integer vector. builtin_sign π Sign of each element (-1, 0, or 1). builtin_signif π Round to the specified number of significant digits. builtin_sin π Sine (in radians). builtin_sinh π Hyperbolic sine. builtin_slice_index π Return an array of indices along a specified margin. builtin_solve π solve(a, b) β solve linear system or compute matrix inverse via LU decomposition.builtin_sort π Sort a vector. builtin_sort_unique π miniR extension: single-pass sorted unique using BTreeSet.
Faster than sort(unique(x)) for large vectors. builtin_sqrt π Square root. builtin_sum π Sum of all elements. builtin_svd π svd(x) β Singular Value Decomposition via nalgebraβs bidiagonal SVD.builtin_sweep π Sweep a summary statistic from each row or column of a matrix. builtin_t π t(x) β matrix transpose.builtin_tail π Return the last n elements of a vector. builtin_tan π Tangent (in radians). builtin_tanh π Hyperbolic tangent. builtin_tcrossprod π tcrossprod(x, y) = x %*% t(y) builtin_trigamma π Trigamma function: the derivative of the digamma function. builtin_trunc π Truncation (round toward zero). builtin_unique π Remove duplicate elements, preserving first occurrence order. builtin_upper_tri π Upper triangle of a matrix. builtin_var π Sample variance (Bessel-corrected, divides by n-1). builtin_which π Indices of TRUE elements. builtin_which_max π Index of the maximum element. builtin_which_min π Index of the minimum element. collect_additive_terms π Recursively collect symbol names from additive terms (x1 + x2 + x3). df_column_doubles π Extract a named column from a data frame (RList) as a Vec<Option>. digamma_f64 π Compute digamma(x) using asymptotic expansion and recurrence. dmatrix_to_rvalue π Convert a nalgebra DMatrix back to an RValue matrix. eval_kronecker Evaluate the %x% (Kronecker product) operator. eval_kronecker_with_fn π interp_lm π Fit a linear model using ordinary least squares. interp_summary_lm π Print a summary of a linear model. kronecker_dims_and_data π Extract matrix dimensions from a value, treating plain vectors as column vectors. math_binary π Helper for binary math builtins: applies (f64, f64) -> f64 element-wise
with recycling. matrix_dimnames π matrix_dims π Helper: extract matrix dimensions (nrow, ncol) from any matrix-like object. matrix_dims_and_data π Helper: extract matrix dimensions and data as doubles. parallel_minmax π parse_formula_terms π Extract the response and predictor names from a formula expression. partition_na_doubles π Separate non-NA f64 values from NA count. partition_na_options π Separate non-NA Option values from NA count for Clone types. reassemble_with_na π Reassemble sorted non-NA values with NAs placed according to na_last. rep_each_then_times π Repeat each element each times, then repeat the whole result times times. rep_each_then_times_copy π Same as rep_each_then_times but for Copy types (Raw/u8). rep_vector π Helper: replicate a vector with each, times, and optional length.out. round_half_to_even π IEEE 754 round-half-to-even: if the fractional part is exactly 0.5,
round to the nearest even integer. Otherwise round normally. rvalue_to_array2 π Convert an RValue to an ndarray Array2 (column-major) rvalue_to_dmatrix π Convert an RValue matrix to a nalgebra DMatrix (column-major β zero-copy reorder). set_matrix_attrs π solve_linear_system π Solve a linear system A * x = b using Gaussian elimination with partial pivoting.
A must be square (ncol x ncol), b must have length ncol. tri_matrix π trigamma_f64 π Compute trigamma(x) using asymptotic expansion and recurrence. DimNameVec π MatrixDimNames π