Hello to all,
I'm totally new to R. I'm trying to create a ggplot.
I have a results: pairwise comparison among pops, but I am not able to visualize this results.
Before this script was functioning, but now I have this error message: Aesthetics must be either length 1 or the same as the data (10): ymin, ymax, x, y and colour
Please HELP me!!!
# create a djost dataframe
djost <- as.data.frame(myStats$bs_pairwise$djostEst)
djost
# The column names cause problems, so we can change them as follows:
colnames(djost) <- c("actual", "mean", "bcMean", "bucLow", "bucUp", "bcLow",
"bcUp")
djost <- as.data.frame(myStats$bs_pairwise$djostEst)
djost
actual mean BC_mean Lower_95%CI Upper_95%CI BC_Lower_95%CI
GS, vs. SKG, 0.0046213811 0.05240248 0.0046213811 1.220778e-02 0.11863985 -0.03557332
GS, vs. SK, 0.0197641329 0.04416205 0.0197641329 1.175667e-02 0.08890613 -0.01264124
GS, vs. S, 0.0199069822 0.04779573 0.0199069822 1.099478e-02 0.10265817 -0.01689397
GS, vs. G, 0.0695550681 0.09133387 0.0695550681 4.869468e-02 0.13675134 0.02691588
SKG, vs. SK, 0.0064952221 0.04129993 0.0064952221 2.664259e-03 0.10044395 -0.03214045
SKG, vs. S, -0.0004849614 0.03830387 -0.0004849614 3.880830e-04 0.10158782 -0.03840075
SKG, vs. G, 0.0761723533 0.12662858 0.0761723533 6.962183e-02 0.20055562 0.01916560
SK, vs. S, -0.0037050857 0.01828783 -0.0037050857 3.158278e-05 0.05109356 -0.02196133
SK, vs. G, 0.0771100669 0.10703520 0.0771100669 5.985370e-02 0.16542160 0.02992856
S, vs. G, 0.0853392210 0.11635003 0.0853392210 6.633928e-02 0.18182726 0.03532847
BC_Upper_95%CI
GS, vs. SKG, 0.07085876
GS, vs. SK, 0.06450821
GS, vs. S, 0.07476942
GS, vs. G, 0.11497254
SKG, vs. SK, 0.06563924
SKG, vs. S, 0.06279898
SKG, vs. G, 0.15009939
SK, vs. S, 0.02910064
SK, vs. G, 0.13549646
S, vs. G, 0.15081645
# plot the point estimates for each of your four pw comparisons
# with uncorrected and corrected 95% CIs
CI_type <- as.factor(c(rep("uc", nrow(djost)), rep("bc", nrow(djost))))
ggplot(djost, aes(x = c(1:nrow(djost),1:nrow(djost) + 0.5),
y = c(actual, actual), colour = CI_type)) +
geom_errorbar(aes(ymin = c(bucLow, bcLow), ymax = c(bucUp, bcUp)),
width = 0.3) +
geom_point() +
ylab(expression(D["Jost"])) +
xlab("Pairwise Comparison")
And then I have this error message, which I cannot solve:
Error: Aesthetics must be either length 1 or the same as the data (10): ymin, ymax, x, y and colour`Preformatted text`