View source: R/segmented_barchart.R
segmented_barchart | R Documentation |
Produces a segmented barchart of the input variable, forcing it to be categorical if necessary
segmented_barchart(x)
x |
A vector. If numerical, it is treated as categorical variable in the form of a factor |
Standard segmented barchart. Shaded areas are labeled with the levels they represent, and the percentage of cases with that level is labeled on the axis to the right.
Adam Petrie
Introduction to Regression and Modeling
data(STUDENT)
segmented_barchart(STUDENT$Family) #Categorical variable
data(TIPS)
segmented_barchart(TIPS$PartySize) #Numerical variable treated as categorical
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.