How to plot pie chart in R?

How to plot pie chart in R?

How to plot pie chart in R?

This recipe helps you plot pie chart in R


Recipe Objective

How to plot a pie chart in R? A pie chart is a circular garph that represents data. It is a pictorial representation of the data. In a pie chart,the chart is divided into slices, where each slice is a proportional part of the whole data. The pie chart is a very useful tool for data analysis. This recipe demonstrates an example on pie charts.

Step 1 - Define a vector

Syntax for pie chart plots - pie(x, labels, radius, main, col) where, x - a vector that contains the data to be plotted, labels - description that is to be given for each slice. radius(optional) - indicates the radius of the pie circle main(optional) - the title of the graph col(optional) - the color palette

x <- c(10,20,30,40,50) labels <- c("A","B","C","D","E")

Step 2 - Plot the pie chart

pie(x,labels,main="Pie chart")

Relevant Projects

Resume parsing with Machine learning - NLP with Python OCR and Spacy
In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

Predict Credit Default | Give Me Some Credit Kaggle
In this data science project, you will predict borrowers chance of defaulting on credit loans by building a credit score prediction model.

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

Loan Eligibility Prediction using Gradient Boosting Classifier
This data science in python project predicts if a loan should be given to an applicant or not. We predict if the customer is eligible for loan based on several factors like credit score and past history.

PySpark Tutorial - Learn to use Apache Spark with Python
PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

Human Activity Recognition Using Multiclass Classification in Python
In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.

Demand prediction of driver availability using multistep time series analysis
In this supervised learning machine learning project, you will predict the availability of a driver in a specific area by using multi step time series analysis.

German Credit Dataset Analysis to Classify Loan Applications
In this data science project, you will work with German credit dataset using classification techniques like Decision Tree, Neural Networks etc to classify loan applications using R.

Mercari Price Suggestion Challenge Data Science Project
Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.

Credit Card Fraud Detection as a Classification Problem
In this data science project, we will predict the credit card fraud in the transactional dataset using some of the predictive models.