imu | R Documentation |
Builds an IMU object that provides the program with gyroscope, accelerometer, and axis information per column in the dataset.
imu(
data,
gyros = NULL,
accels = NULL,
axis = NULL,
freq = NULL,
unit = NULL,
name = NULL
)
data |
A |
gyros |
A |
accels |
A |
axis |
A |
freq |
An |
unit |
A |
name |
A |
data
can be a numeric vector, matrix or data frame.
gyros
and accels
cannot be NULL
at the same time, but it will be fine if one of them is NULL
.
In the new implementation, the length of gyros
and accels
do not need to be equal.
In axis
, duplicate elements are not alowed for each sensor. In the new implementation, please specify the axis for each column of data.
axis
will be automatically generated if there are less than or equal to 3 axises for each sensor.
An imu
object in the following attributes:
A vector
that indicates whether data contains gyroscope sensor, accelerometer sensor, or both.
A vector
that indicates how many columns of data are for gyroscope sensor and accelerometer sensor.
Axis value such as 'X', 'Y', 'Z'.
Observations per second.
String representation of the unit.
Name of the dataset.
James Balamuta and Wenchao Yang
## Not run:
if(!require("imudata")){
install_imudata()
library("imudata")
}
data(imu6)
# Example 1 - Only gyros
test1 = imu(imu6, gyros = 1:3, axis = c('X', 'Y', 'Z'), freq = 100)
df1 = wvar.imu(test1)
plot(df1)
# Example 2 - One gyro and one accelerometer
test2 = imu(imu6, gyros = 1, accels = 4, freq = 100)
df2 = wvar.imu(test2)
plot(df2)
# Example 3 - 3 gyros and 3 accelerometers
test3 = imu(imu6, gyros = 1:3, accels = 4:6, axis =
c('X', 'Y', 'Z', 'X', 'Y', 'Z'), freq = 100)
df3 = wvar.imu(test3)
plot(df3)
# Example 4 - Custom axis
test4 = imu(imu6, gyros = 1:2, accels = 4:6, axis =
c('X', 'Y', 'X', 'Y', 'Z'), freq = 100)
df4 = wvar.imu(test4)
plot(df4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.