R/lines_continuous.R

Defines functions .lines_continuous

.lines_continuous <- function(fun, plotStructure, ...) {
  if ("pdf" %in% fun) {
    graphics::lines(x = plotStructure$points, y = plotStructure$pdf, ...)
  }

  if ("cdf" %in% fun) {
    graphics::lines(x = plotStructure$points, y = plotStructure$cdf, ...)
  }

  if ("quantile" %in% fun) {
    graphics::lines(x = plotStructure$cdf, y = plotStructure$points, ...)
  }

  if ("survival" %in% fun) {
    graphics::lines(x = plotStructure$points, y = plotStructure$survival, ...)
  }

  if ("hazard" %in% fun) {
    graphics::lines(x = plotStructure$points, y = plotStructure$hazard, ...)
  }

  if ("cumhazard" %in% fun) {
    graphics::lines(plotStructure$points, y = plotStructure$cumhazard, ...)
  }
}

Try the distr6 package in your browser

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

distr6 documentation built on March 28, 2022, 1:05 a.m.