[Genabel-commits] r1565 - pkg/MetABEL/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Jan 26 23:31:35 CET 2014
Author: lckarssen
Date: 2014-01-26 23:31:35 +0100 (Sun, 26 Jan 2014)
New Revision: 1565
Modified:
pkg/MetABEL/R/forestplot.R
Log:
Fix NOTEs when running R CMD check (lower=F in call to pchisq() should be lower.tail=FALSE).
Also a few minor other fixes of arguments and two error messages.
Modified: pkg/MetABEL/R/forestplot.R
===================================================================
--- pkg/MetABEL/R/forestplot.R 2014-01-26 22:28:08 UTC (rev 1564)
+++ pkg/MetABEL/R/forestplot.R 2014-01-26 22:31:35 UTC (rev 1565)
@@ -14,11 +14,11 @@
mse <- sqrt(invsumw2)
npop <- length(estimate)
estimate[npop+1] <- mestimate
- se[npop+1] <- mse
- labels[npop+1] <- "Pooled"
+ se[npop+1] <- mse
+ labels[npop+1] <- "Pooled"
chi2 <- round(estimate * estimate / (se * se), 2)
p <- sprintf("%5.1e", pchisq(estimate * estimate / (se * se),
- 1, lower=F))
+ 1, lower.tail=FALSE))
## p[as.numeric(p)<0] <- "<1.e-16"
if (CI > 1 || CI < 0) {
@@ -44,17 +44,17 @@
maxv <- max(upper)
maxv <- maxv + abs(maxv / 10)
maxv <- max(rbnd, maxv)
- hgt <- (length(estimate) + 1) * del
+ hgt <- (length(estimate) + 1) * del
- if (any(is.na(estimate))) stop("estimate got NAs")
- if (any(is.na(se))) stop("se got NAs")
+ if (any(is.na(estimate))) stop("estimate contains NAs")
+ if (any(is.na(se))) stop("se contains NAs")
plot(x=c(cntr, cntr), y=c(0, hgt), xlim=c(minv, maxv),
- ylim=c(0, hgt), typ="l", lwd=2, xlab="Beta", ...)
+ ylim=c(0, hgt), type="l", lwd=2, xlab="Beta", ...)
for (i in c(1:(length(estimate)-1))) {
points(x=c(lower[i], upper[i]), y=c((i) * del, (i) * del),
- typ="l", lwd=2)
+ type="l", lwd=2)
points(x=c(estimate[i]), y=c((i) * del), pch=19, cex=1)
text(estimate[i], i * del + 1,
paste(labels[i], " (Chi2=", chi2[i], ", P=", p[i],
@@ -65,16 +65,16 @@
for (i in c(length(estimate))) {
points(x=c(lower[i], estimate[i]),
y=c((i) * del, (i) * del + hoff),
- typ="l", lwd=2)
+ type="l", lwd=2)
points(x=c(estimate[i], upper[i]),
y=c((i) * del + hoff, (i) * del),
- typ="l", lwd=2)
+ type="l", lwd=2)
points(x=c(upper[i], estimate[i]),
y=c((i) * del, (i) * del - hoff),
- typ="l", lwd=2)
+ type="l", lwd=2)
points(x=c(lower[i], estimate[i]),
y=c((i) * del, (i) * del - hoff),
- typ="l", lwd=2)
+ type="l", lwd=2)
text(estimate[i], i * del + 5,
paste(labels[i], " (Chi2=", chi2[i], ", P=", p[i],
")", sep=""),
More information about the Genabel-commits
mailing list