R/helper.R

# helper functions

.unlist <- function (x){
  ## do.call(c, ...) coerces factor to integer, which is undesired
  x1 <- x[[1L]]
  if (is.factor(x1)) {
    structure(unlist(x), class = "factor", levels = levels(x1))
  } else {
    do.call(c, x)
  }
}

Try the ssviz package in your browser

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

ssviz documentation built on Nov. 8, 2020, 5:53 p.m.