R/plot.cdslist.R

Defines functions plot.cdslist

Documented in plot.cdslist

#' Plot a \code{cdslist} Object
#' 
#' Create a scree plot and bubble plots for all elements in a \code{cdslist} object.
#' 
#' @param x An object of class \code{cdslist}.
#' @param which The which argument passed to \code{\link{plot.cds}}.
#' @param \dots Additional arguments passed to \code{\link{plot.cds}}.
#' @method plot cdslist
#' @export
plot.cdslist <- function(x, which = 2L, ...){
  loss <- sapply(x, "[[", "minloss")
  K <- sapply(x, "[[", "K")
  plot(K, loss, type = "b", pch = 16, main = "Scree Plot", xlab = "K", ylab = "Loss")
  invisible(lapply(x, plot, which = which, ...))
}

Try the cds package in your browser

Any scripts or data that you put into this service are public.

cds documentation built on May 2, 2019, 5:54 a.m.