require(students)
context("Students checks")
test_that("input and output have same observations", {
expect_equal(nrow(students), nrow(checkHeight(students)))
})
test_that("check if sex.specific works fine", {
test_data <- students
test_data$sex <- rep("M", times=nrow(students))
expect_equal(checkHeight(students, sex.specific=FALSE), checkHeight(test_data))
})
test_that("error is thrown when variables are missing", {
Sys.setenv(LANG = "en")
has_names(names(students))
})
test_that("printed message is right", {
prints_text("Yippie, I calculated the mean differences!")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.