I have produced a plot of a RasterLayer using gplot and rasterVis (a wrapper around gplot). In order to display the raster output at full resolution I have to set the gplot parameter maxpixels = 10000000.
Although the raster resolution looks fine in R, when I try to write it to a file, the image is again downsampled to the standard resolution. Following the code I used:
png(paste0(pathAndFilename, ".png"))
gplot(myRaster, maxpixels = 10000000) +
geom_raster(aes(fill = factor(value))) +
scale_fill_manual(values=c(someColors), legendSpecs) +
coord_equal() +
labs(title = "SomeTitle", x = "Lng", y = "Lat")
dev.off()
Any help appreciated!