Nothing
test_that("labvar labels, recodes and sets reference", {
d <- data.frame(age = c(8, 12, 13, 17, 18, 65), outcome = c(0, 1, 0, 1, 1, 0))
labvar(d, age,
recode = c("min:12" = 1, "13:17" = 2, "18:max" = 3),
label = "Age group",
values = c("1" = "0-12", "2" = "13-17", "3" = "18+"),
ordered = TRUE)
expect_true(is.ordered(d$age))
expect_equal(attr(d$age, "label"), "Age group")
labvar(d, outcome, values = c("0" = "No", "1" = "Yes"), ref = "No")
expect_equal(levels(d$outcome)[1], "No")
})
test_that("vars parses table prefixes", {
z <- vars(b2.sex, c.age, q.bmi, f.sbp)
expect_s3_class(z, "r4vn_vars")
expect_equal(z$variable, c("sex", "age", "bmi", "sbp"))
expect_equal(z$type, c("categorical", "mean", "median", "full"))
expect_equal(z$reference_index[1], 2L)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.