read_flexfile() returns a list of tibbles from a zip folder submission of the FlexFiles. Each tibble corresponds to its respective JSON table. This function can read both a FlexFile and a Quantity report.

read_flexfile_3part() reads the Excel 3-Part Template into the same structure as from the JSON.

read_flexfile(
  file,
  .show_check = FALSE,
  .coerce_spec = TRUE,
  .drop_optional = FALSE,
  .warn_utf8_bom = FALSE,
  .data_case = c("native", "snake")
)

read_flexfile_3part(
  file,
  .show_check = FALSE,
  .coerce_spec = TRUE,
  .drop_optional = TRUE
)

Arguments

file

Path to a FlexFile or Quantity Report .zip archive. For the 3-Part Template, a character vector of the three Excel files to read.

.show_check

Logical whether to print information about the file check to the console or not.

.coerce_spec

Logical whether to coerce all column data types to those from the data models. If FALSE, the types will be as detected upon read by the parser.

.drop_optional

Logical whether to drop optional columns or not. Not recommended for use because it can result in downstream data inconsistencies.

.warn_utf8_bom

Logical whether to report UTF8 byte-order-mark errors.

.data_case

Either 'native' or 'snake'. Controls if the names of the tables and columns reflect the native data model or the transformed snake_case. The default option was changed from snake to native in readflexfile v0.5.0 to simplify usage of readflexfile.

Value

A list of tibbles for the file. Result will be either of class flexfile or of class quantityreport.

Details

Can be used with read_folder as in example.

Examples

if (FALSE) { # \dontrun{
# Read in one FlexFile
file <- system.file("extdata", "Sample_FlexFile_A.zip", package = "flexample")

flexfile <- read_flexfile(file)

# Read in multiple FlexFiles by using read_folder
folder <- system.file("extdata", package = "flexample")

flexfiles <- read_folder(folder, read_flexfile)
} # }