# \donttest{
# This can take a while
pop <- 2005 - as.numeric(substr(pop_2006$date.birth, 1 , 4))
pop <- as.data.frame(table(pop))
pop[, 1] <- as.numeric(as.character(pop[, 1]))
temp <- quarterly_variables(death_2006$date.birth, death_2006$date.death)
e.death <- count_events_quarter(temp)
out <- crude_mx_sh2(pop, pop, e.death)
# }
# Fast example
pop.1 <- data.frame(age = c(40, 41), people = c(4134, 4353))
pop.2 <- data.frame(age = c(40, 41), people = c(4250, 4213))
dates.b <- c("1980-04-12")
dates.d <- c("2020-08-23")
x <- quarterly_variables(dates.b, dates.d)
e.death <- count_events_quarter(x)
out <- crude_mx_sh2(pop.1, pop.2, e.death)
Run the code above in your browser using DataLab