# NOT RUN {
# sample data
df = sample_raw_accel_data
head(df)
# epoch set to 5 seconds, and method set to "trapz"
aggregate_for_mims(df, epoch = '5 sec', method='trapz')
# epoch set to 1 second, method set to "sum"
aggregate_for_mims(df, epoch = '1 sec', method='sum')
# epoch set to 1 second, and st set to be 1 second before the start time of the data
# so the first segment will only include data for 1 second, therefore the resulted
# aggregated value for the first segment will be -1 (invalid) because the
# samples are not enough. And the second segment starts from 11:00:01, instead
# of 11:00:02 as shown in prior example,
aggregate_for_mims(df, epoch = '1 sec', method='sum', st=df[1,1] - 1)
# }
Run the code above in your browser using DataLab