#5, First Floor, 4th Street , Dr. Subbarayan Nagar, Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to create bar chart in R?
Description

To create a bar chart for the given data using R programming.

Process

Bar Chart

   Representation data in rectangular bars with the length of the bar proportional to the value of the variable.

   R Function : barplot()

Sapmle Code

#Data Visualization in Bar Chart

#Read File
print(getwd())
setwd(“/home/soft13″)
print(getwd())
data<-read.csv(‘input.csv’)
print(data)

#Bar Chart
barplot(data$salary,names.arg = data$name,main=”Bar Plot”,xlab=”Name”,ylab=”Salary”,col=rainbow(length(data$salary)))
legend(“topright”,legend=data$name,fill=rainbow(length(data$salary)))

Screenshots