Define the region of interest for data analysis based on the accelerometer data timestamp.
Arguments
- data
An
impactr_data
object, as obtained with read_acc().- start_time, end_time
A character string with the start and end times of the region of interest in the "YYYY-MM-DD HH:MM:SS" format.
Examples
data <- read_acc(impactr_example("hip-raw.csv"))
define_region(
data, start_time = "2021-04-06 15:45:00", end_time = "2021-04-06 15:46:00"
)
#> # Start time: 2021-04-06 15:43:00
#> # Sampling frequency: 100Hz
#> # Accelerometer placement: Non-specified
#> # Subject body mass: Non-specified
#> # Filter: No filter applied
#> # Data dimensions: 6,000 × 4
#> timestamp acc_X acc_Y acc_Z
#> <dttm> <dbl> <dbl> <dbl>
#> 1 2021-04-06 15:45:00 -0.148 -1.05 0.094
#> 2 2021-04-06 15:45:00 -0.098 -1.08 0.176
#> 3 2021-04-06 15:45:00 -0.055 -1.11 0.234
#> 4 2021-04-06 15:45:00 -0.035 -1.12 0.254
#> 5 2021-04-06 15:45:00 -0.02 -1.11 0.23
#> 6 2021-04-06 15:45:00 -0.004 -1.09 0.184
#> 7 2021-04-06 15:45:00 0.004 -1.06 0.152
#> 8 2021-04-06 15:45:00 -0.004 -1.08 0.152
#> 9 2021-04-06 15:45:00 0.008 -1.15 0.176
#> 10 2021-04-06 15:45:00 0.039 -1.20 0.195
#> # … with 5,990 more rows
#> # ℹ Use `print(n = ...)` to see more rows