diff --git a/DESCRIPTION b/DESCRIPTION index f658dc3..68ea68c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,7 @@ Description: What the package does (one paragraph). License: GPL (>= 3) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Suggests: here, knitr, @@ -42,7 +42,7 @@ Imports: lubridate, magrittr, ncdf4, - parallel, + parallelly, purrr, stringr, terra diff --git a/NAMESPACE b/NAMESPACE index 4e2dfa2..fec6ea0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,8 +7,12 @@ export(htr_change_freq) export(htr_create_ensemble) export(htr_download_ESM) export(htr_fix_calendar) +export(htr_integrate_levels) export(htr_make_folder) export(htr_merge_files) export(htr_regrid_esm) +export(htr_seasonal_frequency) +export(htr_shift_years) +export(htr_show_levels) export(htr_slice_period) importFrom(magrittr,"%>%") diff --git a/R/htr_change_freq.R b/R/htr_change_freq.R index fbd1d77..325e992 100644 --- a/R/htr_change_freq.R +++ b/R/htr_change_freq.R @@ -7,7 +7,16 @@ #' @export #' #' @examples -htr_change_freq <- function(freq, +#' htr_change_freq( +#' hpc = NA, +#' file = NA, +#' freq = "monthly", +#' indir = here("data", "proc", "sliced", variable), +#' outdir = here("data", "proc", "monthly", variable) +#' ) +htr_change_freq <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + file = NA, # hpc = "array", the input will be the file + freq, # possible values are "yearly" or "monthly" indir, outdir) { . <- NULL # Stop devtools::check() complaints about NSE @@ -16,9 +25,12 @@ htr_change_freq <- function(freq, # Create output folder if it doesn't exist htr_make_folder(outdir) - w <- parallel::detectCores() - 2 - - esms <- dir(indir, pattern = "*.nc", full.names = TRUE) + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(method = "system", omit = 2) + } else { + w <- parallelly::availableCores(method = "Slurm", omit = 2) + } ############## @@ -50,6 +62,20 @@ htr_change_freq <- function(freq, ############## + if (hpc %in% c("array")) { # For hpc == "array", use the specific files as the starting point + + esm <- dir(indir, pattern = file, full.names = TRUE) + + if (stringr::str_to_lower(freq) == "yearly") { # run function + change_yearly(esm, outdir) + } else if (stringr::str_to_lower(freq) == "monthly") { + change_monthly(esm, outdir) + } + + } else { # For hpc == "parallel" and non-hpc work, use the input directory as the starting point and run jobs in parallel + + esms <- dir(indir, pattern = "*.nc", full.names = TRUE) + future::plan(future::multisession, workers = w) if (stringr::str_to_lower(freq) == "yearly") { @@ -59,4 +85,6 @@ htr_change_freq <- function(freq, } future::plan(future::sequential) + + } } diff --git a/R/htr_create_ensemble.R b/R/htr_create_ensemble.R index 988e727..e6e489b 100644 --- a/R/htr_create_ensemble.R +++ b/R/htr_create_ensemble.R @@ -1,15 +1,19 @@ #' Create an ensemble based on list of models #' +#' #' @inheritParams htr_slice_period #' @param model_list Character string of models to use for the ensemble #' @param variable The variable to create the ensemble for #' @param mean Use the mean (TRUE; default) or the median (FALSE) when creating the ensemble. +#' @param season If using seasonal frequency, input the season name to detect the files +#' @param domain If using depth-resolved models, input the domain name to detect the files #' #' @export #' #' @examples #' \dontrun{ #' htr_create_ensemble( +#' hpc = NA, #' indir = file.path(base_dir, "data", "proc", "regridded", "yearly", "tos"), #' outdir = file.path(base_dir, "data", "proc", "ensemble", "mean", "tos"), #' model_list = c("ACCESS-ESM1-5", "CanESM5"), @@ -19,35 +23,76 @@ #' mean = TRUE #' ) #' } -htr_create_ensemble <- function(indir, +htr_create_ensemble <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + indir, outdir, model_list, variable = "tos", freq = "Omon", scenario = "historical", + season = "", # default is no season + domain = "", # default is no domain mean = TRUE # if false, use median ) { # Create output folder if it doesn't exist htr_make_folder(outdir) - w <- parallel::detectCores() - 2 + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(methods = "system", omit = 2) + } else { + w <- parallelly::availableCores(methods = "Slurm", omit = 2) + } + + ############## + + if (stringr::str_length(domain) > 0 & stringr::str_length(season) > 0) { + + files <- dir(indir, full.names = TRUE) %>% + stringr::str_subset(paste0("(?=.*", variable, "_", ")(?=.*", freq, "_", ")(?=.*", scenario, "_", ")(?=.*", season, "_", ")(?=.*", domain, ")")) %>% + stringr::str_subset(paste(model_list, collapse = "|")) + + } else if (stringr::str_length(domain) > 0) { + + files <- dir(indir, full.names = TRUE) %>% + stringr::str_subset(paste0("(?=.*", variable, "_", ")(?=.*", freq, "_", ")(?=.*", scenario, "_", ")(?=.*", domain, ")")) %>% + stringr::str_subset(paste(model_list, collapse = "|")) + + } else if (stringr::str_length(season) > 0) { + + files <- dir(indir, full.names = TRUE) %>% + stringr::str_subset(paste0("(?=.*", variable, "_", ")(?=.*", freq, "_", ")(?=.*", scenario, "_", ")(?=.*", season, ")")) %>% + stringr::str_subset(paste(model_list, collapse = "|")) + + } else { + + files <- dir(indir, full.names = TRUE) %>% + stringr::str_subset(paste0("(?=.*", variable, "_", ")(?=.*", freq, "_", ")(?=.*", scenario, ")")) %>% + stringr::str_subset(paste(model_list, collapse = "|")) - files <- dir(indir, full.names = TRUE) %>% - stringr::str_subset(paste0("(?=.*", variable, "_", ")(?=.*", freq, "_", ")(?=.*", scenario, "_", ")")) %>% - stringr::str_subset(paste(model_list, collapse = "|")) + } out_name <- files[1] %>% stringr::str_replace(indir, outdir) %>% stringr::str_replace(htr_get_CMIP6_bits(files[1])$Model, "ensemble") + ############## + if (mean == TRUE) { + cdo_code <- paste0("cdo -L -z zip -ensmean ", paste0(files, collapse = " "), " ", out_name) + } else if (mean == FALSE) { # Calculate the median + cdo_code <- paste0("cdo -L -z zip -ensmedian ", paste0(files, collapse = " "), " ", out_name) + } else { + print("Please provide the right option for mean") + } system(cdo_code) + } diff --git a/R/htr_download_ESM.R b/R/htr_download_ESM.R index 755d369..3b1f39e 100644 --- a/R/htr_download_ESM.R +++ b/R/htr_download_ESM.R @@ -8,11 +8,13 @@ #' @examples #' \dontrun{ #' htr_download_ESM( +#' hpc = NA, #' indir = file.path(base_dir, "data", "raw", "wget"), # input directory #' outdir = file.path(base_dir, "data", "raw", "tos") # output directory #' ) #' } -htr_download_ESM <- function(indir, # where wget files are located +htr_download_ESM <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + indir, # where wget files are located outdir) { # where .nc files should be downloaded # Create output folder if it doesn't exist @@ -20,9 +22,12 @@ htr_download_ESM <- function(indir, # where wget files are located pth <- getwd() - w <- parallel::detectCores() - 2 - - files <- dir(indir, pattern = "wget", full.names = TRUE) + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(methods = "system", omit = 2) + } else { + w <- parallelly::availableCores(methods = "Slurm", omit = 2) + } ############## @@ -34,6 +39,8 @@ htr_download_ESM <- function(indir, # where wget files are located ############## + files <- dir(indir, pattern = "wget", full.names = TRUE) + future::plan(future::multisession, workers = w) furrr::future_walk(files, wget_files) future::plan(future::sequential) diff --git a/R/htr_fix_calendar.R b/R/htr_fix_calendar.R index fbf63a7..277fc35 100644 --- a/R/htr_fix_calendar.R +++ b/R/htr_fix_calendar.R @@ -8,11 +8,28 @@ #' @export #' #' @examples -htr_fix_calendar <- function(indir) { # input directory +#' \dontrun{ +#' +#' htr_fix_calendar( +#' hpc = NA, +#' file = NA, +#' indir = file.path(base_dir, "data", "merged"), # input directory +#' ) +#' } +htr_fix_calendar <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + file = NA, # hpc = "array", the input will be the file + indir) { # input directory . <- NULL # Stop devtools::check() complaints about NSE - w <- parallel::detectCores() - 2 + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(method = "system", omit = 2) + } else { + w <- parallelly::availableCores(method = "Slurm", omit = 2) + } + + ############## fix_cal <- function(f) { yrs <- ncdf4::nc_open(f) %>% @@ -33,9 +50,22 @@ htr_fix_calendar <- function(indir) { # input directory } } + ############## + + if (hpc %in% c("array")) { # For hpc == "array", use the specific files as the starting point + + file <- dir(indir, pattern = file, full.names = TRUE) + + fix_cal(file) # run function + + } else { # For hpc == "parallel" and non-hpc work, use the input directory as the starting point and run jobs in parallel + + netCDFs <- dir(indir, full.names = TRUE) + + future::plan(future::multisession, workers = w) + furrr::future_walk(netCDFs, fix_cal) # run function in parallel + future::plan(future::sequential) + + } - netCDFs <- dir(indir, full.names = TRUE) - future::plan(future::multisession, workers = w) - furrr::future_walk(netCDFs, fix_cal) - future::plan(future::sequential) } diff --git a/R/htr_integrate_levels.R b/R/htr_integrate_levels.R new file mode 100644 index 0000000..7be1478 --- /dev/null +++ b/R/htr_integrate_levels.R @@ -0,0 +1,61 @@ +#' Get the weighted vertical means +#' +#' hjfjhfjhf +#' +#' @inheritParams htr_seasonal_frequency +#' @param min_level Minimum level of depth domain +#' @param max_level Maximum level of depth domain +#' @param domain_name Depth domain name +#' +#' @return +#' @export +#' +#' @examples +#' \dontrun{ +#' +#' } +htr_integrate_levels <- function(indir, + tempdir, + outdir, + min_level, + max_level, + domain_name = "" +) { + + # Create output folder if it doesn't exist + htr_make_folder(outdir) + + # Create temporary folder if it doesn't exist + htr_make_folder(tempdir) + + w <- parallel::detectCores()-2 + + do_integrate <- function(f) { + + if(stringr::str_length(domain_name) > 0) { + outname <- f %>% + basename() %>% + stringr::str_split("[.]") %>% + purrr::map(~paste0(.x[1], "_", domain_name, ".", .x[2])) + } else { + outname <- f %>% + basename() + } + + + out_file <- paste0(outdir, "/", outname) + + system(paste0("cdo select,levrange=", min_level, ",", max_level, " ", f, " ", tempdir, "/", basename(f))) + + system(paste0("cdo vertmean ", tempdir, "/", basename(f), " ", out_file)) + + print(basename(f)) + + } + + esms <- dir(indir, pattern = "*.nc", full.names = TRUE) + future::plan(future::multisession, workers = w) + furrr::future_walk(esms, do_integrate) + future::plan(future::sequential) + +} diff --git a/R/htr_merge_files.R b/R/htr_merge_files.R index 1a1d8bc..20c6d6b 100644 --- a/R/htr_merge_files.R +++ b/R/htr_merge_files.R @@ -12,13 +12,15 @@ #' \dontrun{ #' #' htr_merge_files( +#' hpc = NA, #' indir = file.path(base_dir, "data", "raw", "tos"), # input directory #' outdir = file.path(base_dir, "data", "proc", "merged", "tos"), # output directory #' year_start = 1985, # earliest year across all the scenarios considered #' year_end = 2100 # latest year across all the scenarios considered #' ) #' } -htr_merge_files <- function(indir, # where nc files are located +htr_merge_files <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + indir, # where nc files are located outdir, # where merged files should be saved year_start, # start year of historical file year_end # end year of projection file @@ -28,7 +30,12 @@ htr_merge_files <- function(indir, # where nc files are located # Create output folder if it doesn't exist htr_make_folder(outdir) - w <- parallel::detectCores() - 2 + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(methods = "system", omit = 2) + } else { + w <- parallelly::availableCores(methods = "Slurm", omit = 2) + } l <- htr_get_meta(indir, string = c("Variable", "Frequency", "Scenario", "Model", "Variant")) diff --git a/R/htr_regrid_esm.R b/R/htr_regrid_esm.R index 6f9f9d2..5bfecc6 100644 --- a/R/htr_regrid_esm.R +++ b/R/htr_regrid_esm.R @@ -12,13 +12,17 @@ #' #' \dontrun{ #' htr_regrid_esm( +#' hpc = NA, +#' file = NA, #' indir = file.path(base_dir, "data", "proc", "yearly", "tos"), #' outdir = file.path(base_dir, "data", "proc", "regridded", "yearly", "tos"), #' cell_res = 0.25, #' layer = "annual" #' ) #' } -htr_regrid_esm <- function(indir, # input directory +htr_regrid_esm <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + file = NA, # hpc = "array", the input will be the file + indir, # input directory outdir, # folder to save the regridded ESM cell_res = 0.25, # resolution of blank raster layer # which layer is being regridded (anomalies, annual, etc.?) @@ -27,16 +31,18 @@ htr_regrid_esm <- function(indir, # input directory # Create output folder if it doesn't exist htr_make_folder(outdir) - w <- parallel::detectCores() - 2 + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(method = "system", omit = 2) + } else { + w <- parallelly::availableCores(method = "Slurm", omit = 2) + } base_rast <- htr_make_blankRaster( outdir, cell_res ) - # Get files and remap - netCDFs <- dir(indir, full.names = TRUE) - ############## remap_netCDF <- function(anom_file, base_rast, layer) { @@ -63,9 +69,22 @@ htr_regrid_esm <- function(indir, # input directory ############## - future::plan(future::multisession, workers = w) - furrr::future_walk(netCDFs, remap_netCDF, base_rast, layer) - future::plan(future::sequential) + if (hpc %in% c("array")) { # For hpc == "array", use the specific files as the starting point + + netCDF <- dir(indir, pattern = file, full.names = TRUE) + + remap_netCDF(netCDF, base_rast, layer) # run function + + } else { # For hpc == "parallel" and non-hpc work, use the input directory as the starting point and run jobs in parallel + + netCDFs <- dir(indir, full.names = TRUE) + + future::plan(future::multisession, workers = w) + furrr::future_walk(netCDFs, remap_netCDF, base_rast, layer) + future::plan(future::sequential) + + } system(paste0("rm -r ", base_rast)) + } diff --git a/R/htr_seasonal_frequency.R b/R/htr_seasonal_frequency.R new file mode 100644 index 0000000..334d970 --- /dev/null +++ b/R/htr_seasonal_frequency.R @@ -0,0 +1,79 @@ +#' Change frequency to seasonal frequency +#' +#' @inheritParams htr_slice_period +#' @param tempdir Temporary directory where specific months are selected +#' @param months Define season (based in the numbered format of months) +#' @param months_name Define seasone name for the filename's suffix +#' +#' @export +#' +#' @examples +#' \dontrun{ +#' htr_seasonal_frequency( +#' hpc = NA, +#' file = NA, +#' indir = here("data", "proc", "sliced", "omip", variable), +#' tempdir = here("data", "temporary"), +#' outdir = here("data", "proc", "seasonal", "omip", variable), +#' months = c("01", "02", "03"), # define season (in numbered format) +#' months_name = "jan-mar" # define season name +#' ) +#' } +htr_seasonal_frequency <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + file = NA, # hpc = "array", the input will be the file + indir, + tempdir, + outdir, + months, # define season (in numbered format) + months_name # define season name for the filename's suffix +) { + + # Create output folder if it doesn't exist + htr_make_folder(outdir) + + # Create temporary folder if it doesn't exist + htr_make_folder(tempdir) + + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(method = "system", omit = 2) + } else { + w <- parallelly::availableCores(method = "Slurm", omit = 2) + } + + ############## + + change_seasons <- function(f) { + + basename <- f %>% + basename() %>% + stringr::str_split("_merged_") %>% + purrr::map(~paste0(.x[1], "_seasonal_", .x[2])) %>% + stringr::str_split("[.]") %>% + purrr::map(~paste0(.x[1], "_", months_name, ".", .x[2])) + + out_file <- paste0(outdir, "/", basename) + + system(paste0("cdo selmon,", paste0(months, collapse = ","), " ", f, " ", tempdir, "/", basename)) # select only the months that are part of the defined season + system(paste0("cdo yearmonmean ", tempdir, "/", basename, " ", out_file)) # take the yearly mean across the predefined seasons + + } + + ############## + + if (hpc %in% c("array")) { # For hpc == "array", use the specific files as the starting point + + esm <- dir(indir, pattern = file, full.names = TRUE) + + change_seasons(esm) # run function + + } else { # For hpc == "parallel" and non-hpc work, use the input directory as the starting point and run jobs in parallel + + esms <- dir(indir, pattern = "*.nc", full.names = TRUE) + + future::plan(future::multisession, workers = w) + furrr::future_walk(esms, change_seasons) + future::plan(future::sequential) + } + +} diff --git a/R/htr_shift_years.R b/R/htr_shift_years.R new file mode 100644 index 0000000..fc12f33 --- /dev/null +++ b/R/htr_shift_years.R @@ -0,0 +1,94 @@ +#' Shift years +#' +#' @author Tin Buenafe +#' +#' @inheritParams htr_slice_period +#' @param adjust_value Years that will be used to adjust the time (could be positive or negative) +#' +#' @export +#' +#' @examples +#' \dontrun{ +#' htr_shift_years( +#' indir = file.path(base_dir, "data", "proc", "regridded", "yearly", "tos"), +#' outdir = file.path(base_dir, "data", "proc", "ensemble", "mean", "tos"), +#' adjust_value = 1653 +#' ) +#' } +htr_shift_years <- function(indir, + outdir, + adjust_value +) { + + # Create output folder if it doesn't exist + htr_make_folder(outdir) + + w <- parallel::detectCores()-2 # get number of workers + + f <- dir(indir, full.names = TRUE) + + ###### + + do_shift <- function(f) { + + meta <- htr_get_CMIP6_bits(f) # get the metadata + + yr_start <- stringr::str_split(meta$Year_start, pattern = "-") %>% + unlist() # get start year + + yr_end <- stringr::str_split(meta$Year_end, pattern = "-") %>% + unlist() # get end year + + if(as.numeric(yr_start[1]) < 1200) { # if year < 1200; the dates need to be adjusted + # Adjust years + yr1 = as.numeric(yr_start[1]) + adjust_value + yr2 = as.numeric(yr_end[1]) + adjust_value + + filename <- paste0(paste(meta$Variable, + meta$Frequency, + meta$Model, + meta$Scenario, + meta$Variant, + meta$Grid, + paste0(yr1, + yr_start[2], + yr_start[3]), + sep = "_"), + "-", + paste0(yr2, + yr_end[2], + yr_end[3]), + ".nc") + + # Shift the time using the shifttime function of cdo + system(paste0("cdo shifttime,", adjust_value, "years", " ", f, " ", outdir, "/", filename)) + + } else { + filename <- paste(meta$Variable, + meta$Frequency, + meta$Model, + meta$Scenario, + meta$Variant, + meta$Grid, + paste0(paste0(yr_start, + collapse = ""), + "-", + paste0(yr_end, collapse = ""), + ".nc"), + sep = "_") + system(paste0("cp ", f, " ", outdir, "/", filename)) + print(filename) + } + + ###### + + } + + future::plan(future::multisession, workers = w) # to do the shift in parallel + furrr::future_walk(f, do_shift) + future::plan(future::sequential) # revert back to sequential processing + +} + + + diff --git a/R/htr_show_levels.R b/R/htr_show_levels.R new file mode 100644 index 0000000..cdd9874 --- /dev/null +++ b/R/htr_show_levels.R @@ -0,0 +1,35 @@ +#' Print depth-resolved levels +#' +#' @inheritParams htr_slice_period +#' +#' @return +#' @export +#' +#' @examples +#' \dontrun{ +#' htr_show_levels( +#' indir = file.path(base_dir, "data", "proc", "sliced", "omip", variable) +#' ) +#' } +htr_show_levels <- function(indir) + { + + w <- parallel::detectCores()-2 # get number of workers + + f <- dir(indir, full.names = TRUE) + + ###### + + do_show <- function(f) { + + print(basename(f)) + output <- system(paste0("cdo showlevel ", f), intern = TRUE) + return(output) + + } + + #### + + purrr::map_vec(f, do_show) + +} diff --git a/R/htr_slice_period.R b/R/htr_slice_period.R index 0c40834..d52095e 100644 --- a/R/htr_slice_period.R +++ b/R/htr_slice_period.R @@ -2,6 +2,8 @@ #' #' @author Dave Schoeman and Tin Buenafe #' +#' @param hpc Indicates whether the user is working in a HPC (High Performance Computing) facility +#' @param file For when using the "array" option in the HPC, the file name needs to be specified #' @param indir Directory where input files are located #' @param outdir Directory where output files will be saved #' @param freq The temporal frequency to be used in the analysis @@ -15,7 +17,8 @@ #' @examples #' \dontrun{ #' htr_slice_period( -#' indir = file.path(base_dir, "data", "proc", "merged", "tos"), # input directory +#' hpc = NA, +#' indir = file.path(base_dir, "data", "proc", "merged", "tos"), # input directory #' outdir = file.path(base_dir, "data", "proc", "sliced", "tos"), # output directory #' freq = "Omon", # ocean, daily #' scenario = "ssp", @@ -24,7 +27,9 @@ #' overwrite = FALSE #' ) #' } -htr_slice_period <- function(indir, # where the merged files are +htr_slice_period <- function(hpc = NA, # if ran in the HPC, possible values are "array", "parallel" + file = NA, # hpc = "array", the input will be the file + indir, # where the merged files are outdir, # where the trimmed files will be saved freq, # frequency scenario, # historical or ssp @@ -36,11 +41,14 @@ htr_slice_period <- function(indir, # where the merged files are # Create output folder if it doesn't exist htr_make_folder(outdir) - w <- parallel::detectCores() - 2 - - files <- dir(indir, pattern = paste0("_", freq, "_")) + # Define workers + if(is.na(hpc)) { + w <- parallelly::availableCores(method = "system", omit = 2) + } else { + w <- parallelly::availableCores(method = "Slurm", omit = 2) + } - files <- files[stringr::str_detect(files, scenario)] + ############## trim_timeframe <- function(f) { s <- htr_get_CMIP6_bits(f)$Scenario @@ -63,9 +71,25 @@ htr_slice_period <- function(indir, # where the merged files are } } - future::plan(future::multisession, workers = w) - furrr::future_walk(files, trim_timeframe) - future::plan(future::sequential) + ############## + + if (hpc %in% c("array")) { # For hpc == "array", use the specific files as the starting point + + file_n <- dir(indir, pattern = file, full.names = TRUE) + file_n <- file[stringr::str_detect(file_n, scenario)] + + trim_timeframe(file_n) # run function + + } else { # For hpc == "parallel" and non-hpc work, use the input directory as the starting point and run jobs in parallel + + files <- dir(indir, pattern = paste0("_", freq, "_")) + files <- files[stringr::str_detect(files, scenario)] + + future::plan(future::multisession, workers = w) + furrr::future_walk(files, trim_timeframe) + future::plan(future::sequential) + + } } diff --git a/data-raw/PackageSetup.R b/data-raw/PackageSetup.R index 5e2fd5f..f615eac 100644 --- a/data-raw/PackageSetup.R +++ b/data-raw/PackageSetup.R @@ -28,10 +28,10 @@ use_r("htr_merge_files.R") use_r("htr_regrid_esm.R") use_r("htr_slice_period.R") use_r("htr_change_freq.R") # Merge monthly/yearly freq +use_r("htr_shift_years.R") devtools::check() -use_package("parallel") use_package("ncdf4") use_package("lubridate") use_package("terra") @@ -39,6 +39,7 @@ use_package("stringr") use_package("future") use_package("purrr") use_package("dplyr") +use_package("parallelly") devtools::build_readme() @@ -92,6 +93,7 @@ devtools::build_site() # Maintenance devtools::check() # Check for errors. Run after code changes +devtools::install() # To install the R package in dev devtools::document() # Rebuild documentation devtools::build_readme() # Rebuild Readme file diff --git a/docs/404.html b/docs/404.html index f390203..c79a83d 100644 --- a/docs/404.html +++ b/docs/404.html @@ -14,60 +14,46 @@ - - - + + + -
Skip to contents - -