Using the arguments passed to convenience functions like accelerometer_features and gyroscope_features, build an argument set that can be used with more general functions like kinematic_sensor_data and sensor_data. This function is not normally called directly. See accelerometer_features and gyroscope_features.

prepare_kinematic_sensor_args(
  sensor_data,
  metric,
  time_filter = NULL,
  detrend = F,
  frequency_filter = NULL,
  IMF = 1,
  window_length = NULL,
  window_overlap = NULL,
  derived_kinematics = F,
  funs = NULL,
  models = NULL
)

Arguments

sensor_data

An n x 4 data frame with column names t, x, y, z containing kinematic sensor (accelerometer or gyroscope) measurements. Here n is the total number of measurements, t is the timestamp of each measurement, and x, y and z are axial measurements.

metric

Name of the metric measured by this sensor. For accelerometer data, the metric is acceleration. Whereas for gyroscope data the metric is velocity.

time_filter

A length 2 numeric vector specifying the time range of measurements to use during preprocessing and feature extraction after normalizing the first timestamp to 0. A NULL value means do not filter any measurements.

detrend

A logical value indicating whether to detrend the signal.

frequency_filter

A length 2 numeric vector specifying the frequency range of the signal (in hertz) to use during preprocessing and feature extraction. A NULL value means do not filter frequencies.

IMF

The number of IMFs used during an empirical mode decomposition transformation. The default value of 1 means do not apply EMD to the signal.

window_length

A numerical value representing the length (in number of samples) of the sliding window used during the windowing transformation. Both window_length and window_overlap must be set for the windowing transformation to be applied.

window_overlap

Fraction in the interval [0, 1) specifying the amount of window overlap during a windowing transformation. Both window_length and window_overlap must be set for the windowing transformation to be applied.

derived_kinematics

A logical value specifying whether to add derived kinematic measurements to sensor_data after the transform defined by the above parameters has been applied to the raw sensor measurements.

funs

A function or list of functions that each accept a single numeric vector as input. Each function should return a dataframe of features (normally a single-row datafame, with column names as feature names). The input vectors will be the axial measurements from sensor_data after the transform defined by the above parameters has been applied. If no argument is supplied to either funs or models, a default set of feature extraction functions (as described in default_kinematic_features) will be supplied for this parameter.

models

A function or list of functions that each accept sensor_data as input after the transform defined by the above parameters has been applied and returns features. Useful for functions which compute individual features using multiple input variables.

Value

A list of arguments to be used in the general feature functions.