% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.mnirs.R
\name{plot.mnirs}
\alias{plot.mnirs}
\title{Plot \emph{{mnirs}} objects}
\usage{
\method{plot}{mnirs}(
  x,
  points = FALSE,
  time_labels = FALSE,
  n.breaks = 5,
  na.omit = FALSE,
  ...
)
}
\arguments{
\item{x}{Data frame or list of data frames of class \emph{"mnirs"} (e.g. from
\code{\link[=extract_intervals]{extract_intervals()}}). List input produces a faceted plot with one
panel per element.}

\item{points}{Logical. Default is \code{FALSE}. If \code{TRUE} displays
\code{ggplot2::geom_points()}. Otherwise displays \code{ggplot2::geom_lines()}.}

\item{time_labels}{Logical. Default is \code{FALSE}. If \code{TRUE} displays x-axis
time values formatted as \emph{"hh:mm:ss"} using \code{\link[=format_hmmss]{format_hmmss()}}. Otherwise,
x-axis values are displayed as numeric.}

\item{n.breaks}{A numeric value specifying the number of breaks in both
x- and y-axes. Default is \code{5}.}

\item{na.omit}{Logical. Default is \code{FALSE}. If \code{TRUE} omits missing (\code{NA})
and non-finite \code{c(Inf, -Inf, NaN)} from display.}

\item{...}{Additional arguments.}
}
\value{
A \link[ggplot2:ggplot]{ggplot2} object.
}
\description{
Create a base plot for data frames or lists of data frames with class
\emph{"mnirs"}.
}
\details{
When \code{x} is a named list of \emph{"mnirs"} data frames, elements are bound into a
single data frame and displayed as faceted panels via
\code{\link[ggplot2:facet_wrap]{ggplot2::facet_wrap()}}.

Arguments in \code{...} are currently passed to \code{\link[ggplot2:facet_wrap]{ggplot2::facet_wrap()}}
formals, such as \code{nrow}, \code{ncol}, and \code{scales} for more precise control.
}
\examples{
\dontshow{if (rlang::is_installed(c("ggplot2", "scales"))) withAutoprint(\{ # examplesIf}
data <- read_mnirs(
    example_mnirs("train.red"),
    nirs_channels = c(smo2 = "SmO2"),
    time_channel = c(time = "Timestamp (seconds passed)"),
    verbose = FALSE
)

## plot time labels as "hh:mm:ss"
plot(data, time_labels = TRUE)

data_list <- extract_intervals(
    data,
    start = by_time(2452, 3168),
    span = c(-60, 120),
    verbose = FALSE
)

## plot a list of mnirs data frames as faceted panels
plot(data_list, time_labels = TRUE)
\dontshow{\}) # examplesIf}
}
