I intend to create a boxplot and highlight the significance level of pairwise comparisons. This has been dealt in a previous post.
When I do the same for my data-set, I get the following error:
"Incompatible lengths for set aesthetics: x, y"
Here's an example data-set to illustrate the problem -
data1<-data.frame(island = c("A", "B", "B", "A", "A"), count = c(2, 5, 12, 2, 3))
g1<-ggplot(data1) + geom_boxplot(aes(x = factor(island), y = count))
g1 + geom_path(x = c(1, 1, 2, 2), y = c(25, 26, 26, 25))
I get the error while running the third line of the code, while the boxplot turns out alright. I suspect I'm missing out on something very trivial, but I'm unable to catch it. I'd greatly appreciate any help.