insp_load_data: Load Inspections Data

View source: R/inspections_table.R

insp_load_dataR Documentation

Load Inspections Data

Description

insp_load_data() loads the data from an excel workbook into the R session. standardizes column names, and optionally checks that the column names match expected values.

Usage

insp_load_data(
  path = coviData::path_create("V:/Compliance/Inspection Data for Publishing/",
    "Grand List of Inspections", ext = "xlsx"),
  check = TRUE
)

Arguments

path

The path to the excel workbook containing inspections data

check

Should column names be checked? See Details for more information on name checking.

Details

If check = TRUE, insp_load_data() expects at least five columns giving information on the (last?) inspection visit date, the business name, the business address, the number of total violations by the business, and the closure date (if it exists). The expected values of the column names are formulated as generally as possible to allow for human error. The columns are matched as follows:

  • inspection visit date must contain the words "date" and "visit"

  • business name must contain the words "name" and "business"

  • business address must contain the word "address"

  • number of violations must contain the word "violations"

  • closure date must contain the string "clos" and the word "date"

Value

A tibble containing the inspections data

See Also

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


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