Technomics / readflexfile

An R package to read the Flex File data format.
GNU General Public License v3.0
2 stars 1 forks source link

Do not add optional columns into the data object on read #31

Closed ahjames11 closed 2 years ago

ahjames11 commented 2 years ago

When reading, missing fields are added to each table. This is fine, but some fields are optional and this feature bloats the object unnessarily.

The primary offender are the Tag1 - Tag25 fields in ActualCostHourData, but there may be others.

Proposed solution is to add to the file spec an is_optional field. Then, if the field is_optional == TRUE and is all NA, drop it.

ahjames11 commented 2 years ago

Added in drop_na_optional_spec_tables() function. This probably should be in another package. This will trigger at the end of read_flexfile() and the as_*() functions.