Search This Blog

Pie Charts to visualize goal contribution of Samsunspor strikers

A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion. In a pie chart, the arc length of each slice is proportional to the quantity it represents. Pie charts are widely used to show percentage or proportional data and usually the total sum of all segments needs to equal 100%.

There are several R functions that can be used to create a pie chart, some of the most popular ones are:

  1. pie() : This is a basic function in R to create a pie chart. It takes in a numeric vector of values as input and creates a pie chart with each element of the vector representing the proportion of the corresponding slice.

pie(x, labels, radius, main, col, clockwise)

Following is the description of the parameters used −

  • x is a vector containing the numeric values used in the pie chart.
  • labels is used to give description to the slices.
  • radius indicates the radius of the circle of the pie chart.(value between −1 and +1).
  • main indicates the title of the chart.
  • col indicates the color palette.
  • clockwise is a logical value indicating if the slices are drawn clockwise or anti clockwise.

  1. pie3D() : This function creates a 3D pie chart. It takes in the same input as the pie() function, but also allows for additional customization options such as colors, labels, and explode value. 
   3. ggplot2::ggpie() : This function is part of the ggplot2 library, and allows for more advanced customization options for creating a pie chart. It also allows for the creation of a pie chart with multiple layers and the use of different scales.

You can use any of the above functions to create a pie chart in R, depending on your specific needs and the level of customization you require.

0 Comments:

Post a Comment