R/aaa.R

# Function to concatenate factors not defined in R<4.1.0
if (!exists("c.factor")) {
  c.factor <- function (..., recursive = TRUE) {
    x <- list(...)
    y <- unlist(x, recursive = recursive)
    if (inherits(y, "factor") && all(vapply(x, inherits, NA, 
        "ordered")) && (length(unique(lapply(x, levels))) == 1L)) 
      class(y) <- c("ordered", "factor")
    y
  }
}

Try the cpi package in your browser

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

cpi documentation built on April 3, 2025, 6:52 p.m.