You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is a recent regression in v4 and that it works fine in v3.
Reproducible example:
# second intro plot -----------------------------------------------------------
library(tmap)
#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,#> which was just loaded, will retire in October 2023.#> Please refer to R-spatial evolution reports for details, especially#> https://r-spatial.org/r/2023/05/15/evolution4.html.#> It may be desirable to make the sf package available;#> package maintainers should consider adding sf to Suggests:.#> The sp package is now running under evolution status 2#> (status 2 uses the sf package in place of rgdal)#> #> Attaching package: 'tmap'#> The following object is masked from 'package:datasets':#> #> rivers
library(rcartocolor)
library(spDataLarge)
library(terra)
#> terra 1.7.46# data read ---------------------------------------------------------------cla_raster= rast(system.file("raster/srtm.tif", package="spDataLarge"))
cat_raster= rast(system.file("raster/nlcd.tif", package="spDataLarge"))
# plots create ------------------------------------------------------------rast_srtm= tm_shape(cla_raster) +
tm_raster(col.scale= tm_scale_continuous(values= carto_pal(7, "Geyser")),
col.legend= tm_legend("Elevation (m)")) +
tm_title("A. Continuous data") +
tm_layout(legend.frame=TRUE,
legend.bg.color="white",
legend.position= c("right", "bottom"))
rast_nlcd= tm_shape(cat_raster) +
tm_raster(col.scale= tm_scale_categorical(levels.drop=TRUE),
col.legend= tm_legend("Land cover")) +
tm_title("B. Categorical data") +
tm_layout(legend.frame=TRUE,
legend.bg.color="white",
legend.position= c("right", "bottom"))
tmap_arrange(rast_srtm, rast_nlcd, nrow=1)
#> Error in if (width == 0L) width <- digits: missing value where TRUE/FALSE needed
I think this is a recent regression in v4 and that it works fine in v3.
Reproducible example:
Created on 2023-09-07 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: