zip_ocs: Download Case Study Repository Zip File

Description Usage Arguments Details Value Examples

View source: R/zip_ocs.R

Description

Download the specified case study repository zip file and unzip it to a local directory.

Usage

1
zip_ocs(casestudy, outpath = NULL)

Arguments

casestudy

character string, name of the case study to download zip file from. The input name should follow the same naming scheme as the repository on GitHub:

ocs-bp-rural-and-urban-obesity

ocs-bp-air-pollution

ocs-bp-vaping-case-study

ocs-bp-opioid-rural-urban

ocs-bp-RTC-wrangling

ocs-bp-RTC-analysis

ocs-bp-youth-disconnection

ocs-bp-youth-mental-health

ocs-bp-school-shootings-dashboard

ocs-bp-co2-emissions

ocs-bp-diet

outpath

character string, path to the directory where the downloaded data folder should be saved.

Details

This function downloads the specified OCS case study repository from GitHub as a zip file. The function unzips the folder and saves it as a new R project in a local directory. This makes it so the case study repository, including all of the code, data, and document files, are downloaded with a single function. Wrapper for the use_zip function from usethis.

Value

If download is successful, the path to the downloaded data folder is printed and the logical value TRUE is returned. Otherwise the appropriate error message is printed.

Examples

1
2
3
tmp = tempfile()
dir.create(tmp)
zip_ocs('ocs-bp-co2-emissions', outpath = tmp)

OCSdata documentation built on Aug. 20, 2021, 9:07 a.m.