Skip to content

Fix aggregate_per_date() combining results using last file's columns …#75

Open
fredho-42 wants to merge 1 commit into
PhysicalActivityOpenTools:mainfrom
fredho-42:fix/aggregate-per-date-column-order
Open

Fix aggregate_per_date() combining results using last file's columns …#75
fredho-42 wants to merge 1 commit into
PhysicalActivityOpenTools:mainfrom
fredho-42:fix/aggregate-per-date-column-order

Conversation

@fredho-42

Copy link
Copy Markdown

After looping over all time-series files, aggregate_per_date() combined per-file results and set the final table's column count/names from whichever file happened to be processed last (ci/dsnames were reused directly from the final loop iteration). This made the result silently depend on file processing order/completeness, and won't be compatible when there're multiple bout lengths.

Now each file's (ds, dsnames) pair is collected in a list and combined afterwards with purrr::list_rbind(), using the first file's dsnames as the canonical column names/count.

Verified against a synthetic multi-subject dataset: output is identical to the previous implementation in the well-behaved case (same column count for every file).

…instead of first

After looping over all time-series files, aggregate_per_date() combined
per-file results and set the final table's column count/names from
whichever file happened to be processed *last* (ci/dsnames were reused
directly from the final loop iteration). This made the result silently
depend on file processing order/completeness. Now each file's (ds,
dsnames) pair is collected in a list and combined afterwards with
purrr::list_rbind(), using the *first* file's dsnames as the canonical
column names/count.

Verified against a synthetic multi-subject dataset: output is identical
to the previous implementation in the well-behaved case (same column
count for every file).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant