R/plotlambdaSelection.r

Defines functions plot.lambdaSelection

Documented in plot.lambdaSelection

plot.lambdaSelection <- function(x, ...){
  	if (!inherits(x, "lambdaSelection")) stop("use only with \"lambdaSelection\" object")
  	
  	if(length(x$criterion)==2)
  	{
  	  ask = prod(par("mfcol")) < length(x$criterion) 
      one.fig <- prod(par("mfcol")) == 1
      if (ask) {
        oask <- devAskNewPage(TRUE)  # ask for new page
        on.exit(devAskNewPage(oask)) # exit the format plot (if true) 
      }
  	  for (i in 1:2) plot(x$lambda, x$crit.coef[[i]], ...)
  	}
  	else{
  	  	plot(x$lambda, x$crit.coef,...)
  	}  
  	 	
  			
}

Try the ldstatsHD package in your browser

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

ldstatsHD documentation built on Aug. 14, 2017, 5:06 p.m.