The below example demonstrates how to use the
pareto_plot() function from the nomiShape
package to create a Pareto chart for a nominal variable “species” in the
starwars dataset. Pareto charts help visualize the
frequency distribution of categories along with their cumulative
percentages.
pareto(starwars, "species")
#> Category Freq cumulative cumulative_percentage
#> 1 Human 35 35 42.16867
#> 2 Droid 6 41 49.39759
#> 3 Gungan 3 44 53.01205
#> 4 Kaminoan 2 46 55.42169
#> 5 Mirialan 2 48 57.83133
#> 6 Twi'lek 2 50 60.24096
#> 7 Wookiee 2 52 62.65060
#> 8 Zabrak 2 54 65.06024
#> 9 Aleena 1 55 66.26506
#> 10 Besalisk 1 56 67.46988
#> 11 Cerean 1 57 68.67470
#> 12 Chagrian 1 58 69.87952
#> 13 Clawdite 1 59 71.08434
#> 14 Dug 1 60 72.28916
#> 15 Ewok 1 61 73.49398
#> 16 Geonosian 1 62 74.69880
#> 17 Hutt 1 63 75.90361
#> 18 Iktotchi 1 64 77.10843
#> 19 Kaleesh 1 65 78.31325
#> 20 Kel Dor 1 66 79.51807
#> 21 Mon Calamari 1 67 80.72289
#> 22 Muun 1 68 81.92771
#> 23 Nautolan 1 69 83.13253
#> 24 Neimodian 1 70 84.33735
#> 25 Pau'an 1 71 85.54217
#> 26 Quermian 1 72 86.74699
#> 27 Rodian 1 73 87.95181
#> 28 Skakoan 1 74 89.15663
#> 29 Sullustan 1 75 90.36145
#> 30 Tholothian 1 76 91.56627
#> 31 Togruta 1 77 92.77108
#> 32 Toong 1 78 93.97590
#> 33 Toydarian 1 79 95.18072
#> 34 Trandoshan 1 80 96.38554
#> 35 Vulptereen 1 81 97.59036
#> 36 Xexto 1 82 98.79518
#> 37 Yoda's species 1 83 100.00000Another example using the mpg dataset to visualize the
distribution of the “manufacturer” variable.