create_mnirs_data: Create an _mnirs_ data frame with metadata

View source: R/read_mnirs.R

create_mnirs_dataR Documentation

Create an mnirs data frame with metadata

Description

Manually add class "mnirs" and metadata to an existing data frame.

Usage

create_mnirs_data(data, ...)

Arguments

data

A data frame with existing metadata (accessed with attributes(data)).

...

Additional arguments with metadata to add to the data frame. Can be either seperate named arguments or a list of named values.

  • nirs_device

  • nirs_channels

  • time_channel

  • event_channel

  • sample_rate

  • start_timestamp

  • interval_times

  • interval_span

Details

Typically will only be called internally, but can be used to inject mnirs metadata into any data frame.

Value

A tibble of class "mnirs". Metadata are stored as attributes and can be accessed with attributes(data).

Examples

data <- data.frame(
    A = 1:3,
    B = seq(10, 30, 10),
    C = seq(11, 33, 11)
)

attributes(data)

## inject metadata
nirs_data <- create_mnirs_data(
    data,
    nirs_channels = c("B", "C"),
    time_channel = "A",
    sample_rate = 1
)

attributes(nirs_data)


mnirs documentation built on May 15, 2026, 9:07 a.m.