From 6b5e300adee6cde0e7d6e3f29171282646736d43 Mon Sep 17 00:00:00 2001 From: Maria Voigt <maria.voigt@idiv.de> Date: Mon, 29 May 2017 14:19:57 +0200 Subject: [PATCH] adding cover and age to scaled predictors and image --- src/model_fitting/abundance_model.R | 36 +++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/model_fitting/abundance_model.R b/src/model_fitting/abundance_model.R index 6d7eb95..bd3d97e 100644 --- a/src/model_fitting/abundance_model.R +++ b/src/model_fitting/abundance_model.R @@ -196,12 +196,34 @@ predictors[predictors$predictor == "palm_distance", "value"] <- log( # STARTING THE SCALING # SCALE PREDICTORS # these are the predictors that will be used in the model -predictor_names_for_scaling <- c( "dem", "slope", "temp_mean", "rain_dry", "rain_var", - "ou_killings", "ou_killing_prediction", "human_pop_dens", - "perc_muslim", "peatswamp", "lowland_forest", "lower_montane_forest" , - "road_dens", "distance_PA", "fire_dens", "deforestation_hansen", - "deforestation_gaveau", "plantation_distance", "pulp_distance", "palm_distance", - "dom_T_OC", "dom_T_PH") +predictor_names_for_scaling <- c( "dem", + "slope", + "temp_mean", + "rain_dry", + "rain_var", + "ou_killings", + "ou_killing_prediction", + "human_pop_dens", + "perc_muslim", + "peatswamp", + "lowland_forest", + "lower_montane_forest" , + "road_dens", + "distance_PA", + "fire_dens", + "deforestation_hansen", + "deforestation_gaveau", + "plantation_distance", + "pulp_distance", + "palm_distance", + "plantation_age", + "plantation_cover", + "IOPP_age", + "IOPP_cover", + "ITP_age", + "ITP_cover", + "dom_T_OC", + "dom_T_PH") # additional predictors that have to be scaled: year and x- and y-center predictor_names_add <- c("year", "x_center", "y_center") @@ -418,7 +440,7 @@ write.csv(dfbeta_frame, file.path(outdir, # #run models if(is_verbose){print(paste("8. Start running models", Sys.time()))} - +save.image(file.path(outdir, "image_before_model_fitting.RData")) results_res <- foreach(i = 1:nrow(all_model_terms), .combine = rbind) %dopar%{ -- GitLab