I'm trying to make a Caterpillar plot from the confident intervals of a series of glmm outputs. So, I made a simple table (tabla) with the Index names (8) the Parameters (3 for each index) and the Intervals (2 values for each Parameter = min_value - max_value). I 'd like my plot to be grouped by Index and by the 3 parameters of each index in the Y-axis.
I tried out with ggplot but my poor knowledge did not let me continue.
my code :
library(ggplot2)
read.csv("ggplot_modelos.csv", header = TRUE, sep = ";", dec = ".")-> tabla
View(tabla)
names(tabla)
ggplot(tabla, aes(Intervalls, Index) , geom_bar(aes(Intervals, Parameter)))
My data:
tabla <-
data.frame(
stringsAsFactors = FALSE,
Index = c("H","H","H","H","H","H",
"ADI","ADI","ADI","ADI","ADI","ADI","AEI","AEI",
"AEI","AEI","AEI","AEI","BIO","BIO","BIO","BIO",
"BIO","BIO","ACI","ACI","ACI","ACI","ACI","ACI","M",
"M","M","M","M","M","Ht","Ht","Ht","Ht","Ht",
"Ht","AR","AR","AR","AR","AR","AR"),
Parameter = c("Intercept","Intercept",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance","Intercept","Intercept",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance","(Intercept)","(Intercept)",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance","(Intercept)","(Intercept)",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance","(Intercept)","(Intercept)",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance","(Intercept)","(Intercept)",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance","(Intercept)","(Intercept)",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance","(Intercept)","(Intercept)",
"Species Richness","Species Richness","Relative Abundance",
"Relative Abundance"),
Intervalls = c(-0.63399094,0.10088021,
0.05111166,0.11374545,0.01356644,0.03568559,-0.63399094,
0.10088021,0.05111166,0.11374545,0.01356644,0.03568559,
-0.08921982,0.69843374,-0.11735036,-0.05706148,
-0.03492262,-0.01363224,-0.387777431,0.8894038,-0.01656506,
0.04067182,-0.004208021,0.01583599,-1.42348399,
0.78640078,0.13746715,0.21376064,0.06880861,0.09518447,
-0.44656228,0.46793251,0.03039887,0.05458163,
0.05991785,0.12952663,-0.384061,1.50738256,-0.2298068,
-0.1467239,-0.106336,-0.07786533,-0.54823458,1.23599168,
-0.04350877,-0.01813159,-0.09811032,-0.02568451)
)
I will appreciate if anyone can give me a hand here!