From 9d7fda35874b71319f71c2f59de879fd10a6cd89 Mon Sep 17 00:00:00 2001 From: "Pedro A. Campana" <68815323+alonsocampana@users.noreply.github.com> Date: Tue, 25 Apr 2023 16:47:24 +0200 Subject: [PATCH] Update nlme_fit.R Fixed support for curves with different number of points instead of fixed 9 --- R/nlme_fit.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/nlme_fit.R b/R/nlme_fit.R index 5cb0a14..8ff84d0 100755 --- a/R/nlme_fit.R +++ b/R/nlme_fit.R @@ -97,8 +97,9 @@ fitModel <- function(gDat, vStart = c(8.886464, 1.495953 ), bLargeScale=TRUE, bS } # coding of relative kill (1-viability) correct; mean of gDat$y at gDat$x==9 should be higher than at min(gDat$x) tmp.minx <- min(gDat$x) + tmp.maxx <- max(gDat$x) tmp.whichxmin <- which(gDat$x == tmp.minx) - tmp.whichxmax <- which(gDat$x == 9) + tmp.whichxmax <- which(gDat$x == tmp.maxx) tmp.ymin <- mean(stats::na.omit(gDat$y[tmp.whichxmin])) tmp.ymax <- mean(stats::na.omit(gDat$y[tmp.whichxmax])) if(tmp.ymin > tmp.ymax){