From 49dc2cc741f1a0ccbda148b041c8e31801d116ae Mon Sep 17 00:00:00 2001 From: Doug Leasure Date: Sat, 16 Dec 2023 17:50:48 +0000 Subject: [PATCH 1/2] add dependency snow --- DESCRIPTION | 3 ++- R/popRF.R | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 69b8e24..3b9b881 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -67,7 +67,8 @@ Imports: terra, randomForest, quantregForest, - plyr + plyr, + snow Depends: R (>= 3.2.0) License: GPL-3 Encoding: UTF-8 diff --git a/R/popRF.R b/R/popRF.R index fb68562..80733ba 100644 --- a/R/popRF.R +++ b/R/popRF.R @@ -283,7 +283,7 @@ popRF <- function(pop, verbose = verbose, log = log) log_info("MSG", - paste0("popRF will use maximum avalible cores on the PC which is ", + paste0("popRF will use maximum available cores on the PC which is ", cores), verbose = verbose, log = log) @@ -362,7 +362,7 @@ popRF <- function(pop, - #get blokcs for parallel calculation of zonal stats + #get blocks for parallel calculation of zonal stats # blocks_zs <- get_blocks_size(raster(covariates[[1]]$mastergrid$dataset_path), # cores, From 60809591af8cef862179e754d9f379564c166f83 Mon Sep 17 00:00:00 2001 From: Doug Leasure Date: Sun, 17 Dec 2023 08:58:17 +0000 Subject: [PATCH 2/2] remove unused directory: covariates --- R/popRF.R | 2 +- R/utility_functions.R | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/R/popRF.R b/R/popRF.R index 80733ba..359f507 100644 --- a/R/popRF.R +++ b/R/popRF.R @@ -994,7 +994,7 @@ popRF <- function(pop, # nt=1, # verbose = verbose, ...) - #get blokcs for parallel calculation of zonal stats + # get blocks for parallel calculation of zonal stats blocks <- get_blocks_size(census_mask, cores, diff --git a/R/utility_functions.R b/R/utility_functions.R index 84f8396..9e8bbad 100644 --- a/R/utility_functions.R +++ b/R/utility_functions.R @@ -80,13 +80,11 @@ log_info <- function(prank, create_dir <- function(x, verbose){ - x.covariates <- file.path(x, "covariates") - if(!file.exists( x.covariates )) { - msg <- paste0("Log :: Creating directory ", x.covariates,".") + msg <- paste0("Log :: Creating directory ", x, ".") - dir.create(x.covariates, + dir.create(x, recursive = TRUE, showWarnings = FALSE)