Im trying to do a barplot using three variables, movie runtime, moviecategory and movierating. I have movierating on the x axis and movieruntime on the y axis.
There are only 3 categories.
The bar plot is ok but instead of have just one bar for each relation between movieruntime and movie category I want to have three bars for each bar, each bar corresponding to each category. Do you know how to do that?
The code I have now is this, but just show one bar for each relation between movieruntime and movie rating. I want something like a grouped bar for each rating.
barplot(tapply(data$movieruntime, data$movierating, mean), ylim=c(0,1300))
Im trying like this now:
barchart(data$movierating~ data$movieruntime, groups=data$moviecategory, data, auto.key = list(columns = 3))
But Im get the bars on the horizontal not vertical and the movieruntime is on the x axis but I want on the y axis. Do you know how to fix?