% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/krnn.R
\name{plot_krnn_cv}
\alias{plot_krnn_cv}
\title{Plot a krnn_cv Object}
\usage{
plot_krnn_cv(x, ...)
}
\arguments{
\item{x}{A \code{"krnn_cv"} object returned by \code{\link{krnn_cv}}.}

\item{...}{Additional graphical parameters passed to
\code{\link[graphics]{plot.default}}.}
}
\value{
Invisibly returns \code{x}.
}
\description{
Plots the cross-validation error curve against the neighbourhood size k,
with standard-error bars and a vertical line at the selected optimum.
}
\examples{
\donttest{
set.seed(3)
M <- 80
t  <- seq(0, 1, length.out = M)
X0 <- t(replicate(50, sin(2 * pi * t) + rnorm(M, sd = 0.4)))
X1 <- t(replicate(50, cos(2 * pi * t) + rnorm(M, sd = 0.4)))
X  <- rbind(X0, X1)
y  <- rep(0:1, each = 50)
cv <- krnn_cv(X, y, k_max = 20, R = 5, seed = 1)
plot_krnn_cv(cv)
}

}
