R/util-unpack.R

Defines functions unpack

unpack <- function(x, format,
                   NA_letter = getOption("tidysq_NA_letter")) {
  assert_choice(format, c("RAWS", "INTS", "STRINGS", "STRING"))
  assert_string(NA_letter)
  
  op <- switch (
    format,
    RAWS = CPP_unpack_RAWS,
    INTS = CPP_unpack_INTS,
    STRINGS = CPP_unpack_STRINGS,
    STRING = CPP_unpack_STRING
  )
  
  op(x, NA_letter)
}
michbur/tidysq documentation built on April 1, 2022, 5:18 p.m.