This is my first post, so please let me know if I can add anything to make things easier. My problem is that I can't take the mean of my values, even though they are numeric. summary
does show the mean, but I can't plot it with ggplot.
This first part tells me the values are numeric.
> class(Stockholm1$hornsgatan)
[1] "numeric"
Now I try to make my plot, showing mean over time.
> ggplot(Stockholm1,aes(date,mean("hornsgatan")), na.rm = TRUE)+ geom_line()+ labs(title = "Hornsgatan Mean", x = "Date", y = "PM10")
Warning messages:
1: In mean.default("hornsgatan") :
argument is not numeric or logical: returning NA
2: In mean.default("hornsgatan") :
argument is not numeric or logical: returning NA
And I get this error. Does anyone know what I am doing wrong?