Changelog
Source:NEWS.md
mnirs 0.6.3
CRAN release: 2026-05-07
Plotting improvements
- Generic
plot.mnirs()ncan now be called on a list of “mnirs” data frames. Each data frame will be printed as a facet. This is primarily useful for printing a list of interval data frames exported fromextract_intervals():
read_mnirs() |>
extract_intervals() |>
plot()
## returns a plot with a facet for each interval- To faciliate this,
extract_intervals()now returns a list of data frames withclass = "mnirs". Otherwise, to manually plot a list of data frames, it will need to haveclass(list) <- c("mnirs", class(list))edited manually.
read_mnirs() |>
extract_intervals() |>
class()
#> [1] "mnirs" "list"- Backend improvement:
print.mnirs()generic created to avoid displaying extraNextMethod()calls when printing lists withclass = "mnirs".
Modified lap extraction behaviour
-
When specifying
startandendwithby_lap(),startwill only refer to the first sample of the lap, andendthe last sample.With previous behaviour,
start = by_lap()would include the entire specified lap(s). But this resulted in less control over displaying only parts of a lap.Updated behaviour is now more consistent with
by_time,by_label, andby_sample()methods, which referencestartandendfrom a single sample. This allows extraction of e.g. only the first 60-sec of lap:
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
read_mnirs(): Fix detection issue with “PerfPro” file formats, and another small bug fix to improve timestamp parsing.create_mnirs_data()now properly accepts tidy evaluation fornirs_channels,time_channel, andevent_channel:
create_mnirs_data(df, nirs_channels = c(o2hb, hhb))-
Now resamples to an inclusive time range around existing data, rounded to the nearest resampled rate. Better handles edge cases where the last sample was being dropped in certain rounding conditions.
Fix an edge case error when
sample_ratewas mis-specified higher than the actual sample_rate of the data. Now more robustly fills non-numeric columns.
mnirs 0.6.2
CRAN release: 2026-04-18
Core updates
-
Now properly parses
time_channelas fractional unix values; i.e. timestamp (e.g. “hh:mm:ss”) values are saved by Excel in all its infinite wisdom as numeric fractional Unix timestamps. Will now be properly coerced to numeric and POSIXct timestamp values can be returned.Timestamps should now be returned in the user’s local time zone.
Core function argument changes
resample_mnirs(): Update defaultmethod = "none". Less opinionated default to force users to explicitly opt-in to specifying either “linear” or “locf” methods to fill/interpolate across new samples. Updated package documentation.replace_invalid(),replace_outliers(),replace_missing(): Removebypass_checksarg intended for internal use only, to bypass redundant checks when calling fromreplace_mnirs().
Small edits
plot.mnirs(): No longer coerces to long format data behind the scenes.plot.mnirs(): y-axis title changed from “signal” to “mNIRS”.Fix lap marker inconsistency in
train.red_intervals.csv. Updated relevant interval times in documentation.-
README.md& “reading-mnirs-data.qmd” vignette updates.Update recommended core processing sequence:
read_mnirs()->resample_mnirs()->replace_mnirs()-> …Update
extract_intervals()vignette totrain.red_intervals.csvend-interval reoxygenation events.
Small documentation changes.
mnirs 0.6.1
Bug fixes
-
Core functions updated to accept
nirs_channelargs as a list.An info message will be displayed when a list is not required, instead of erroring.
Additional info messages will be displayed for
shift_mnirs(),rescale_mnirs(), andextract_intervals()whennirs_channelshas not been specified as a list, nor retrieved from metadata. As a reminder of the grouping requirements in those functions.
-
Core functions now properly update
nirs_channelsmetadata when re-specified.- Previously, specifying
nirs_channelsin a function would only add any additional column name strings to the existing metadata rather than overwrite it. Meaningnirs_channelscould only be removed from metadata by usingcreate_mnirs_data(nirs_channels = "..."). The updated behaviour should mean channels need to be re-specified less often.
- Previously, specifying
filter_mnirs(): Fixed an error matchingmethodarguments when left blank.README and “Reading and Cleaning Data with {mnirs}” vignette updated to fix typos and small edits.
mnirs 0.6.0
CRAN release: 2026-03-30
Prepare for CRAN submission
NEWS.md is truncated to the most recent relevant release updates. The full NEWS.md remains in the
devbranch.Some development functions have been omitted from the package build in expectation of CRAN review. They are still present in
devbranch and can be installed withpak::pak("jemarnold/mnirs").
Updated core functions
filter_mnirs(): Method-specific arguments (e.g.orderformethod = "butterworth", orwidthformethod = "moving_average") removed from the generic function call. Continue to be passed to the appropriate method via.... Documentation and info/warning/abort messages updated.-
filter_ma()better separates effects ofpartialandna.rmargs:partial = FALSEby default returns NA at edges where insufficient number of samples are available compared to the specifiedwidthorspan.partial = TRUEcalculates mean values at edges, as long as one valid non-NAsample is available.-
na.rm = FALSEby default behaves as expected withmean(na.rm = FALSE), propagating anyNAs in the local window to the calculated mean with a warning.-
NOTE This differs from the behaviour of
na.rm = FALSEinfilter_butter(), which errors if there are any internalNAs present. This has not been changed.
-
NOTE This differs from the behaviour of
na.rm = TRUEignoresNAs and calculates local means as long as one valid sample is present.
-
Add new arg:
points = TRUEwill plot points in addition to lines, as a useful quick shortcut.Update
na.omitnow omits non-validc(NA, NaN, Inf, -Inf)values from plotting, not justNA.
palette_mnirs()can now accept either a single numeric value specifying the number of colours to return, or any number of (valid) character colour names.
mnirs 0.5.2
Shiny app
- Update online shiny app hosted at https://jemarnold-mnirs-app.share.connect.posit.cloud/ with basic reading and pre-processing functionality.
mnirs 0.5.1
Updated core functions
read_mnirs()now has better automated channel detection logic for “Artinis” / “Oxysoft” file formats.nirs_channelsandtime_channelcan be left blank to automatically “sample”, “time” (fromsample_rate), and nirs channel “2”.replace_outliers()now accepts numericoutlier_cutoffvalues for more precise outlier detection thresholds (previously was integers only). Documentation also updated.
mnirs 0.5.0
Updated core functions
-
read_mnirs()expandsevent_channelto work with integer “lap” numbers, or character event label as previous.Should now work on more .csv file formats; previously read errors may have occured where the file contained header rows above the data table, resulting in improper detection of columns.
event_channelcan now be specified as an integerlapcolumn, in addition to a character column as previous.Other {mnirs} functions may expect
event_channelto be either character or integer-ish.
-
Function arguments
startandendare used to specify one or both of a start and end point to the target interval.Specify
start/endvalues with helper functionsby_time(),by_label(),by_lap(), andby_sample().Numeric values are automatically coerced to “time” values; Explicit integer values (e.g.
2L) are coerced to “lap”; Character strings are coerced to event “label”.
mnirs 0.4.2 and prior
- Full previous changelog is available on the github
devbranch: https://github.com/jemarnold/mnirs/blob/dev/NEWS.md