flatten_data.flexfile() creates a single flat file for working with FlexFile data. Input should be a list of one or more FlexFiles imported through the read_flexfile function.

All fields retain their original names from the data model unless they are added in the flattening process. These new fields are in 'snake_case' rather than ProperCase.

# S3 method for class 'flexfile'
flatten_data(x, .allocate = TRUE, ...)

Arguments

x

A list of one or more collections of data frames to be flattened.

.allocate

Logical whether or not to apply the allocations before flattening. In almost all cases this should be left as TRUE.

...

Arguments passed on to methods.

Examples

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

flat_flex_file <- read_flexfile(file) %>%
  flatten_data()

# Flatten multiple FlexFiles
library(dplyr)

files <- system.file("extdata", package = "flexample")

flat_flexfiles <- read_folder(files, read_flexfile) %>%
  flatten_data()
  bind_rows(.id = "doc_id")
} # }