"Error: No layers in plot" when using ggplot
ggplot2, r
Solution
Since you have presummarised data, you need to specify `stat = "identity"` in `geom_bar`.
library(ggplot2)
ggplot(AD0, aes(group, mean)) + geom_bar(stat = "identity")
Furthermore, I suppose you want to use `group` for the x-axis and `mean` for the y-axis. I switched the order of both names.
Problem
I got a simple data.frame (AD0) with basic statistical values and the factor(group): ``` mean se sd median group value1 0.725 0.07149951 0.4522026 1 1 value2 0.650 0.07637626 0.4830459 1 2 value3 0.175 0.06084343 0.3848076 0 3 value4 0.375 0.07752171 0.4902903 0 4 ``` I tried to make a simple barplot with: ``` p <- ggplot(AD0, aes(mean,group)) + geom_bar() ``` However, I get the message: "Error: No layers in plot" It is such a simple thing and I can't get my head around why its not working. I would be really glad if somebody could help me