Skip to content

Commit

Permalink
Minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohsen Sadatsafavi committed Jun 7, 2024
1 parent ceb865b commit 21589f4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions R/core.R
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,14 @@ plot.cumulcalib <- function(x,...)
#' @method plot cumulcalib
plot.cumulcalib <- function(x, method=NULL, draw_stat=TRUE, stat_col=c('blue','red'), draw_sig=TRUE, sig_level=c(0.95,0.95), x2axis=TRUE, y2axis=TRUE, ...)
{
if(!(method %in% names(x$by_method)))
if(is.null(method))
{
method <- x$method
}
else
{
stop("Error: the requested method for plot() was not provided in the submitted cumulcalib object.")
if(!(method %in% names(x$by_method)))
stop("The requested method has not been requested in the original cumulcalib() call")
}

oldpar <- par(no.readonly=TRUE)
Expand Down Expand Up @@ -474,7 +479,7 @@ summary.cumulcalib <- function(object, method=NULL, ...)
}
else
{
if(!("BM" %in% names(object$by_method)))
if(!(method %in% names(object$by_method)))
stop("The requested method has not been requested in the original cumulcalib() call")
}

Expand Down

0 comments on commit 21589f4

Please sign in to comment.