flatten_data.flexfile: Create a cost and hour dataframe from a FlexFile

View source: R/flatten_data.R

flatten_data.flexfileR Documentation

Create a cost and hour dataframe from a FlexFile

Description

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.

Usage

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

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

## End(Not run)

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