mnirs 0.7.0

Highlights

This minor version update includes mostly internal refactoring, but enough user-facing changes and a few breaking deprecations, so that it’s more than just a patch. This version lays the foundation for the incoming (hopefully soon) mnirs analyse_kinetics suite of functions.

Working with lists and grouped data frames

replace_mnirs(
    data = list(df1, df2),
    outlier_cutoff = 3,
    span = 5
)
#> $interval_1
#> # A tibble:
#>     time  smo2    o2hb
#>    <dbl> <dbl>   <dbl>
#>  1   0    42.8 -0.0289
#>  2   0.1  42.8 -0.0524
#>  3   0.2  42.8 -0.0916
#>  4   0.3  42.9 -0.138 
#>  5   0.4  43.2 -0.205 
#> 
#> $interval_2
#> # A tibble:
#>     time  smo2  o2hb
#>    <dbl> <dbl> <dbl>
#>  1   9.9  51.7 -2.29
#>  2  10    51.7 -2.32
#>  3  10.1  51.8 -2.31
#>  4  10.2  52.2 -2.22
#>  5  10.3  52.4 -2.12

Channel grouping and processing

shift_mnirs(
    data,
    nirs_channels = c(smo2, o2hb),
    group_channels = "ensemble",
    to = 0,
    span = 5
)
filter_mnirs(
    data,
    nirs_channels = c(smo2, o2hb),
    method = list(smo2 = "moving_average", o2hb = "butterworth"),
    span = 5,     ## only used by "moving_average" channels
    order = 2,    ## only used by "butterworth" channels (and below args)
    W = 0.02,
    type = "low",
    na.rm = TRUE
)

Function and argument renaming

interval_list <- extract_intervals(
    data,
    nirs_channels = c(smo2_left, smo2_right),
    group_intervals = "ensemble",
    start = by_time(368, 1084),
    span = c(-20, 90)
)
#> $ensemble
#> # A tibble:
#>     time smo2_left smo2_right
#>    <dbl>     <dbl>      <dbl>
#>  1 -20        56.3       59.2
#>  2 -19.9      56.1       59.2
#>  3 -19.8      56.1       59.2
#>  4 -19.7      56.2       58.9
#>  5 -19.6      56.4       58.9

Performance improvements & bug fixes

read_mnirs()

create_mnirs_data()

resample_mnirs()

replace_mnirs()

filter_mnirs()

shift_mnirs()

rescale_mnirs()

extract_intervals()

plot.mnirs()

Internal validation & shared functions

mnirs 0.6.5

read_mnirs()

## read an mNIRS file with two "smo2" channels
df <- read_mnirs(file_path = example_mnirs("moxy_ramp"))

attr(df, "nirs_channels")
#> [1] "SmO2 Live"    "SmO2 Live(2)"

Core function updates

mnirs 0.6.4

Bug fix

mnirs 0.6.3

Plotting improvements

read_mnirs() |> 
    extract_intervals() |> 
    plot()
## returns a plot with a facet for each interval
read_mnirs() |> 
    extract_intervals() |> 
    class()
#> [1] "mnirs" "list"

Modified lap extraction behaviour

read_mnirs() |> 
    extract_intervals(
        start = by_lap(1, 3),
        span = c(0, 60),
    )
## returns a list of two intervals with the first 60-sec of laps 1 and 3, respectively.

Updated core functions

create_mnirs_data(df, nirs_channels = c(o2hb, hhb))

mnirs 0.6.2

Core updates

Core function argument changes

Small edits

mnirs 0.6.1

Bug fixes

mnirs 0.6.0

Prepare for CRAN submission

Updated core functions

mnirs 0.5.2

Shiny app

mnirs 0.5.1

Updated core functions

mnirs 0.5.0

Updated core functions

Package resources

mnirs 0.4.2 and prior