% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dm.na.interpolation.R
\name{plot.dm_na_interpolation}
\alias{plot.dm_na_interpolation}
\title{Plot method for dendrometer NA interpolation results}
\usage{
\method{plot}{dm_na_interpolation}(
  x,
  type = NULL,
  series = NULL,
  metric = "MdAPE",
  original = NULL,
  start = NULL,
  end = NULL,
  free_y = TRUE,
  ncol = 1,
  facet = TRUE,
  empty_gaps = c("plot", "error"),
  ...
)
}
\arguments{
\item{x}{Object returned by \code{dm.na.interpolation()}.}

\item{type}{Character. Plot type:
\code{"gaps"}, \code{"interpolation"}, or \code{"assessment"}.
If omitted, the default is:
\itemize{
  \item \code{"assessment"} when assessment exists,
  \item \code{"interpolation"} when filled data exist,
  \item \code{"gaps"} when gaps exist but data were not filled,
  \item otherwise \code{"interpolation"}.
}}

\item{series}{Optional character vector of series names to plot.}

\item{metric}{Character assessment metric used when \code{type = "assessment"}.}

\item{original}{Optional original input data frame used before interpolation.}

\item{start}{Optional start datetime for subsetting.}

\item{end}{Optional end datetime for subsetting.}

\item{free_y}{Logical. If \code{TRUE}, facets use free y scales.}

\item{ncol}{Integer. Number of facet columns.}

\item{facet}{Logical. If \code{TRUE}, facet assessment plots by series.}

\item{empty_gaps}{Character. Behavior when \code{type = "gaps"} but no gaps are
present: \code{"plot"} for an informative empty plot, or \code{"error"}.}

\item{...}{Further arguments.}
}
\value{
A \code{ggplot2} object.
}
\description{
S3 plot method for objects returned by \code{\link{dm.na.interpolation}}.
}
\examples{
\donttest{
library(dendRoAnalyst)
data(nepa17)

## No gaps: defaults to time-series plot
#res0 <- dm.na.interpolation(nepa17[1:1000, ], resolution = 60)
#plot(res0)
#plot(res0, type = "gaps")
#plot(res0, type = "gaps", empty_gaps = "error")

## Filled data
#res1 <- dm.na.interpolation(
#  nepa17[1:1000, ],
#  resolution = 60,
#  fill = TRUE,
#  method = "spline"
#)
#plot(res1)
#plot(res1, type = "gaps")
#plot(res1, type = "interpolation", original = nepa17[1:1000, ])

## Assessed data
#res2 <- dm.na.interpolation(
#  nepa17[1:1000, ],
#  resolution = 60,
#  fill = TRUE,
#  method = "seasonal",
#  assess = TRUE
#)
#plot(res2)
#plot(res2, type = "assessment", metric = "MdAPE")
}

}
