insp_archive_table: Create and Manage Inspection Table Archive Files

insp_archive_tableR Documentation

Create and Manage Inspection Table Archive Files

Description

insp_archive_table() creates a backup of the file at table_path and ensures that only one file matching table_pattern is in the directory specified in table_path. It also ensures that backups are kept to a reasonable number in archive_dir (at least seven at all times, possibly more if multiple backups per day were made in the last seven days).

Usage

insp_archive_table(
 
    table_path = coviData::path_create("V:/Compliance/Inspection Data for Publishing/Table/",
    paste0("insp_table_", Sys.Date()), ext = "html"),
  archive_dir = "V:/Compliance/Inspection Data for Publishing/Table/Archive/",
  table_pattern = "insp_table_.*html",
  force = FALSE
)

Arguments

table_path

The path to the table to archive

archive_dir

The path to the archive directory

table_pattern

The pattern to search for when removing old tables from the directory in table_path

force

Should any existing file in archive_dir be overwritten if there is a conflict?

Value

table_path (invisibly)

See Also

Other functions in the inspections data pipeline ( insp_load_data() , insp_prep_data() , insp_create_table() , insp_save_table() ) and the wrapper for the full workflow ( insp_table_pipeline() )


jesse-smith/covidReport documentation built on Aug. 3, 2024, 4:52 p.m.