I like CARTO's minimalist basemaps quite a lot, but I'm having trouble using them with with tmap
, my preferred mapping tool. I'm probably making a stupid mistake, but I can't get the colors right.
library(tmap)
library(cartography)
data("NLD_prov")
# get the basemap
carto.raster <- getTiles(NLD_prov, type = "cartolight")
# This is the output I want
raster::plotRGB(carto.raster)
# This output looks bad
tm_shape(carto.raster) +
tm_raster()
# I think I'm supposed to use tm_rgb() but that gives an error
tm_shape(carto.raster) +
tm_rgb()
Error in rgb(x[, 1], x[, 2], x[, 3], maxColorValue = 255) : color intensity NA, not in 0:255