graph - Barplot with 2 Y-Axis in R -


i trying create two-way bar graph in r. or bar graph 2 y-axis different variables.

i have following code:

x<-c("1820s", "1830s", "1840s", "1850s", "1860s", "1870s", "1880s", "1890s", "1900s") y<- cbind(c(1.16, 1.36, 1.10, 1.16, 1.18, 1.19, 1.26, 1.32, 1.95) y2<-c(58.71, 54.42, 39.36, 41.7, 51.14, 50.35, 59.53, 58.88, 75.31)  bp<-barplot(t(y), beside=true) xlim<-c(floor(min(bp)), ceiling(max(bp))) par(new=true) 

however, here, i'm not sure how insert second variable.

i format of bargraph similar this.

enter image description here


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -