I would like the labels and colours for the categorical raster object afrilandcover to be stored in the object so that it is easy for new users to be able to plot them.
The current sub-optimal solution enables this to work in mapview but similar seems not to work in tmap
mapview(afrilandcover, att="landcover", col.regions=levels(afrilandcover)[[1]]$colour)
Here is my unfinished experimentation including trying stars & terra. Ideally I'd like to use stars.
|
afrilandcover <- ratify(afrilandcover) |
If anyone has a good solution for this I'd be very grateful.