Create a dual axis column bar chart using ggplot in R

0 votes

Hi, i need to create a dual axis bar chart and also column chart using 1 variable and a categarical column. Can someone help using ggplot?

Like below charts (only bars)

  

Jul 22, 2019 in Data Analytics by riya
4,633 views

1 answer to this question.

0 votes

Add position = "stack" in geom_bar() function to stack bar over each other.

See the below example.

> ggplot(mpg, aes(displ, hwy, fill = factor(cyl))) + geom_bar(stat = "identity",position = "stack")
answered Nov 4, 2019 by sindhu

Related Questions In Data Analytics

+1 vote
0 answers
0 votes
1 answer

Rename a single column in dataframe using R

colnames(Samp)[2] <- "newname2" This sets the name of ...READ MORE

answered Apr 13, 2018 in Data Analytics by kappa3010
• 2,090 points
2,116 views
0 votes
1 answer

How to create a box-plot using “plotly” in R?

You can use this command to create ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
7,809 views
+5 votes
0 answers
0 votes
1 answer

How to plot side-by-side Plots with ggplot2 in R?

By Using gridExtra library we can easily ...READ MORE

answered Apr 16, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by MD 8,839 views
0 votes
1 answer
0 votes
0 answers

Chart/plot to show 3 dimensions in a chart - R

Hi, I want to show chart with ...READ MORE

Jul 12, 2019 in Data Analytics by kalyan
544 views
+1 vote
2 answers

change the color for bars in geom_bar in ggplot

Hi @radha, You can have 2 types of ...READ MORE

answered Jul 24, 2019 in Data Analytics by Cherukuri
• 33,030 points
35,746 views
0 votes
1 answer

Add secondary axis as a dual axis in R plot

You can add a secondary axis in ...READ MORE

answered Nov 4, 2019 in Data Analytics by keerthi
2,074 views
0 votes
1 answer

Replace comma with a period in data cleaning using R

You can use the scan function in ...READ MORE

answered Nov 13, 2018 in Data Analytics by Maverick
• 10,840 points
3,838 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