read_flexfile: Read FlexFile or Quantity report

View source: R/read_flexfile.R

read_flexfileR Documentation

Read FlexFile or Quantity report

Description

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.

Usage

read_flexfile(
  file,
  .show_check = FALSE,
  .coerce_spec = TRUE,
  .drop_optional = TRUE,
  .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 JSON parser.

.drop_optional

Logical whether to drop optional columns or not.

.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.

Details

Can be used with read_folder as in example.

Value

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

See Also

flexfile_class, quantityreport_class

Examples

## Not run: 
# 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)

## End(Not run)

Technomics/readflexfile documentation built on Jan. 10, 2024, 6:25 p.m.