Closed benj919 closed 3 years ago
make_summary hardcodes richness_final to sgen3sis$summary <- c(data$summaries, list("richness-final"=data$geo_richness[,c(1,2,ncol(data$geo_richness))]))
sgen3sis$summary <- c(data$summaries, list("richness-final"=data$geo_richness[,c(1,2,ncol(data$geo_richness))]))
This will be all NAs if the simulation aborts (too many species) or if end_time is not 0. Subsequently this:
ras <- rasterFromXYZ(output$summary$`richness-final`) rc <- color_richness(max(ras@data@values, na.rm=TRUE) + 1)
will call max() with an all NA vector which will return -Inf. Of course a colorRampPalette can't produce -Inf many colours and it fails.
make_summary hardcodes richness_final to
sgen3sis$summary <- c(data$summaries, list("richness-final"=data$geo_richness[,c(1,2,ncol(data$geo_richness))]))
This will be all NAs if the simulation aborts (too many species) or if end_time is not 0. Subsequently this:
will call max() with an all NA vector which will return -Inf. Of course a colorRampPalette can't produce -Inf many colours and it fails.