library(tidyverse)
library(ggplot2)
library(rlang)
AMR <- function(Population, Deaths, perPopulation){
if (sum(Deaths > Population)==length(Deaths)){
rlang::catch_cnd(abort(message = "Expected deaths are greater than Population! Check for errors in the data source!",
.subclass = "death_overflow"
))
} else {
if (missing(perPopulation)){
perPopulation = 1000
}
(Deaths / (Population)) * perPopulation
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.