| validate_mnirs | R Documentation |
{mnirs} parametersResolve and validate mnirs metadata and perform basic data quality checks.
validate_numeric(
x,
elements = Inf,
range = NULL,
inclusive = c("left", "right"),
integer = FALSE,
allow_na = FALSE,
msg1 = "",
msg2 = "",
env = rlang::caller_env()
)
validate_mnirs_data(data, ncol = 2L, env = rlang::caller_env())
validate_nirs_channels(nirs_channels, data, env = rlang::caller_env())
validate_time_channel(time_channel, data, env = rlang::caller_env())
validate_event_channel(
event_channel,
data,
required = TRUE,
env = rlang::caller_env()
)
estimate_sample_rate(x, env = rlang::caller_env())
validate_sample_rate(
data,
time_channel,
sample_rate,
verbose = TRUE,
env = rlang::caller_env()
)
validate_width_span(
width = NULL,
span = NULL,
verbose = TRUE,
msg = "",
env = rlang::caller_env()
)
validate_x_t(x, t, allow_na = FALSE, env = rlang::caller_env())
x |
A numeric vector. |
elements |
An integer. Default is |
range |
A two-element numeric vector giving the valid range for |
inclusive |
A character vector specifying which boundaries of |
integer |
Logical. Default is |
allow_na |
Logical. Default is |
msg1, msg2 |
A character string appended to the |
env |
The calling environment or a defused call, used to report errors and warnings as coming from the user-facing function rather than the validator. |
data |
A data frame of class "mnirs" containing time series data and metadata. |
nirs_channels |
A character vector giving the names of mNIRS columns to
operate on. Must match column names in
|
time_channel |
A character string naming the time or sample column.
Must match a column name in
|
event_channel |
A character string naming the event/lap column. Must
match a column name in
|
required |
Logical. Default is |
sample_rate |
A numeric sample rate in Hz.
|
verbose |
Logical. |
validate_mnirs() is an internal documentation topic for a set of
validators used throughout the package. These validators:
Prefer explicit user-supplied arguments.
Fall back to "mnirs" metadata attributes when available.
Fail fast with informative cli::cli_abort() messages when values are
missing or invalid.
Returns the validated object (e.g. a resolved time_channel
string), or invisibly returns NULL for successful validations. On
failure, an error is thrown via cli::cli_abort().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.