Issues are resolved.
Adjust the positions of errorbars.
Add group = FertMethod
in geom_errorbar
's aes
setting.
Adjust the widths of bars.
When multiple bars share the same x-axis value (i.e., grouped bars), each bar appears narrower.
When there's only one bar for a given x-axis value, it appears wider — because it's not being dodged.
In the dataset transformation, use complete(DAS, FertMethod, Location, fill = list(MeanHeight = NA, StdError_Height = NA, MeanNode = NA, StdError_Node = NA ))
.
Due to NA
, in ggplot
when importing the dataset, use filter(Nutrition_FertMethod_Measurements, !is.na(MeanHeight))
.