# Create a `tsd` object with only cases
tsd_cases <- to_time_series(
cases = c(10, 15, 20, 18),
time = seq(from = as.Date("2023-01-01"), by = "1 week", length.out = 4)
)
# Create a `tsd` object with incidence from cases, population and default incidence_denominator
tsd_calculate_incidence <- to_time_series(
cases = c(100, 120, 130, 150),
time = seq(from = as.Date("2023-01-01"), by = "1 week", length.out = 4),
population = c(3000000, 3000000, 3000000, 3000000)
)
# Create a `tsd` object with cases from incidence, population and default incidence_denominator
tsd_calculate_cases <- to_time_series(
incidence = c(5, 7.8, 8, 8.5),
time = seq(from = as.Date("2023-01-01"), by = "1 week", length.out = 4),
population = c(3000000, 3000000, 3000000, 3000000)
)
Run the code above in your browser using DataLab