Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

piechart

Draw a Piechart With Percents or Counts in the Labels


Description

piechart is a front-end to the standard R pie function, with the capability of adding percents or counts to the pie-segment labels.

Usage

piechart(x, scale = c("percent", "frequency", "none"), 
  col = rainbow_hcl(nlevels(x)), ...)

Arguments

x

a factor or other discrete variable; the segments of the pie correspond to the unique values (levels) of x and are proportional to the frequency counts in the various levels.

scale

parenthetical numbers to add to the pie-segment labels; the default is "percent".

col

colors for the segments; the default is provided by the rainbow_hcl function in the colorspace package.

...

further arguments to be passed to pie.

Author(s)

See Also

Examples

with(Duncan, piechart(type))

RcmdrMisc

R Commander Miscellaneous Functions

v2.7-1
GPL (>= 2)
Authors
John Fox [aut, cre], Robert Muenchen [ctb], Dan Putler [ctb]
Initial release
2020-08-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.