Learn R Programming

regclass (version 1.5)

segmented_barchart: Segmented barchart

Description

Produces a segmented barchart of the input variable, forcing it to be categorical if necessary

Usage

segmented_barchart(x)

Arguments

x
A vector. If numerical, it is treated as categorical variable in the form of a factor

Details

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.

References

Introduction to Regression and Modeling

Examples

Run this code
  data(STUDENT)
	segmented_barchart(STUDENT$Family)  #Categorical variable
	data(TIPS)
	segmented_barchart(TIPS$PartySize)  #Numerical variable treated as categorical

	 

Run the code above in your browser using DataLab