Skip to content

Commit fcc4b25

Browse files
committed
Fix to predictions
1 parent 67b846d commit fcc4b25

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.lintr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ exclusions: list(
101101
"R/dwf_river_length.R" = list(line_length_linter = Inf),
102102
"R/mod_prepare_knots.R" = list(unnecessary_nesting_linter = 70:80),
103103
"R/mod_prepare_hpc.R" = list(line_length_linter = Inf),
104-
"R/mod_potprocess.R" = list(line_length_linter = 1020:1025),
104+
"R/mod_potprocess.R" = list(line_length_linter = 1011:1062),
105105
"R/dwf_wetness_index.R" = list(line_length_linter = Inf),
106106
"R/dwf_soil.R" = list(line_length_linter = Inf)
107107
)

R/mod_predict_maps.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ predict_maps <- function(
783783

784784
predict_data_test <- prediction_options %>%
785785
dplyr::filter(climate_model == "current") %>%
786-
dplyr::pull("FilePath") %>%
786+
dplyr::pull("file_path") %>%
787787
# If clamp_pred`=`TRUE`, there are two options for current climate data
788788
# (with and without clamping). Two sets of predictions under current
789789
# climates will be produced. Predictions without clamping is used for
@@ -871,7 +871,7 @@ predict_maps <- function(
871871
do_clamp <- prediction_options$clamp[[id]]
872872

873873
# Name of the current option
874-
option_name <- prediction_options$name[[id]]
874+
option_name <- prediction_options$climate_name[[id]]
875875

876876
# Name of the current model
877877
model_name <- paste0(
@@ -964,7 +964,7 @@ predict_maps <- function(
964964

965965
# Extracting data at training and new sites ------
966966
ecokit::cat_time("Extracting data at training and new sites")
967-
predict_data <- prediction_options$FilePath[[id]] %>%
967+
predict_data <- prediction_options$file_path[[id]] %>%
968968
ecokit::load_as(unwrap_r = TRUE) %>%
969969
terra::subset(bio_variables) %>%
970970
c(static_preds) %>%
@@ -1256,7 +1256,7 @@ predict_maps <- function(
12561256
prediction_summary <- purrr::map_dfr(
12571257
.x = seq_len(nrow(prediction_options)), .f = predict_internal) %>%
12581258
dplyr::full_join(prediction_options, ., by = c("name", "clamp")) %>%
1259-
dplyr::select(-"FilePath")
1259+
dplyr::select(-"file_path")
12601260

12611261
rm(predict_internal, grid_10, model_coords, envir = environment())
12621262
invisible(gc())

0 commit comments

Comments
 (0)