A pie chart of a qualitative data sample consists of pizza wedges that shows the frequency distribution graphically.
In the data set painters, the pie chart of the School variable is a collection of pizza wedges showing the proportion of painters in each school.
Find the pie chart of the painter schools in the data set painters.
We first apply the table function to produce the frequency distribution of School.
> school = painters$School # the painter schools
> school.freq = table(school) # apply the table function
Then we apply the pie function to produce its pie chart.
The pie chart of the school variable is:
To colorize the pie chart, we select a color palette and set it in the col argument of pie.
+ "orange", "blue", "pink", "cyan")
> pie(school.freq, # apply the pie function
+ col=colors) # set the color palette
Find the pie chart of the composition scores in painters.