I am trying to plot this raster on R. The object is quite big, but when plotting it using the raster::plot()
function, I obtain a very tiny image, as attached.
The code I use to produce it is the following:
r <- raster::raster("MOD13Q1_2000-02-18.250m_16_days_NDVI.tif")
r <- setMinMax(r)
raster::plot(r)
I tried to set xlim
limits, with no success. I then tried to move to ggplot2
, as an alternative (following here), but I obtain the following
ggplot(r) + geom_tile(aes(fill=value))
Error: ggplot2 doesn't know how to deal with data of class RasterLayer
I found around that, to plot raster objects with ggplot()
, I should first convert it into a data.frame
. However, as my object is quite big (about 55million obs.), that would be very inefficient. I am then stuck on what to do. Any thoughts?
No comments:
Post a Comment