Skip to content

Commit

Permalink
coltab error with new terra
Browse files Browse the repository at this point in the history
  • Loading branch information
Eliot McIntire committed Sep 12, 2023
1 parent a27b45e commit 3ec063d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inst/sampleModules/fireSpread/fireSpread.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,17 @@ doEvent.fireSpread <- function(sim, eventTime, eventType, debug = FALSE) {
},
plot.init = {
# do stuff for this event
coltab(sim[[Par$stackName]]) <- list(
cols <- list(
DEM = brewer.pal(9, "YlOrBr"),
forestAge = brewer.pal(9, "BuGn"),
habitatQuality = brewer.pal(8, "Spectral"),
percentPine = brewer.pal(9, "Greens"),
Fires = c("white", rev(heat.colors(9)))
)

for (i in seq(cols))
coltab(sim[[Par$stackName]], layer = i) <- cols[[i]]

# clearPlot()
Plots(sim[[Par$stackName]],
legendRange = list(0:maxFn(sim[[Par$stackName]]$DEM), 0:100,
Expand Down

0 comments on commit 3ec063d

Please sign in to comment.