How to add title in the barplot in R

0 votes

Hi Guys,

I have created one barplot in R. I want to add one title in the graph. How can I do that?

Oct 30, 2020 in Data Analytics by akhtar
• 38,230 points
1,417 views

1 answer to this question.

0 votes

Hi@akhtar,

The features of the bar chart can be expanded by adding more parameters. The main parameter is used to add the title. You can see the below example.

# Create the data for the chart
H <- c(7,12,28,3,41)
M <- c("Mar","Apr","May","Jun","Jul")
# Give the chart file a name
png(file = "barchart_months_revenue.png")
# Plot the bar chart 
barplot(H,names.arg=M,xlab="Month",ylab="Revenue",col="blue",
main="Revenue chart",border="red")

answered Oct 30, 2020 by MD
• 95,440 points

Related Questions In Data Analytics

0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,240 points
3,390 views
0 votes
1 answer

How to find out the package version which is loaded in R?

You can use sessionInfo() to accomplish that. > ...READ MORE

answered Apr 18, 2018 in Data Analytics by zombie
• 3,790 points
556 views
0 votes
1 answer

How to add leading zeros in R?

There are several solutions to this. One of ...READ MORE

answered Apr 30, 2018 in Data Analytics by Sahiti
• 6,370 points
24,000 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
4,236 views
+10 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,148 views
+1 vote
1 answer

Error saying "vector size cannot be NA" when using R with data mining

You can use the removesparseterm function.  Removes sparse ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
4,392 views
+1 vote
2 answers
0 votes
1 answer

Trying to find frequent itemsets of a data set using arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", "milk", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
571 views
0 votes
1 answer
0 votes
1 answer

How to create a barplot in R?

Hi@akhtar, A bar chart represents data in rectangular ...READ MORE

answered Oct 30, 2020 in Data Analytics by MD
• 95,440 points
475 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP