Я следую этому руководству, чтобы построить ленточную диаграмму с полосами погрешностей, но не могу контролировать ширину полосы.
# Convert the variable dose from a numeric to a factor variable
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
# Plot
ggplot(data = ToothGrowth, aes(x = dose, y = len, color = dose)) +
geom_jitter(position = position_jitter(0.2), size = 2, alpha = 0.3) +
stat_summary(fun.data = mean_se, geom = "pointrange", size = 1.2)
Когда я добавляю аргумент width = 2, R возвращает:
Warning message:
In stat_summary(fun.data = mean_se, geom = "pointrange", size = 1.2, :
Ignoring unknown parameters: width
Как я могу контролировать ширину этих полос ошибок?





Думаю, ты хочешь linewidth = 2 ?
ggplot(data = ToothGrowth, aes(x = dose, y = len, color = dose)) +
geom_jitter(position = position_jitter(0.2), size = 2, alpha = 0.3) +
stat_summary(fun.data = mean_se, geom = "pointrange", size = 1.2, linewidth = 2)