test_that("Recodificación a 3 niveles", {
vect <- c(1, 4, 5, 6, 99, NA)
expect_equal(rec_cat_5a3(vect,
labels = c('alto' = 1)),
labelled(c(1, 3, 3, 9, 9, NA),
labels = c('alto' = 1)))
expect_equal(rec_cat_7a3(vect,
labels = c('alto' = 1)),
labelled(c(1, 1, 2, 3, 9, NA),
labels = c('alto' = 1)))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.