Given a bare (unquoted) column of counts and population, will return the rate in 100,000 as well as the variance (using Poisson approximation).
Examples
df <- data.frame(deaths = c(10, 20), pop = c(1e5, 2e5))
calc_asrate_var(df, opioid, deaths)
#> deaths pop opioid_rate opioid_var
#> 1 10 1e+05 10 10
#> 2 20 2e+05 10 5