I'm trying to increase the distance between the axis label and axis text (tick marks), but cannot find the right code how to do it. Can maybe somebody help?
library(ggplot2)
library(reshape2)
data<-read.csv("trial.csv",header=TRUE,dec=".",sep=',',na.strings="NA")
p1<-ggplot(data=data,aes(x=Year))+
geom_line(aes(y=Cumulative),linetype="solid",color="red",size=1.1)+
geom_point(aes(y=Cumulative),shape=1,color="red",size=3,stroke=1.5)+
geom_line(aes(y=Annual),linetype="solid",color="darkorange",size=1.1)+
geom_point(aes(y=Annual),shape=1,color="darkorange",size=3,stroke=1.5)+
scale_y_continuous(sec.axis=sec_axis(~.*1/10,name="Annual"))
p1+labs(x="Year",y="Cumulative")
p1+theme(axis.title.x=element_text(size=18),
axis.text.x=element_text(size=14),
axis.title.y=element_text(size=18),
axis.text.y=element_text(size=14),
axis.ticks=element_blank())
Unfortunately, I don't find a solution even after googling for a while. Any suggestions are welcome!