Pie Chart
Pie charts are used to visualize the relative proportions or percentages of different categories in a dataset. In a pie chart, each category is represented by a slice of the pie, with the size of each slice proportional to the percentage of observations in that category.
R
# Create a dataset x <- c (30, 20, 10, 5, 35) # Create a pie chart pie (x, labels = c ( "Category 1" , "Category 2" , "Category 3" , "Category 4" , "Category 5" ), main = "Pie Chart of x" , col = rainbow ( length (x))) |
Output:
In this example, we use the pie() function to create a pie chart of the “Species” variable in the iris dataset. The table() function is used to count the number of observations in each category, and the main argument is used to add a title to the plot.
Graphical Data Analysis in R
Graphical Data Analysis (GDA) is a powerful tool that helps us to visualize and explore complex data sets. R is a popular programming language for GDA as it has a wide range of built-in functions for producing high-quality visualizations. In this article, we will explore some of the most commonly used GDA techniques in the R Programming Language.
For the data visualization, we will be using the mtcars dataset which is a built-in dataset in R that contains measurements on 11 different attributes for 32 different cars.