After some search about my topic without a satisfing answer or one I can adapt to my data, here one more question about plotting a grouped (or stacked) barplot with either ggplot2 or barplot.
I have the following table:
Table_lakes
Lake Size Lake Mean Lake Med Lake Max Lake Min
1: 2419723 6.557441 6.562879 9.107328 4.7520108
2: 737345 1.569643 1.562833 2.643082 0.9065250
3: 1904419 3.006871 2.989362 4.100533 2.3644874
4: 633220 3.170494 3.154871 4.580919 1.6915103
5: 3417157 4.587906 4.589763 5.865326 3.5397623
6: 3046643 1.784759 1.783092 2.921241 0.6835220
7: 3868608 2.152185 2.188566 5.382725 0.1158626
8: 11952064 9.391443 9.342757 12.524334 8.5829620
9: 2431961 7.796330 7.833883 9.186878 5.9242287
10: 5624563 8.444996 8.482042 12.207799 7.3909297
11: 2430490 3.474408 3.438787 5.186004 2.3032870
I would like to creat a grouped barplot for each ID (1-11) with the values of the mean, med, max and min. The Lake size is kind of irrelevant here.
So far I tried to help myself with this: https://www.theanalysisfactor.com/r-11-bar-charts/ and Grouped barplot in ggplot2 in R
One of my tries was this:
ggplot(Table_lakes[Table_lakes$`Lake Mean` & Table_lakes$`Lake Max`],
aes(x = factor(Name), y = Table_lakes)) +
geom_bar(stat = "identity", position="dodge") +
labs(x = "Name", y = "Height")
The y axis should show the vales (about 0 to 15), the x axis the grouped Min, max, med, mean for Lakes 1 to 11 each.
Would be great if someone can provide some help. Thanks!
