This program generates a forest plot for the confidence interval of each individual of the input data (as row number) and the corresponding observed value of the statistic.
eco.forestplot(input, xlabel = NULL, ylabel = NULL, titlelabel = NULL, legendlabel = NULL, interactivePlot = TRUE, ...) # S4 method for eco.lsa eco.forestplot(input, rescaled = FALSE, xlabel, ylabel, titlelabel, legendlabel, interactivePlot = TRUE) # S4 method for dataframeORmatrix eco.forestplot(input, xlabel, ylabel, titlelabel, legendlabel, interactivePlot = TRUE)
input | Matrix/data frame, with three columns in the folowing order: observed value, lower and upper values of the confidence interval. |
---|---|
xlabel | Optional label for x axis. |
ylabel | Optional label for y axis. |
titlelabel | Optional title label. |
legendlabel | Optional legend label. |
interactivePlot | Show an interactive plot via plotly? (default: TRUE) |
... | Additional elements to the generic. |
rescaled | rescale values to [-1, 1] range? |
# NOT RUN { require(ggplot2) # simulated confidence intervals for the null hypotesis of a variable "a" set.seed(8) a<-runif(10, -2, 2) infer <- runif(10, -1, 1) super <- runif(10, -1, 1) infer2 <- pmin(infer, super) super2 <- pmax(infer, super) data <- data.frame(a, infer2, super2) forest <- eco.forestplot(data) forest # the forestplot method support the use of ggplot2 syntax with ggplot2 graphs forest <- eco.forestplot(data, interactivePlot = FALSE) forest <- forest + theme_bw() + theme(legend.position="none") forest # }