R language Access Menu

Stacked barplots

code: 
    > ggplot(bwdf[order(bwdf$smoke),], aes(race, age, fill=smoke))+ geom_bar(stat='identity')

The term “bwdf[order(bwdf$smoke),]” is used to sort the rows of bwdf dataset by smoke variable. 

output (graph): 

                  


    Comments & Feedback