plot_richness causes gen3sis to crash when called in the observer function when all species have gone extinct.
plot_richness(species, landscape)
Error in (mult * length(col)):1 : NA/NaN argument
In addition: Warning message:
In x[] <- col[x] :
number of items to replace is not a multiple of replacement length
The problem is there is no color in the richness palette for values of 0
plot_richness causes gen3sis to crash when called in the observer function when all species have gone extinct.
plot_richness(species, landscape) Error in (mult * length(col)):1 : NA/NaN argument In addition: Warning message: In x[] <- col[x] : number of items to replace is not a multiple of replacement length
The problem is there is no color in the richness palette for values of 0
max(richness) [1] 0 color_richness(max(richness, na.rm=TRUE)) [1] character(0) color_richness(1) [1] "#440154"
This problem also means colours on a richness plot cannot distinguish between cells with 1 species and cells with 2 species.