Processes a list of one or more dataframes of class "mnirs.data"
representing distinct or ensembled kinetics events for further analysis.
Arguments
- data
A data frame of class "mnirs.data" containing at least one column with numeric time or sample values, and one column with numeric mNIRS values, along with metadata.
- nirs_channels
A character vector indicating the mNIRS data channels to be processed from your dataframe. Must match
datacolumn names exactly. Will be taken from metadata if not defined explicitly.- time_channel
A character string indicating the time or sample channel name. Must match column names in
dataexactly. Will be taken from metadata if not defined explicitly.- event_channel
A character string indicating the event or lap channel name. Must match column names in
dataexactly. Will be taken from metadata if not defined explicitly.- event_times
An optional numeric vector corresponding to values of
time_channelindicating the start of kinetic events. i.e., by time value or sample number.- event_labels
An optional character vector corresponding to values of
event_channelindicating the start of kinetics events. i.e., by an event label such as "end work".- event_indices
An optional numeric vector indicating the starting row indices of kinetics events. i.e., to identify the start of kinetic events by row number.
- group_events
Indicates how kinetics events should be analysed. Typically either "distinct" (the default) or "ensemble", but can be manually specified as a list of event numbers (see Details).
- fit_span
A list of two-element numeric vectors in the form
c(before, after)in units oftime_channel, defining the window around each kinetics events (in sequence) to include in the model fitting process (defaultfit_span = list(c(30, 180))).fit_spanwill be coerced from a vector to a list, and the last vector specified will be carried forward in case more events are observed thanfit_spanis specified for.- time_from_zero
A logical.
TRUE(the default) will resampletime_channelto start from zero at the kinetic event.FALSEwill return the original numeric values oftime_channel. Grouping multiple events together will always resample to zero.- verbose
A logical to return (the default) or silence warnings and messages which can be used for data error checking. Abort errors will always be returned.
- ...
Additional arguments (not currently used).
Value
A list of tibbles of class "mnirs.data"
with metadata available with attributes().
Details
fit_span defines the widest extent of data before and
after the kinetics event which may be included in the modelling process, in
units of the x-axis time_channel variable. e.g. fit_span = c(30, 180)
specifies a window from 30-seconds before to 3-minutes after the expected
kinetics event. Negative values are ignored.
fit_span can be specified as a single two-element numeric vector, carried
forward to all events, or as a list with uniquely values for each event.
The sequence of fit_span should match the sequence of events observed in
the data and specified by group_events. If fewer fit_span values are
specified than events, the last value will be carried forward. If more
fit_span values are specified than events, the remaining values will be
ignored.
group_events indicates how kinetics events should be analysed, either
separately, or grouped and ensemble averaged similar to oxygen uptake
kinetics.
group_events ="distinct"Will prepare a list of unique dataframes for each kinetics event (default).
group_events ="ensemble"Will prepare one dataframe with the ensemble-averaged data from all mNIRS kinetics events.
group_events = list(c(1, 2), c(3, 4))Will group kinetics events together in sequence of appearance, and prepare a list of ensemble-averaged dataframes for each group. Any kinetic events detected in the data but not explicitly defined here will return as a distinct dataframe.