oscarperpinan / rastervis

The raster package defines classes and methods for spatial raster data access and manipulation. The rasterVis package complements raster providing a set of methods for enhanced visualization and interaction.
oscarperpinan.github.io/rastervis
GNU General Public License v3.0
85 stars 26 forks source link

levelplot doesn't show levels anymore #65

Closed AGeographer closed 3 years ago

AGeographer commented 3 years ago

Hi, I wonder why levelplot() doesn't show categorical levels anymore. When I used it last, in December, it still worked. When I run 'grain_order = c("clay", "silt", "sand") grain_char = sample(grain_order, 36, replace = TRUE) grain_fact = factor(grain_char, levels = grain_order) grain = raster::raster(nrows = 6, ncols = 6, res = 0.5, xmn = -1.5, xmx = 1.5, ymn = -1.5, ymx = 1.5, vals = grain_fact) rasterVis::levelplot(grain)' now, the legend only shows 1,2,3 (this is from the GeoComputation book). It also didn't work on my own data set. What has changed? Thanks for clarifying, Tim

oscarperpinan commented 3 years ago

It is a bug detected here. I will upload a new version to CRAN next week. Meanwhile you can install the version with this bug fixed using:

remotes::install_github('oscarperpinan/rasterVis')