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.
I would like the labels and colours for the categorical raster object
afrilandcoverto 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
mapviewbut similar seems not to work intmapmapview(afrilandcover, att="landcover", col.regions=levels(afrilandcover)[[1]]$colour)Here is my unfinished experimentation including trying
stars&terra. Ideally I'd like to usestars.afrilearndata/data-raw/afrilearndata-data-creation.R
Line 456 in d8510ed
If anyone has a good solution for this I'd be very grateful.