Skip to content

Commit

Permalink
now correctly handles scenario when only 1 metric is calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmigueles committed Feb 13, 2025
1 parent 665412e commit ff6a838
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
visual report and for part 6 analyses when there are several options and
part6_threshold_combi is NULL. #1260

- Part 2: Bug fixed in handling function calls that only require one acceleration metric #1265

# CHANGES IN GGIR VERSION 3.1-11

- Part 2:
Expand Down
2 changes: 1 addition & 1 deletion R/g.analyse.perday.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ g.analyse.perday = function(ndays, firstmidnighti, time, nfeatures,
daysummary[di,(fi + 3)] = nhours
ds_names[fi:(fi + 3)] = c("calendar_date","bodylocation","N valid hours","N hours")
fi = fi + 4
vari = vari[,2:ncol(vari)] # remove timestamp now it is no longer needed
vari = vari[,2:ncol(vari), drop = FALSE] # remove timestamp now it is no longer needed, drop = FALSE ensures it is not coerced to numeric if only 1 metric is calculated
colnames(averageday) = colnames(vari)

if (length(params_247[["qwindow"]]) > 0) {
Expand Down

0 comments on commit ff6a838

Please sign in to comment.