Title: | Access the Michigan Substance Use Vulnerability Index (MI-SUVI) |
---|---|
Description: | Easily import the MI-SUVI data sets. The user can import data sets with full metrics, percentiles, Z-scores, or rankings. Data is available at both the County and Zip Code Tabulation Area (ZCTA) levels. This package also includes a function to import shape files for easy mapping and a function to access the full technical documentation. All data is sourced from (<https://www.michigan.gov/opioids/category-data>). |
Authors: | Brenden Smith [aut, cre, cph] |
Maintainer: | Brenden Smith <[email protected]> |
License: | CC0 |
Version: | 0.1.0 |
Built: | 2024-11-17 05:40:55 UTC |
Source: | https://github.com/brendensm/misuvi |
This function queries shape files from the tigris package. This function returns an sf object.
add_geometry(x)
add_geometry(x)
x |
a data frame for which you want to add shape files to. Must be one of the MI-SUVI data sets. |
an sf data.frame of MI-SUVI data.
my_data <- misuvi_load() |> add_geometry()
my_data <- misuvi_load() |> add_geometry()
This package provides a tidy version of the MI-SUVI data sets. This function returns a data frame of the cleaned variable names and the original variable names.
dictionary()
dictionary()
A data.frame of the abbreviated and full names of the MI-SUVI variables.
dictionary()
dictionary()
This function opens up a PDF of the MI-SUVI documentation in your web browser.
documentation()
documentation()
NULL, opens a web browser of the technical documentation.
documentation()
documentation()
This function allows the user to select the MI-SUVI data set they want returned.
misuvi_load(geography = "county", type = "metrics", moe = FALSE)
misuvi_load(geography = "county", type = "metrics", moe = FALSE)
geography |
Choose the geographic level you want returned to you. "county" or "zcta". |
type |
Select the type of data frame you would like. Options include "metrics", "percentiles", "zcores", and "ranks". |
moe |
Logical – choose whether margin of error variables are returned. This applies to the "metrics" data sets only. |
A clean data.frame of MI-SUVI data.
zcta_metrics <- misuvi_load("zcta", "metrics") county_zscores <- misuvi_load("county", "zscores")
zcta_metrics <- misuvi_load("zcta", "metrics") county_zscores <- misuvi_load("county", "zscores")