compute_orientation | R Documentation |
compute_orientation
returns a dataframe with accelerometer
orientations estimated by
Mizell,
2003 for the input dataframe.
compute_orientation(df, estimation_window = 2, unit = "deg")
df |
dataframe. Input multi-channel signal. First column should be timestamps in POSIXt format. |
estimation_window |
number. window size in seconds to be used to estimate orientations. Default is 2 (seconds), as suggested by Mizell, 2003. |
unit |
string. The unit of orientation angles. Can be "deg" (degree) or "rad" (radian). Default is "deg". |
This function accepts a dataframe (in mhealth accelerometer data format) and
computes the estimated acclerometer orientations (in x, y, and z angles) for
every estimation_window
seconds of the entire sequence, and outputs
the mean of these angles. The returned dataframe will have the same format as
input dataframe, including four columns, and have the same datetime format as
input dataframe in the timestamp column. The orientation estimation method
used in the function is based on
Mizell,
2003.
dataframe. The returned dataframe will have the same format as input dataframe.
This function is used in
function (aggregate_for_orientation
).
Other transformation functions:
sum_up()
,
vector_magnitude()
# Use first 10 second sample data for testing df = sample_raw_accel_data df = clip_data(df, start_time = df[1,1], stop_time = df[1, 1] + 600) # compute orientation angles in degrees compute_orientation(df) # compute orientation angles in radian angles compute_orientation(df, unit='rad')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.