many issues why this is happening seem to be because of comma and point usage for decimals. My dataframe does use points for showing decimals. The general structure is like this:
longitude latitude o3_col3(ppb)
1 -10 35 57.05763
2 -10 34 61.53371
3 -10 33 51.24268
4 -10 32 50.26531
5 -10 31 50.26531
6 -10 30 42.59164
And I try to plot using ggplot like this:
ggplot(ascplot, aes(x=longitude, y=latitude, fill = as.numeric("o3_col3(ppb)"))) +
geom_raster() +
scale_fill_gradientn(colours=rainbow(7))
First the issue was the column name being in brackets, the second was:
Error: Discrete value supplied to continuous scale
But seemed to be fixed by using as.numeric().
However now the following error shows up:
Warning message:
In FUN(X[[i]], ...) : NAs introduced by coercion
I checked all the values in the column, but none of them are NA or in any way different than one another. Anyone know what could cause this issue?
My goal is to plot the ozone column value on the lat/lon positions.