convert_snapshot_to_xlsx: Find a Snapshot File and Convert to XLSX Format

View source: R/convert_to_xlsx.R

convert_nbs_snapshotR Documentation

Find a Snapshot File and Convert to XLSX Format

Description

convert_snapshot_to_xlsx() finds a snapshot file in directory with date in its name and converts it to an XLSX file of the same name. See convert_to_xlsx for details.

Usage

convert_nbs_snapshot(
  date = Sys.Date(),
  directory = paste0("V:/EPI DATA ANALYTICS TEAM/COVID SANDBOX REDCAP DATA/",
    "Sandbox data pull Final/"),
  force = FALSE,
  open = FALSE
)

convert_pcr_snapshot(
  date = Sys.Date(),
  directory = "V:/EPI DATA ANALYTICS TEAM/COVID SANDBOX REDCAP DATA/MSR PCR/",
  force = FALSE,
  open = FALSE
)

convert_vaccine_snapshot(
  date = Sys.Date(),
  directory = paste0("V:/EPI DATA ANALYTICS TEAM/COVID SANDBOX REDCAP DATA/",
    "COVID-19 Vaccine Reporting/data/COVID-19 Vaccine data pull/"),
  force = FALSE,
  open = FALSE
)

convert_snapshot_to_xlsx(
  date = Sys.Date(),
  date_format = "%Y-%m-%d",
  directory,
  force = FALSE,
  open = FALSE
)

Arguments

date

The date included in the name of the file to convert

directory

The directory in which to look for the file to convert

force

Should the file be converted if it will overwrite an existing XLSX file?

open

Should the XLSX file be opened after conversion?

date_format

The format of the date in the file name. The default for the generic function is 'YYYY-MM-DD'; see strptime for details on format specification and the body of convert_pcr_snapshot() for an implementation example (in 'MMDDYYYY' format).

Details

The convert_*_snapshot() functions make it easier to convert specific data files.

Value

A tidy path to the new XLSX file (invisibly)


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