Creating a Bar Chart in R

Premium

In R, we can create a bar plot using the barplot() function. A Bar Plot or Bar Graph is primarily used to compare values. It presents grouped data using rectangular bars whose lengths are proportional to the values that they represent. Let's take our Product Sales data where we have the Revenue and Gross Margin for each order along with various attributes such as ProductLine, RetailerType, OrderMethod etc. We can use this data to create a bar chart which plots the total or average sales on y-axis as bars and the x-axis as one of these factors that we are interested in such as ProductLine.

Continue Reading
Premium Content

This tutorial is a part of the course Data Visualization with R. This is a premium course. The purchase options for the course are provided below. With this course, you get access to complete course content, source code, practical exercises, and all resources that are a part of the course.

Lifetime Premium Membership
$250
$179

Get unlimited access to all courses and premium content

Join Premium
Individual Course
$7

Purchase this course individually

Purchase CourseView Course Details
What's Included:
Complete access to course content and updates
All downloadable resources
Interactive course quizzes
Practice exercises and sample code
Ad-free learning experience