download_data_for_regions: Download a File from the Data for Regions REDcap Project

View source: R/download_data_for_regions.R

download_data_for_regionsR Documentation

Download a File from the Data for Regions REDcap Project

Description

download_data_for_regions() is the workhorse behind the download_*_snapshot() functions.

Usage

download_data_for_regions(
  date = Sys.Date(),
  api_token,
  redcap_file,
  directory,
  new_file,
  force = FALSE,
  vac = FALSE
)

Arguments

date

A Date indicating the date of the file to download

api_token

The API token for accessing the Data for Regions REDcap project. This should be stored in an .Renviron file; see env_vars for details.

redcap_file

A string indicating the name of the file to download from REDcap

directory

A string specifying the save directory; this should usually be left alone

new_file

A string specifying the save file name; this should always end in .csv and should usually be left alone

force

A logical indicating whether to ignore any existing files matching date and directory

Value

Invisibly returns the path to the new data file


jesse-smith/coviData documentation built on Jan. 14, 2023, 11:08 a.m.