Commit df138b01 authored by Monnet Jean-Matthieu's avatar Monnet Jean-Matthieu
Browse files

Avoid terra::merge bug in versions 1.7.3 and 1.7.6

parent 579f9237
No related merge requests found
Showing with 5 additions and 1 deletion
+5 -1
...@@ -447,7 +447,11 @@ model_public <- list(model = model_aba_stratified_mixed$model$public, stats = mo ...@@ -447,7 +447,11 @@ model_public <- list(model = model_aba_stratified_mixed$model$public, stats = mo
# produce corresponding map # produce corresponding map
prediction_map_public <- lidaRtRee::aba_predict(model_public, metrics_map) prediction_map_public <- lidaRtRee::aba_predict(model_public, metrics_map)
# TEMPORARY fix to NA values in terra::merge (call by lidaRtRee::aba_predict) # TEMPORARY fix to NA values in terra::merge (call by lidaRtRee::aba_predict)
prediction_map_mixed <- terra::mosaic(prediction_map_public, prediction_map_private, fun = max) if (packageVersion("terra")<"1.7.3" | packageVersion("terra")>="1.7.8")
{
warning("Merging with terra::mosaic because terra::merge in 1.7.3 and 1.7.6 does not handle NA values")
prediction_map_mixed <- terra::mosaic(prediction_map_public, prediction_map_private, fun = max)
}
``` ```
```{r plotmapForestStratified, include=TRUE, echo=FALSE, message=FALSE, warning=FALSE, fig.width = 12, fig.height = 6} ```{r plotmapForestStratified, include=TRUE, echo=FALSE, message=FALSE, warning=FALSE, fig.width = 12, fig.height = 6}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment