У меня есть следующие данные, которые я пытаюсь построить.Я пытаюсь изменить ширину панели ошибок, но я сталкиваюсь с ошибкой, которая говорит Width not defined. Set with position_dodge(width = ?)
.Я пытался сделать position_dodge..но это не помогло.Есть предложения?
library(ggplot2)
time <- c("t1","t1","t1","t1","t1","t1","t2","t2","t2","t2","t2","t2")
species <- c(1,1,1,2,2,2,1,1,1,2,2,2)
value <- c(1,2,3,11,12,13,4,5,6,11,12,13)
df <- data.frame(time, species,value)
df$time <- as.factor(df$time)
df$species <- as.factor(df$species)
ggplot(df,aes(x=time, y=value, color = species, group = species)) + # Change fill to color
theme_bw() +
geom_point() +
stat_summary(fun.y=mean, position = "dodge") +
stat_summary(
geom="errorbar",
fun.data= mean_cl_boot,
width = 0.1, size = 0.2, col = "grey57") +
# Lines by species using grouping
stat_summary(aes(group = species), geom = "line", fun.y = mean) +
ylab("Fitness")