dbosak01 / libr

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

lib_write() not working as expected #165

Closed dbosak01 closed 2 months ago

dbosak01 commented 3 months ago

lib_write() doesn't appear to work after replacing a dataframe in the library.

# Open libname
libname(sdtm2, "./SDTM2", "rds")

dat <- sdtm2$dm

dat$fork <- 1

sdtm2$dm <- dat

names(sdtm2$dm)

# Nothing written/updated
lib_write(sdtm2)
dbosak01 commented 3 months ago

I think this was there from the very beginning. At the time, I couldn't figure out how to detect a changed dataset in the libname list.

dbosak01 commented 2 months ago

Wrote a function to take a pseudo-checksum of the data in memory and use that to compare to the current state before writing.