148148# ' @order 1
149149# ' @importFrom rlang .data
150150# ' @author Ahmed El-Gabbas
151- # ' @details The current models are fitted for 8 habitat types see [Pysek et
152- # ' al.](https://doi.org/10.23855/preslia.2022.447):
153- # ' - **1. Forests** -- closed vegetation dominated by deciduous or evergreen
154- # ' trees
155- # ' - **2. Open forests** -- woodlands with canopy openings created by
156- # ' environmental stress or disturbance, including forest edges
157- # ' - **3. Scrub** -- shrublands maintained by environmental stress (aridity) or
158- # ' disturbance
159- # ' - **4a. Natural grasslands** -- grasslands maintained by climate (aridity,
160- # ' unevenly distributed precipitation), herbivores or environmental stress
161- # ' (aridity, instability or toxicity of substrate)
162- # ' - **4b. Human-maintained grasslands** -- grasslands dependent on regular
163- # ' human-induced management (mowing, grazing by livestock, artificial burning)
164- # ' - **10. Wetland** -- sites with the permanent or seasonal influence of
165- # ' moisture, ranging from oligotrophic to eutrophic
166- # ' - **12a. Ruderal habitats** -- anthropogenically disturbed or eutrophicated
167- # ' sites, where the anthropogenic disturbance or fertilization is typically a
168- # ' side-product and not the aim of the management
169- # ' - **12b. Agricultural habitats** -- synanthropic habitats directly
170- # ' associated with growing of agricultural products, thus dependent on
171- # ' specific type of management (ploughing, fertilization)
172- # '
173- # ' <br/>The following habitat types are excluded from the analysis:
174- # ' - **5. Sandy** -- dunes and other habitats on unstable sandy substrate,
175- # ' stressed by low nutrients, drought and disturbed by sand movement
176- # ' - **6. Rocky** -- cliffs and rock outcrops with very shallow or no soil
177- # ' - **7. Dryland** -- habitats in which drought stress limits vegetation
178- # ' development
179- # ' - **8. Saline** -- habitats stressed by high soil salinity
180- # ' - **9. Riparian** -- a mosaic of wetlands, grasslands, tall-forb stands,
181- # ' scrub and open forests in stream corridors
182- # ' - **11. Aquatic** -- water bodies and streams with submerged and floating
183- # ' plant species
184151
185152Mod_Prep4HPC <- function (
186153 Hab_Abb = NULL , DirName = NULL ,
@@ -649,9 +616,9 @@ Mod_Prep4HPC <- function(
649616 IASDT.R :: CatTime(" Response - Y matrix" )
650617 DT_y <- dplyr :: select(DT_All , tidyselect :: starts_with(" Sp_" )) %> %
651618 as.data.frame()
652- IASDT.R :: CatTime(paste0(ncol(DT_y ), " species" ), Level = 1 )
619+ IASDT.R :: CatTime(paste0(ncol(DT_y ), " species" ), Level = 1 , Time = FALSE )
653620
654- IASDT.R :: CatTime(" Save species summary" , Level = 1 )
621+ IASDT.R :: CatTime(" Save species summary" , Level = 1 , Time = FALSE )
655622 SpSummary <- IASDT.R :: Path(Path_PA , " Sp_PA_Summary_DF.RData" )
656623 if (! file.exists(SpSummary )) {
657624 stop(SpSummary , " file does not exist" , call. = FALSE )
@@ -682,22 +649,25 @@ Mod_Prep4HPC <- function(
682649 IASDT.R :: CatTime(
683650 paste0(
684651 " Models will be fitted using " , length(XVars ), " predictors: " ,
685- paste(XVars , collapse = " + " )), Level = 1 )
652+ paste(XVars , collapse = " + " )), Level = 1 , Time = FALSE )
686653 } else {
687654 OnlyLinear <- setdiff(XVars , QuadraticVars )
688655 FormVars <- c(
689656 OnlyLinear ,
690657 paste0(" stats::poly(" , QuadraticVars , " , degree = 2, raw = TRUE)" ))
691658
692- IASDT.R :: CatTime(" Models will be fitted using:" , Level = 1 )
659+ IASDT.R :: CatTime(" Models will be fitted using:" , Level = 1 , Time = FALSE )
693660
694- IASDT.R :: CatTime(paste0(length(OnlyLinear ), " linear effect: " ), Level = 2 )
695- IASDT.R :: CatTime(paste(OnlyLinear , collapse = " + " ), Level = 3 )
661+ IASDT.R :: CatTime(
662+ paste0(length(OnlyLinear ), " linear effect: " ), Level = 2 , Time = FALSE )
663+ IASDT.R :: CatTime(
664+ paste(OnlyLinear , collapse = " + " ), Level = 3 , Time = FALSE )
696665
697666 IASDT.R :: CatTime(
698667 paste0(length(QuadraticVars ), " linear and quadratic effects: " ),
699668 Level = 2 )
700- IASDT.R :: CatTime(paste(QuadraticVars , collapse = " + " ), Level = 3 )
669+ IASDT.R :: CatTime(
670+ paste(QuadraticVars , collapse = " + " ), Level = 3 , Time = FALSE )
701671
702672 }
703673
@@ -738,7 +708,7 @@ Mod_Prep4HPC <- function(
738708
739709 IASDT.R :: CatTime(
740710 paste0(" Models will be fitted using " , paste(Tree , collapse = " & " )),
741- Level = 1 )
711+ Level = 1 , Time = FALSE )
742712
743713 # # # ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
744714
@@ -763,7 +733,7 @@ Mod_Prep4HPC <- function(
763733
764734 IASDT.R :: CatTime(
765735 paste0(" Prepare working on parallel using " , NCores_GPP , " cores." ),
766- Level = 1 )
736+ Level = 2 , Time = FALSE )
767737
768738 withr :: local_options(
769739 future.globals.maxSize = 8000 * 1024 ^ 2 , future.gc = TRUE ,
@@ -792,7 +762,7 @@ Mod_Prep4HPC <- function(
792762
793763 } else {
794764
795- IASDT.R :: CatTime(" Working sequentially" )
765+ IASDT.R :: CatTime(" Working sequentially" , Time = FALSE , Level = 2 )
796766
797767 GPP_Knots <- purrr :: map(
798768 .x = GPP_Dists * 1000 ,
@@ -1250,7 +1220,8 @@ Mod_Prep4HPC <- function(
12501220 IASDT.R :: CatTime(
12511221 " Save model fitting commands for batch SLURM jobs" , Level = 1 )
12521222 IASDT.R :: CatTime(
1253- paste0(" Models will be fitted in " , NSplits , " SLURM job(s)" ), Level = 2 )
1223+ paste0(" Models will be fitted in " , NSplits , " SLURM job(s)" ),
1224+ Level = 2 , Time = FALSE )
12541225
12551226 purrr :: walk(
12561227 .x = seq_len(NSplits ),
@@ -1445,7 +1416,8 @@ Mod_Prep4HPC <- function(
14451416
14461417 # # # ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14471418
1448- IASDT.R :: CatDiff(InitTime = .StartTime )
1419+ IASDT.R :: CatDiff(
1420+ Prefix = " Processing modelling data took " , InitTime = .StartTime )
14491421
14501422 return (invisible (NULL ))
14511423}
0 commit comments