I'm trying to make a secondary axis graph with ggplot2, but after running it I get this error
(Error in seq.default(range[1], range[2], length.out = self$detail) : 'from' must be a finite number)
Can someone help me to solve it? My code looks like:
g3=ggplot(IBOCA_Nowcast[IBOCA_Nowcast$month=="febrero",],aes(x=date))+
geom_line(aes(y=NowCast12pm25, colour="Nowcast 12h"), size=0.1) +facet_wrap(~site,scales="free_y")+theme_bw()+
geom_line(aes(y=MM24h,colour="media movil 24h"), size=0.1)+facet_wrap(~site,scales="free_y")+theme_bw()+
geom_line(aes(y=Iboca_24h,colour="Iboca_24h"),size=0.1)+facet_wrap(~site,scales="free_y")+theme_bw()+
geom_line(aes(y=Iboca_NC,colour="Iboca_NC_12h"),size=0.1)+facet_wrap(~site,scales="free_y")+theme_bw()+
scale_y_continuous(sec.axis = sec_axis(~.,name="Iboca_24h"))+facet_wrap(~site,scales="free_y")+theme_bw()