digivet-consortium/movenet

fix how options work for movedata_cols given as indices

Closed this issue · 2 comments

Privacy functions don't work if movedata_cols are given as col indices.

Probably need to ensure replacement of col indices with col names in movenetenv$options, as original col indices are meaningless in any downstream data processing/analysis

Replacement of col indices with col names, currently works like so:

  • at reformating data stage, if movenetenv$options$movedata_cols has any integers, colindex2name() [read_movement_data.R] is called
  • colindex2name() returns a list of lists (list(minvars,extra)) , containing the options with values in the form of col names
  • this list is then used internally within reformat_move_data(), but the translation from col indices to col names is not saved anywhere outside the function.

Suggestion is to save this translation directly within movenetenv$options$movedata_cols.

Are there any downsides to doing so?

  • What if combining datafiles, where data are consistently in the same col order, but with varying col names? Then it'd be handy to maintain col indices for reading multiple datafiles

Could create a second "options list", movenetenv$translated_options ?
but this might require adapting the config system, to allow users to change either set of options