Package 'misuvi'

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

Help Index


Add shape files to your data

Description

This function queries shape files from the tigris package. This function returns an sf object.

Usage

add_geometry(x)

Arguments

x

a data frame for which you want to add shape files to. Must be one of the MI-SUVI data sets.

Value

an sf data.frame of MI-SUVI data.

Examples

my_data <- misuvi_load() |> add_geometry()

View misuvi data dictionary

Description

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.

Usage

dictionary()

Value

A data.frame of the abbreviated and full names of the MI-SUVI variables.

Examples

dictionary()

View the MI-SUVI Documentation

Description

This function opens up a PDF of the MI-SUVI documentation in your web browser.

Usage

documentation()

Value

NULL, opens a web browser of the technical documentation.

Examples

documentation()

Load MI-SUVI Data

Description

This function allows the user to select the MI-SUVI data set they want returned.

Usage

misuvi_load(geography = "county", type = "metrics", moe = FALSE)

Arguments

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.

Value

A clean data.frame of MI-SUVI data.

Examples

zcta_metrics <- misuvi_load("zcta", "metrics")
county_zscores <- misuvi_load("county", "zscores")