tests/testthat/helper-data.R

test_data_labelled_light <- list(
  veggies = structure(c(5, 11, 2, 7, 3, 5, 7, 5, 2, 11, 3,
  2, 7, 3, 5, 7, 3, 2, 2, 2, 11, 11, 2, 2, 3, 2, 11, 5, 7, 3, 11,
  2, 11, 2, 2, 7, 5, 3, 3, 2, 3, 11, 7, 2, 3, 2, 5, 2, 7, 2), labels = c(Carrot = 2,
  Potato = 3, Tomato = 5, Cucumber = 7, Broccoli = 11), class = c("haven_labelled",
  "vctrs_vctr", "double"), label = "The regular veggies are indexed by the prime numbers 2-11"),
  exotic_veggies = structure(c(2, 23, 4, 2, 23, 23, 5, 16,
  5, 3, 4, 3, 37, 13, 2, 3, 4, 13, 3, 13, 13, 5, 5, 11, 2,
  2, 2, 31, 23, 17, 11, 19, 17, 13, 17, 13, 13, 8, 16, 11,
  2, 16, 2, 32, 4, 5, NA, 29, 8, 5), labels = c(Bokchoy = 2,
  Celeriac = 3, Chayote = 5, Eggplant = 7, Endive = 11, Fennel = 13,
  Jicama = 17, Kohlrabi = 19, Okra = 23, Radicchio = 29, Rutabaga = 31,
  Taro = 37, Zucchini = 41), class = c("haven_labelled", "vctrs_vctr",
  "double"), label = "The exotic veggies are indexed by the prime numbers 2-41. No observations exist for indexes 7 and 41, but 8 unlabelled observations exist (for indexes 2, 8, 16 and 32), and 1 observations is NA"),
  fruit_fct = structure(c(3L, 5L, 4L, 3L, 1L, 2L, 1L, 4L, 1L,
  1L, 2L, 1L, 5L, 4L, 2L, 5L, 5L, 4L, 2L, 2L, 3L, 4L, 5L, 5L,
  4L, 2L, 2L, 3L, 2L, 3L, 1L, 3L, 2L, 1L, 4L, 3L, 4L, 4L, 3L,
  1L, 2L, 2L, 4L, 5L, 2L, 5L, 3L, 1L, 5L, 1L), levels = c("Apple",
  "Banana", "Lime", "Orange", "Peach"), class = "factor"),
  fruit_lbl = structure(c(3, 5, 4, 3, 1, 2, 1, 4, 1, 1, 2,
  1, 5, 4, 2, 5, 5, 4, 2, 2, 3, 4, 5, 5, 4, 2, 2, 3, 2, 3,
  1, 3, 2, 1, 4, 3, 4, 4, 3, 1, 2, 2, 4, 5, 2, 5, 3, 1, 5,
  1), labels = c(Apple = 1, Banana = 2, Lime = 3, Orange = 4,
  Peach = 5), class = c("haven_labelled", "vctrs_vctr", "double"
  )), fruit_lbl_chr = structure(c("c", "e", "d", "c", "a",
  "b", "a", "d", "a", "a", "b", "a", "e", "d", "b", "e", "e",
  "d", "b", "b", "c", "d", "e", "e", "d", "b", "b", "c", "b",
  "c", "a", "c", "b", "a", "d", "c", "d", "d", "c", "a", "b",
  "b", "d", "e", "b", "e", "c", "a", "e", "a"), labels = c(Apple = "a",
  Banana = "b", Lime = "c", Orange = "d", Peach = "e"), class = c("haven_labelled",
  "vctrs_vctr", "character")), fruit_lbl_int = structure(c(3L,
  5L, 4L, 3L, 1L, 2L, 1L, 4L, 1L, 1L, 2L, 1L, 5L, 4L, 2L, 5L,
  5L, 4L, 2L, 2L, 3L, 4L, 5L, 5L, 4L, 2L, 2L, 3L, 2L, 3L, 1L,
  3L, 2L, 1L, 4L, 3L, 4L, 4L, 3L, 1L, 2L, 2L, 4L, 5L, 2L, 5L,
  3L, 1L, 5L, 1L), labels = structure(1:5, names = c("Apple",
  "Banana", "Lime", "Orange", "Peach")), class = c("haven_labelled",
  "vctrs_vctr", "integer")),
  zulu_vec = c(alfa = "a", bravo = "b", charlie = "c", delta = "d",
   echo = "e", foxtrot = "f", golf = "g", hotel = "h", india = "i",
   juliett = "j", kilo = "k", lima = "l", mike = "m", november = "n",
   oscar = "o", papa = "p", quebec = "q", romeo = "r", sierra = "s",
   tango = "t", uniform = "u", victor = "v", whiskey = "w",
   `x-ray` = "x", yankee = "y", zulu = "z"))

Try the zmisc package in your browser

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

zmisc documentation built on Aug. 22, 2023, 5:07 p.m.