sub-.imu: Subset an IMU Object

Description Usage Arguments Details Value Examples

Description

Enables the IMU object to be subsettable. That is, you can load all the data in and then select certain properties.

Usage

1
2
## S3 method for class 'imu'
x[i, j, drop = FALSE]

Arguments

x

A imu object

i

A integer vector that specifies the rows to subset. If blank, all rows are selected.

j

A integer vector that specifies the columns to subset. Special rules apply see details.

drop

A boolean indicating whether the structure should be preserved or simplified.

Details

When using the subset operator, note that all the Gyroscopes are placed at the front of object and, then, the Accelerometers are placed.

Value

An imu object class.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
if(!require("imudata")){
install_imudata()
library("imudata")
}

data(imu6)

# Create an IMU Object that is full. 
ex = imu(imu6, gyros = 1:3, accels = 4:6, axis = c('X', 'Y', 'Z', 'X', 'Y', 'Z'), freq = 100)

# Create an IMU object that has only gyros. 
ex.gyro = ex[,1:3]
ex.gyro2 = ex[,c("Gyro. X","Gyro. Y","Gyro. Z")]

# Create an IMU object that has only accels. 
ex.accel = ex[,4:6]
ex.accel2 = ex[,c("Accel. X","Accel. Y","Accel. Z")]

# Create an IMU object with both gyros and accels on axis X and Y
ex.b = ex[,c(1,2,4,5)]
ex.b2 = ex[,c("Gyro. X","Gyro. Y","Accel. X","Accel. Y")]


## End(Not run)

SMAC-Group/gmwm documentation built on Sept. 11, 2021, 10:06 a.m.