# NOT RUN {
# Use sample input data
df = sample_raw_accel_data
head(df)
# set epoch to 1 second and unit to degree
# last epoch does not have enough samples to estimate orientation angles.
aggregate_for_orientation(df, epoch='1 sec', unit='deg')
# set epoch to 2 seconds and unit to radian
# last epoch does not have enough samples to estimate orientation angles.
aggregate_for_orientation(df, epoch='2 sec', unit='rad')
# epoch set to 2 seconds, 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:01 as shown in prior example,
aggregate_for_orientation(df, epoch = '1 sec', unit='rad', st=df[1,1] - 1)
# }
Run the code above in your browser using DataLab