'Bar plot using mtcars

I would like to create a bar plot where x is represented by columns and y is represented by the value of mtcars. I have drawn an example for understanding.

ggplot(mtcars, aes(fill=mtcars[,1], y= ??? , x= mtcars[,mpg:carb])) + 
  geom_bar(position="stack", stat="identity")

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source