1
I have little experience with R and am picking up a bit to generate a ggplot with 5 geom_lin. Could you help me?
The database is five annual series in months.
2014 2015 2016 2017 2018
jan 10 8 7,5 5 9
Fev 11 12 8 2,35 4,1
Mar 7,5 9 2,5 1,7 3,57
Abr 2,78 11,5 21 15 18
Mai 10 8 7,5 5 9
jun 11 12 8 2,35 4,1
jul 11 12 8 2,35 4,1
ago 7,5 9 2,5 1,7 3,57
Set 7,5 9 2,5 1,7 3,57
out 2,78 11,5 21 15 18
nov 10 8 7,5 5 9
dez 11 12 8 2,35 4,1
data.frame(dados)
a= dados$2014
b= dados$2015
c= dados$2016
d= dados$2017
e= dados$2018
f= dados$meses
ggplot(data=dados, aes(meses())+
geom_line(aes(y=a), color="red")+
geom_line(aes(y=b), color="blue")+
geom_line(aes(y=c), color="green")+
geom_line(aes(y=d), color= "black")+
geom_line(aes(y=e), color="white")
When I test the routine, it shows that an aes is missing, when I correct talks to adjust the parameters (x, y). I believe the R is considering the number of data axis y, as axis x, in some situation. R is still cluttering up the months on the x-axis, believes it may be the failure to plot the chart???
Thanks!
Welcome to Stackoverflow! Unfortunately, this question cannot be reproduced by anyone trying to answer it. Please, take a look at this link and see how to ask a reproducible question in R. So, people who wish to help you will be able to do this in the best possible way.
– Marcus Nunes