0

I have problems producing reasonable plots of quantitative fields in SpatVector objects. Using data from the example on the help page:

v <- vect(system.file("ex/lux.shp", package="terra"))
plet(v, "POP", tiles="")

enter image description here Note the color scale is not appropriate for a continuous variable and the legend is not ordered.

r <- rast(system.file("ex/elev.tif", package="terra"))
#correct plot:
plet(r, tiles="")

enter image description here

#but
rp <- as.points(r)
plet(rp, "elevation", tiles="")

enter image description here

It looks like the quantitative field is plotted as if it were qualitative, but I do not see specific options in the parameter list.

2
  • Apparently, one needs to install the development version of leaflet to run this code.
    – markhogue
    May 29 at 20:14
  • Tested with github versions of both terra (terra_1.7-34) and leaflet (leaflet_2.1.2.9000). Note the problem is not errors, but inappropriate plots. I edit to include screenshots. May 30 at 6:29

1 Answer 1

0

Reported as a bug to https://github.com/rspatial/terra/issues/1177 Follow there the issue.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.