diff --git a/models/ed/.Rbuildignore b/models/ed/.Rbuildignore index 69a816ac386..cd7512dad26 100644 --- a/models/ed/.Rbuildignore +++ b/models/ed/.Rbuildignore @@ -2,3 +2,5 @@ ^model_info\.json$ ^scripts$ ^data-raw$ +^.*\.Rproj$ +^\.Rproj\.user$ diff --git a/models/ed/DESCRIPTION b/models/ed/DESCRIPTION index 4c6f98d1d39..e8bc9bcc3d2 100644 --- a/models/ed/DESCRIPTION +++ b/models/ed/DESCRIPTION @@ -34,21 +34,22 @@ Description: The Predictive Ecosystem Carbon Analyzer (PEcAn) is a scientific Depends: R (>= 2.10) Imports: - PEcAn.data.atmosphere, - PEcAn.data.land, - PEcAn.logger, - PEcAn.remote, - PEcAn.settings, - PEcAn.utils, - assertthat, abind (>= 1.4.5), + assertthat, dplyr, glue, hdf5r, lubridate, magrittr, ncdf4 (>= 1.15), + PEcAn.data.atmosphere, + PEcAn.data.land, + PEcAn.logger, + PEcAn.remote, + PEcAn.settings, + PEcAn.utils, purrr, + rlang, stringr(>= 1.1.0), tidyr, tibble, diff --git a/models/ed/NAMESPACE b/models/ed/NAMESPACE index a1d4d0660ac..75c07fdb4d0 100644 --- a/models/ed/NAMESPACE +++ b/models/ed/NAMESPACE @@ -56,3 +56,4 @@ export(write_pss) export(write_restart.ED2) export(write_site) importFrom(magrittr,"%>%") +importFrom(rlang,.data) diff --git a/models/ed/R/read_ed_metheader.R b/models/ed/R/read_ed_metheader.R index 3f79556d2f7..76522174354 100644 --- a/models/ed/R/read_ed_metheader.R +++ b/models/ed/R/read_ed_metheader.R @@ -45,6 +45,7 @@ #' @param check_files Logical. If `TRUE`, perform basic diagnostics on met #' files as well. #' @return List of ED met input parameters. See Details. +#' @importFrom rlang .data #' @export read_ed_metheader <- function(filename, check = TRUE, check_files = TRUE) { if (!file.exists(filename)) { @@ -88,7 +89,7 @@ read_ed_metheader <- function(filename, check = TRUE, check_files = TRUE) { variables_raw <- read.table(text = sub_file[4:6], header = TRUE) variables_raw$value_type <- c("update_frequency", "flag") variables_table <- variables_raw %>% - tidyr::gather("variable", "value", -value_type) %>% + tidyr::gather("variable", "value", -.data$value_type) %>% tidyr::spread("value_type", "value") %>% dplyr::left_join(met_variable_description, by = "variable") %>% dplyr::left_join(met_flag_description, by = "flag") diff --git a/models/ed/tests/Rcheck_reference.log b/models/ed/tests/Rcheck_reference.log index ba03fe577ef..288070b0969 100644 --- a/models/ed/tests/Rcheck_reference.log +++ b/models/ed/tests/Rcheck_reference.log @@ -101,22 +101,17 @@ download_edi: no visible global function definition for ‘unzip’ modify_df: no visible global function definition for ‘modifyList’ modify_ed2in: no visible global function definition for ‘modifyList’ put_E_values: no visible global function definition for ‘data’ -put_E_values: no visible binding for global variable ‘pftmapping’ put_T_values: no visible global function definition for ‘head’ read_E_files: no visible global function definition for ‘data’ -read_E_files: no visible binding for global variable ‘pftmapping’ read_S_files: no visible global function definition for ‘data’ -read_S_files: no visible binding for global variable ‘pftmapping’ read_css: no visible global function definition for ‘read.table’ read_ed_metheader: no visible global function definition for ‘read.table’ -read_ed_metheader: no visible binding for global variable ‘value_type’ read_pss: no visible global function definition for ‘read.table’ read_pss: ... may be used in an incorrect context: ‘check_pss(pss, ...)’ read_site: no visible global function definition for ‘read.table’ veg2model.ED2: no visible global function definition for ‘data’ -veg2model.ED2: no visible binding for global variable ‘pftmapping’ veg2model.ED2: no visible global function definition for ‘median’ veg2model.ED2: no visible global function definition for ‘write.table’ write.config.ED2: no visible global function definition for ‘saveXML’ @@ -124,9 +119,6 @@ write.config.ED2: no visible global function definition for ‘db.query’ write.config.ED2: no visible global function definition for ‘modifyList’ write.config.xml.ED2: no visible global function definition for ‘data’ -write.config.xml.ED2: no visible binding for global variable - ‘pftmapping’ -write.config.xml.ED2: no visible binding for global variable ‘soil’ write.config.xml.ED2: no visible global function definition for ‘modifyList’ write_css: no visible global function definition for ‘write.table’