R/plot_DRdata_2d.R

Defines functions plot_DRdata_2d

plot_DRdata_2d <- function(y, rug, main, ylim, colr, lwd, lty){
  colr <- if(is.null(colr)) "black" else colr
  y.dens <- density(y, from=0, to=1)
  ylims <- c(ifelse(is.null(ylim[1]), 0, ylim[1]),
             ifelse(is.null(ylim[2]), max(y.dens$y), ylim[2]))
  plot(y.dens, type="l", ylim=ylims, main=main, col=colr, lwd=lwd, lty=lty)
  if(rug) rug(y)
}

Try the DirichletReg package in your browser

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

DirichletReg documentation built on May 18, 2021, 5:06 p.m.