Skip to content

Commit

Permalink
adds both tmap3 and tmap4 code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed Dec 18, 2024
1 parent 7c80f4d commit 9846aef
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions vignettes/cast01-CAST-intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,24 @@ Still it is required to analyse if the model can be applied to the entire study
```{r, message = FALSE, warning=FALSE}
### AOA for which the spatial CV error applies:
AOA <- aoa(predictors_sp,ffsmodel,LPD = TRUE,verbose=FALSE)
tm_shape(prediction) +
tm_raster(col.scale = tm_scale_continuous(values = "-viridis"),
col.legend = tm_legend(title = "Species \nrichness")) +
tm_shape(AOA$AOA) +
tm_raster(col.scale = tm_scale_categorical(values = c("grey", "#00000000")),
col.legend = tm_legend(show = FALSE)) +
tm_layout(frame = FALSE) +
tm_add_legend(type="polygons", fill = "grey", labels = "Outside \nAOA")
# tmap3
tm_shape(prediction)+
tm_raster(title="Species \nrichness",style="cont")+
tm_shape(AOA$AOA)+
tm_raster(palette=c("1"=NA,"0"="grey"),style="cat",legend.show = FALSE)+
tm_layout(frame=FALSE,legend.outside = TRUE)+
tm_add_legend(type="fill",col="grey",border.lwd=0, labels="Outside \nAOA")
# tmap4
# tm_shape(prediction) +
# tm_raster(col.scale = tm_scale_continuous(values = "-viridis"),
# col.legend = tm_legend(title = "Species \nrichness")) +
# tm_shape(AOA$AOA) +
# tm_raster(col.scale = tm_scale_categorical(values = c("grey", "#00000000")),
# col.legend = tm_legend(show = FALSE)) +
# tm_layout(frame = FALSE) +
# tm_add_legend(type="polygons", fill = "grey", labels = "Outside \nAOA")
```

The figure shows in grey areas that are outside the area of applicability, hence predictions should not be considered for these locations. See tutorial on the AOA in this package for more information.
Expand Down

0 comments on commit 9846aef

Please sign in to comment.