Nothing
# The shipped srl dataset must be model-ready with no further wrangling.
test_that("srl dataset loads with the documented structure", {
data(srl, package = "idiographic")
expect_s3_class(srl, "data.frame")
expect_equal(nrow(srl), 5616L)
expect_equal(length(unique(srl$name)), 36L)
expect_true(all(c("name", "day", "efficacy", "value", "planning",
"monitoring", "effort", "control", "help", "social",
"organizing") %in% names(srl)))
})
test_that("srl is already ordered and carries a within-person occasion index", {
data(srl, package = "idiographic")
# day is a per-person 1..156 index, and rows are ordered by name then day.
per <- tapply(srl$day, srl$name, function(d) identical(d, seq_along(d)))
expect_true(all(per))
expect_false(is.unsorted(order(srl$name, srl$day)))
})
test_that("srl fits every single-series estimator with no preprocessing", {
data(srl, package = "idiographic")
vars <- c("efficacy", "value", "planning", "monitoring", "effort")
fit <- fit_var(srl, vars = vars, id = "name", subject = "Grace")
expect_s3_class(fit, "var_result")
expect_equal(fit$labels, vars)
})
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.