library(trialcostR)
context('Test formula parsing and validation')
test_that('Do not accept empty formulas', {
expect_false(valid_linear_formula(formula()))
expect_false(valid_response_formula(formula()))
expect_false(valid_interval_spec_formula(formula()))
})
test_that('Accept formulas with only intercept', {
expect_true(valid_linear_formula(~1))
expect_true(valid_response_formula(y~1))
expect_true(valid_interval_spec_formula(x*y*z~1))
})
# TODO: Need meaningful errors when formulas do not contain valid terms, i.e.
# terms(...) fails.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.