June 2016
Beginner to intermediate
1783 pages
71h 22m
English
In this recipe, we will learn how to vary box widths in proportion to the number of observations for each variable.
Just like the previous recipe, we will continue to use the metals.csv example dataset for this recipe. So, let's first load it:
metals<-read.csv("metals.csv")Let's build a box plot with boxes of width proportional to the number of observations in the dataset:
boxplot(Cu ~ Source, data = metals,varwidth=TRUE, main="Summary of Copper concentrations by Site")

In the example, we set the varwidth argument to TRUE, which makes the width of the boxes proportional ...
Read now
Unlock full access