How can I add line to show mean for each barplot, not for all dataset?

0 votes
Hi all, how can I add line to show mean for each barplot, not for all dataset?
Aug 29 in Data Analytics by ranjith
16 views

1 answer to this question.

0 votes

Hey ranjith, 

Use geom_hline() function to add reference lines in the same ggplot object.

Ex:

geom_hline(aes(yintercept = wt, colour = wt), mean_wt)
answered Oct 13 by Cherukuri
• 31,840 points

Related Questions In Data Analytics

0 votes
1 answer

How can I use R to list all files with a specified extension ?

fls <- list.files(pattern = "\\.dbf$") $ at the ...READ MORE

answered May 10, 2018 in Data Analytics by zombie
• 3,690 points
35 views
0 votes
1 answer

How can I reactively add actionButtons to the tableOutput?

Use DT for this purpose: library(shiny) library(DT) ui <- fluidPage( ...READ MORE

answered Dec 5, 2018 in Data Analytics by Maverick
• 10,040 points
61 views
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,130 points
431 views
0 votes
1 answer

How can I append rows to an R data frame?

Consider a dataSet i.e cicar(present under library ...READ MORE

answered May 8, 2018 in Data Analytics by zombie
• 3,690 points
98 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
116 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
160 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points
87 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
104 views
0 votes
1 answer

How to put border for all legends together and separate borders for each legend in ggplot?

Hi Anitha, There are 2 functions used to ...READ MORE

answered Jul 24 in Data Analytics by Cherukuri
• 31,840 points
49 views
0 votes
1 answer

How to add ggplot over each other?

Do you mean to add multiple geom ...READ MORE

answered Nov 3 in Data Analytics by anonymous
• 31,840 points
20 views