From abcd6020480d626bc4aa2ea7373297f73a7a0e1f Mon Sep 17 00:00:00 2001 From: Andre Chalom Date: Thu, 28 May 2015 19:06:46 -0300 Subject: [PATCH] Quickfix for #52 plotprofmle was issuing an error when the entire profile was lower than "ratio", i.e., no blue line was to be drawn. Fixed adding an "if" to check for that condition --- R/plotprofmle.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/plotprofmle.R b/R/plotprofmle.R index 6807b2b..40530ce 100644 --- a/R/plotprofmle.R +++ b/R/plotprofmle.R @@ -41,6 +41,7 @@ plotprofmle <- function(profobj, nseg=20, ratio=log(8), which=1:length(profobj@p change <- (interpol$y - ratio)[2:l] * (interpol$y - ratio)[1:(l-1)] endpoints <- which(change < 0) corr <- (interpol$x[2]-interpol$x[1])/2 + if(length(endpoints) > 0) for (j in 1:(length(endpoints)/2)) { lower <-interpol$x[endpoints[(2*j)-1]]+corr upper <- interpol$x[endpoints[2*j]]+corr