I want to create a clustered Bar chart in R using 2 numeric variables, e.g:
Movie Genre (X-axis) and Gross$ + Budget$ should be Y-axis
It's a very straightforward chart to create in Excel. However, in R, I have put Genre
in my X-axis and Gross$
in Y-axis.
My question is: Where do I need to put another Numeric variable ie Budget$
in my code so that the new Budget$
will be visible beside Gross$
in the chart?
Here is my Code:
ggplot(data=HW, aes(reorder(x=HW$Genre,-HW$Gross...US, sum),
y=HW$Gross...US))+
geom_col()
P.S. In aes
I have just put reorder to sort the categories.
Appreciate help!