Nothing
# The source code of this helper is in utils.R
test_that("is.labelled_spss recognizes SPSS-labelled vectors", {
x <- haven::labelled_spss(
c(1, 2, 99),
labels = c(yes = 1, no = 2, missing = 99),
na_values = 99
)
expect_true(is.labelled_spss(x))
})
test_that("is.labelled_spss recognizes survey-labelled vectors", {
x <- labelled_spss_survey(
x = c(1, 2),
labels = c(yes = 1, no = 2),
id = "s1"
)
expect_true(is.labelled_spss(x))
})
test_that("is.labelled_spss distinguishes ordinary labelled vectors", {
x <- haven::labelled(
c(1, 2),
labels = c(yes = 1, no = 2)
)
expect_false(is.labelled_spss(x))
})
test_that("is.labelled_spss rejects unrelated objects", {
for (x in list(
NULL,
1:3,
"text",
factor("yes"),
data.frame(x = 1)
)) {
expect_false(is.labelled_spss(x))
}
})
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.