Home » R23 May 2017

R: Data Visualization – Creating Pie Chart, Bar Chart & Line Graph

This article shows how to create Pie chart, Bar chart & Line graph using R Programming Language.

Set Working Directory

Set a directory where you want to save the image of pie chart, bar chart & line graph.

Creating Pie Chart

We will create a pie chart with 3 labels: English, Math and Science. We add some values to the labels.

A new file named subject_pass.png will be created in your working directory. It contains the pie chart.

Creating the same chart as above but with rainbow color (brighter colors)

Creating Bar Chart

A new file named barchart.png will be created in your working directory. It contains the bar chart.

Creating Line Graphs

A new file named linechart.png will be created in your working directory. It contains the line chart with two lines.

Hope this helps. Thanks.

R

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed