dbosak01 / libr

An R package to create data libraries and data dictionaries.
27 stars 1 forks source link

Attributes being lost on datastep #93

Closed dbosak01 closed 3 years ago

dbosak01 commented 3 years ago

Any attributes assigned to data frame columns are being stripped during the datastep. These need to be restored. I had code to do this, and I think it is working on the dataframe attributes. But the column attributes are being lost.

dbosak01 commented 3 years ago

Looks like they are being lost right at the point the datastep is attempting to save off the attributes. The base R subsetting operators strip the column attributes.

dbosak01 commented 3 years ago

Pretty sure this worked previously. Maybe something changed in the new R release. Should make a test for it.

dbosak01 commented 3 years ago

I see. It works on a tibble, but not a Base R dataframe.

dbosak01 commented 3 years ago

Add a few lines to datastep function detect if the incoming data is a data.frame and copy the attributes to temporary storage.