aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2014-11-23 16:24:14 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2014-11-23 16:24:14 +0100
commitc97a47bcce5455478a18dcdcd71f4a2f2344bce0 (patch)
tree97d2a9b15fc273b3d7fedb10671e43d2b968804c /R
parent10100d5ad4fd25abee99843829481c662c93edcc (diff)
Avoid spurious warning in mkinparplot, bump version
Diffstat (limited to 'R')
-rw-r--r--R/mkinparplot.R14
1 files changed, 10 insertions, 4 deletions
diff --git a/R/mkinparplot.R b/R/mkinparplot.R
index 4abecab9..b2debe9d 100644
--- a/R/mkinparplot.R
+++ b/R/mkinparplot.R
@@ -39,6 +39,8 @@ mkinparplot <- function(object) {
for (type in names(n.plot)) {
parnames <- get(type)
values <- bpar[parnames]
+ values_with_confints <- data.frame(t(subset(data.frame(t(values)), !is.na(Lower))))
+ parnames_with_confints <- names(values_with_confints)
xlim = switch(type,
state.optim = range(c(0, unlist(values)),
na.rm = TRUE, finite = TRUE),
@@ -48,7 +50,10 @@ mkinparplot <- function(object) {
na.rm = TRUE, finite = TRUE),
fractions.optim = range(c(0, 1, unlist(values)),
na.rm = TRUE, finite = TRUE))
- stripchart(values["Estimate", ][length(parnames):1],
+ parname_index <- length(parnames):1 # Reverse order for strip chart
+ names(parname_index) <- parnames
+ parnames_with_confints_index <- parname_index[parnames_with_confints]
+ stripchart(values["Estimate", ][parname_index],
xlim = xlim,
ylim = c(0.5, length(get(type)) + 0.5),
yaxt = "n")
@@ -58,9 +63,10 @@ mkinparplot <- function(object) {
text(ifelse(position == "left", min(xlim), max(xlim)),
length(parnames):1, parnames,
pos = ifelse(position == "left", 4, 2))
- values.upper.nonInf <- ifelse(values["Upper", ] == Inf, 1.5 * xlim[[2]], values["Upper", ])
- arrows(as.numeric(values["Lower", ]), length(parnames):1,
- as.numeric(values.upper.nonInf), length(parnames):1,
+
+ values_with_confints.upper.nonInf <- ifelse(values_with_confints["Upper", ] == Inf, 1.5 * xlim[[2]], values_with_confints["Upper", ])
+ arrows(as.numeric(values_with_confints["Lower", ]), parnames_with_confints_index,
+ as.numeric(values_with_confints.upper.nonInf), parnames_with_confints_index,
code = 3, angle = 90, length = 0.05)
}
par(oldpars)

Contact - Imprint