I am having problems visualizing my data set. I skimmed through questions but couldn't quite find a suitable answer for myself. My data set has group names as columns and two rows of values. Here I am including an image of the data:
I need a boxplot with the row values on the x axis ("BodyGoal" and "BodySource") and the groups as bars (in such a way that for each x axis point there would be 3 bars representing the values from each group). Basically like this, preferably with hovering bars.
I am so sure that this is super easy to do but I am new to R and due to the pandemic I don't get to interact with my teachers as much, so I really need some help with this. Thank you in advance!
I run two lines but neither is giving me the solution I want:
barplot(t(bodydf), legend.text = T)
(thanks to rawr), however this is giving me all my groups stacked on top of each other, i need them to be side by side
I also have this but this is even further away than what I require:
ggplot(stack(bodydf), aes(x=ind, y=values)) +geom_boxplot()