roaldarbol / animovement

An R toolbox for analysing animal movement across space and time
http://www.roald-arboel.com/animovement/
Other
4 stars 0 forks source link

Add metadata to columns #19

Open roaldarbol opened 1 week ago

roaldarbol commented 1 week ago

Would be a good way to e.g. keep track of units (frame/s or dots/ pixels/ cm). See https://stackoverflow.com/a/68675903. Also to the dataframe itself (through attr), which could e.g. be the starting time stamp when present - that way we can always dig it out despite having converted to seconds since start (so we can convert back and forth between absolute and relative time).

roaldarbol commented 1 day ago

So attr seems not to be persistent (good thread https://discuss.ropensci.org/t/creating-persistent-metadata-for-an-r-object-for-data-provenace/1260/2). Probably maybe adding the metadata as actual columns, as per the metadata is also data logic. That way it shouldn't disappear (except for summarise, some pivots or joins maybe, and selects of course). Way to think about that? Also a way to write metadata to a file? Maybe keep the UID and make a second dataframe that links the UID to metadata?

https://x.com/i_steves/status/1017569725340151809 also

Otherwise, I'd need to always read the attr, save them and reattach at the end of any of my functions. Could enable logging of all the stuff that happens to the data, e.g. what smoothing, interpolation, number of missing values, stuff like that. That would be cool IMO! Might require using {rhdf5} to export the data including the metadata, or save all that data as columns with meta_ prepended?