R/CMIP6tools-package.R

Defines functions .onLoad

#' @keywords internal
"_PACKAGE"

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
## usethis namespace: end
NULL
#' @docType package
#' @keywords CMIP6
#' @description Functions to tidy and analysis CMIP5 data
#'
#' @import magrittr
#' @import foreach
#' @import data.table
#'
#' @importFrom plyr llply ddply mutate .
#' @importFrom iterators icount iter
#' @importFrom dplyr bind_cols bind_rows group_by nth
#' @importFrom readr read_rds write_rds
#' @importFrom purrr map map_df map_dbl is_empty
#' @importFrom lubridate ymd day dyears is.Date
#' @importFrom stringr str_extract str_extract_all str_sub str_c
#' @importFrom utils object.size setTxtProgressBar txtProgressBar
#' @importFrom grDevices dev.off cairo_pdf col2rgb colorRampPalette rgb
#' @importFrom methods new as
#' @importFrom sp sppanel
#' @importFrom utils packageVersion globalVariables data
#'
#' @keywords internal
#'
#' @import stats graphics
"_PACKAGE"

# ' @importFrom data.table data.table as.data.table := is.data.table fwrite
# ' fread setkeyv

# ## usethis namespace: start
# # ' @import RcppEigen
# #' @useDynLib CMIP5tools, .registration = TRUE
# #' @importFrom Rcpp sourceCpp
# ## usethis namespace: end
# NULL

.onLoad <- function(libname, pkgname) {
    if (getRversion() >= "2.15.1") {
        globalVariables(
            c( # data:
                "info_misc",
                # variables:
                ".SD", ".N", "len",
                "dir_root",
                "ij", "Ti", # Tinc_reach
                "pos_end", # get_host
                "indice",
                "begin", "path_i",
                "value", "files", "d_file", "file_TRS", "type_TRS", "varnames", "info_rcp", # process_CMIP5 and process_raster2
                "i", "j", "x", "varname", "name", "longname", "variable", "d",
                "scenario", "piControl", "modelI", "ensembleI", "size_mb", "part", "time_scale2",
                "x1", "x2", "V1", "mat1", "mat2", "HW",
                "year_start", "year_end", "start_adj", "end_adj", "model", "ensemble",
                "grp", "trs", "prob",
                "convertTri", "process.key", "process.colorkey", "key_triangle", "key_border"
            )
        )
    }
}
kongdd/CMIP5tools documentation built on Dec. 17, 2020, 11:03 a.m.