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'm using the development version. When specifying a bbox as a vector or matrix without crs attribute, I encounter an error message that lacks informative details. This issue makes it challenging to diagnose and resolve the problem.
library(tmap)
#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,#> which was just loaded, were retired 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:.#> #> Attaching package: 'tmap'#> The following object is masked from 'package:datasets':#> #> rivers
packageVersion('tmap')
#> [1] '3.99.9000'
data(World)
tm_shape(World, bbox= as.vector(sf::st_bbox(World))) +
tm_polygons()
#> Error in if (!maybe_longlat(b)) {: missing value where TRUE/FALSE needed
Under the hood, the specified bbox argument is feed to sf::st_bbox, which accepts many formats. However, I cannot cope unnamed numeric vectors well (imho) :
sf::st_bbox(c(-180, -89, 180, 83))
#> xmin ymin xmax ymax #> NA NA NA NAsf::st_bbox(c(xmin=-180, ymin=-89, xmax=180, ymax=83))
#> xmin ymin xmax ymax #> -180 -89 180 83
@edzer Why is this? I would expect a warning here, e.g.: "Names have not been specified:, xmin, ymin, xmax and ymax assumed."
I'm using the development version. When specifying a bbox as a vector or matrix without crs attribute, I encounter an error message that lacks informative details. This issue makes it challenging to diagnose and resolve the problem.
Created on 2023-11-07 with reprex v2.0.2
Thank you for your dedication!!
The text was updated successfully, but these errors were encountered: