R/na_init.R

Defines functions na_init

Documented in na_init

#' Fast `NA` initialisation
#'
#' @param x A vector.
#' @param n Vector length to initialise.
#'
#' @returns
#' Initialises `NA` values of the same type as `x`.
#'
#' @seealso [rep_len_]
#'
#' @export
na_init <- function(x, n = 0L) {
  .Call(`_cheapr_cpp_na_init`, x, n)
}

Try the cheapr package in your browser

Any scripts or data that you put into this service are public.

cheapr documentation built on Nov. 28, 2025, 5:06 p.m.