Skip to content

Bug report specific to using the algorithm on data without peaks #8

@vincentvanhees

Description

@vincentvanhees

The algorithm code seems not able to handle data segments without peaks, which I find in ActiGraph data where large time segments can represent a constant as a result of the idle sleep mode, but maybe it also affects other sensor brands that have a similar behaviour. I get error message incorrect number of dimensions with reference to $call peak_info[, 3]

To address this revise this code segment from

peak_info <- peak_info[peak_info[,4] > sim_thres,]  # filter based on sim_thres
peak_info <- peak_info[is.na(peak_info[,1])!=TRUE,] # previous statement can result in an NA in col-1

to

peak_info <- peak_info[peak_info[,4] > sim_thres, , drop = FALSE]  # filter based on sim_thres
peak_info <- peak_info[is.na(peak_info[,1])!=TRUE,  , drop = FALSE] # previous statement can result in an NA in col-1

With these changes I am able to process the problematic file again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions