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.
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
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