Technomics / readflexfile

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

flatten_data() returning a column not found error #23

Closed ahjames11 closed 3 years ago

ahjames11 commented 3 years ago

Cannot flatten data from a read in flexfile.

> flatten_data(x)
Error: Can't subset columns that don't exist.
x Columns `program_name`, `approved_plan_number`, `approved_plan_revision_number`, `submission_event_number`, `resubmission_number`, etc. don't exist.
ahjames11 commented 3 years ago

The problem is that the new version of tibble made some behavior more consistent. When using add_column() to basically join in a dataframe, tibble now wants to nest it, which makes sense. We want it to add in the columns at the top level, unchanged.

Easy fix is to change tibble::add_column(meta, .before = 1) to tibble::add_column(!!!meta, .before = 1).