knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-", message = FALSE, warning = FALSE, cache = TRUE )
This repo contains R scripts (in the data-raw
folder) that download county-level and state-level
Area Health Resources Files (AHRF). The datasets are stored in the data
folder.
AHRF is issued annually. The most recent release is in 2016 (as of July 24, 2017).
For more information on the AHRF files, see https://datawarehouse.hrsa.gov/topics/ahrf.aspx.
You can also download the datasets as an R package.
The size of ahrf_county.rda
is 17.5M, so it might take a while to install and load into memory.
# install.packages("devtools") devtools::install_github("jjchern/ahrf@v0.0.1") # To uninstall the package, use: # remove.packages("ahrf")
library(tidyverse) ahrf::ahrf_state
dim(ahrf::ahrf_county)
library(labelled) ahrf::ahrf_county %>% select(F04437, F00002, contains("F08921"), contains("F11984")) %>% var_label() %>% enframe() %>% unnest()
ahrf::ahrf_county %>% select(county = F04437, fips = F00002, beds_2013 = `F08921-13`, pop_2013 = `F11984-13`) %>% mutate(beds_2013 = as.integer(beds_2013), pop_2013 = as.integer(pop_2013), beds_2013_p10k = beds_2013 / pop_2013 * 10000) -> beds beds lapply(beds, summary)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.