Commit 5463f4c3 authored by Chris Jewell's avatar Chris Jewell
Browse files

Added test for data structures.

parent 8bf86d87
# Tests data structures
test_that("Test X", {
src = melt(
sim_SA_data[sim_SA_data$Location == 'A', ],
id.vars = c('Type', 'Time'),
measure.vars = c(
'Source1',
'Source2',
'Source3',
'Source4',
'Source5',
'Source6'
),
variable.name = 'Source'
)
# Type 91 in the data has no source observations for time 2
expect_error(X(src, x='value', source='Source', type='Type',time='Time'))
src = src[!src$Type == 91, ]
obj = X(src, x='value', source='Source', type='Type', time='Time')
expect_equal_to_reference(obj$x, 'dataX.rds')
})
test_that("Prevalence", {
expect_silent(Prev(sim_SA_prev, prev = 'Value', source='Source', time='Time'))
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment