Add secondary axis as a dual axis in R plot

0 votes
Hi, I just started learning R. Can someone help how to add 3 axis i.e wrt 3 variables to a plot?
Jul 25, 2019 in Data Analytics by radha
2,096 views

1 answer to this question.

0 votes
You can add a secondary axis in ggplot by using sec.axis attribute in scale_* functions.

ggplot object + scale_x_continuous(sec.axis = axis calculation)

Ex:

> plot + scale_y_continuous(sec.axis = ~ .+2)
answered Nov 4, 2019 by keerthi

Related Questions In Data Analytics

+1 vote
0 answers
0 votes
1 answer

Save a plot as image on the disk using R

Consider for both the situations: 1. Image will ...READ MORE

answered Apr 14, 2018 in Data Analytics by Sahiti
• 6,370 points
2,170 views
0 votes
1 answer

Changing the order of bars in a bar-plot - ggplot2 - R

You can use the scale_x_discrete() function with ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,660 points
9,743 views
0 votes
1 answer

Showing percentage instead of counts in a bar plot - ggplot2 - R

Load the 'scales' package first, which gives ...READ MORE

answered May 29, 2018 in Data Analytics by Bharani
• 4,660 points
3,884 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
554 views
0 votes
1 answer

Duplicate axis for a R plot

Add duplicate axis using dup.axis attribute like ...READ MORE

answered Nov 4, 2019 in Data Analytics by radha
1,854 views
0 votes
0 answers

Edit date values in ggplot line chart -R

Hi, I want to edit the data ...READ MORE

Jul 25, 2019 in Data Analytics by rekha
502 views
0 votes
1 answer

Create a dual axis column/bar chart using ggplot in R

Add position = "stack" in geom_bar() function ...READ MORE

answered Nov 4, 2019 in Data Analytics by sindhu
4,674 views
+1 vote
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
1,841 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