get_data: get_data: Pull data from CDC Wonder using wonderpy and put it...

Description Usage Arguments Examples

View source: R/line-graphs.R

Description

get_data: Pull data from CDC Wonder using wonderpy and put it into a good format

Usage

1
2
3
4
5
6
7
8
9
get_data(
  ROOTPATH = "",
  MCD1 = c(),
  MCD2 = c(NA),
  RUNNAME = "",
  replace = T,
  by_vars = c("sex", "race", "hispanic"),
  pypath = "/path/to/python.exe"
)

Arguments

ROOTPATH

path to directory that includes an "input" and "output" folder

MCD1

ICD10 codes

MCD2

ICD10 codes that must ALSO be included in the MCD

RUNNAME

Name for the data you will pull

replace

Default True, if False or if the data file does not exist it will pull data

by_vars

Segment the data by sex, race, hispanic, and/or state. Year is always included.

pypath

Defaults to where python in CMD. You can also set the path to your Python 3 EXE file

Examples

1
2
3
4
5
6
7
8
9
df <- get_data(
  ROOTPATH = "C:/Users/tcapu/Desktop/wonderdd",
  MCD1 = c("X40","X41","X42","X43","X44","X60","X61","X62","X63","X64","Y10","Y11","Y12","Y13","Y14"),
  MCD2 = c("T40.2","T40.3","T40.4"),
  RUNNAME = "year_state_sex_race_opioids",
  replace = T,
  by_vars = c("race", "hispanic"),
  pypath = T
)

tlcaputi/wondeR documentation built on April 10, 2020, 3:53 p.m.