From 061f984d8d86f1163106ccf34c7ed30d345e7f5e Mon Sep 17 00:00:00 2001 From: Chris Black Date: Wed, 3 May 2023 22:39:42 -0700 Subject: [PATCH 1/2] delete unused helper fn --- modules/data.atmosphere/R/met2CF.csv.R | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/data.atmosphere/R/met2CF.csv.R b/modules/data.atmosphere/R/met2CF.csv.R index f70dd9733be..d2f3a97ab8a 100644 --- a/modules/data.atmosphere/R/met2CF.csv.R +++ b/modules/data.atmosphere/R/met2CF.csv.R @@ -642,12 +642,6 @@ met2CF.csv <- function(in.path, in.prefix, outfolder, start_date, end_date, form } # met2CF.csv -datetime <- function(list) { - date_string <- sapply(list, as.character) - datetime <- paste(list, "00") - return(lubridate::ymd_hms(datetime)) -} # datetime - met.conv <- function(x, orig, bety, CF) { orig <- as.character(orig) bety <- as.character(bety) From d1f1dc4fbd1ca9643ccc2edd78b2bd8fc1370eed Mon Sep 17 00:00:00 2001 From: Chris Black Date: Thu, 4 May 2023 00:14:22 -0700 Subject: [PATCH 2/2] fix global variable complaints that dead function was masking --- modules/data.atmosphere/R/download.NARR_site.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/data.atmosphere/R/download.NARR_site.R b/modules/data.atmosphere/R/download.NARR_site.R index 79479223131..7ecfbca6bae 100644 --- a/modules/data.atmosphere/R/download.NARR_site.R +++ b/modules/data.atmosphere/R/download.NARR_site.R @@ -19,6 +19,7 @@ #' #' #' @export +#' @importFrom rlang .data #' #' @author Alexey Shiklomanov download.NARR_site <- function(outfolder, @@ -43,7 +44,7 @@ download.NARR_site <- function(outfolder, date_limits_chr <- strftime(range(narr_data$datetime), "%Y-%m-%d %H:%M:%S", tz = "UTC") narr_byyear <- narr_data %>% - dplyr::mutate(year = lubridate::year(datetime)) %>% + dplyr::mutate(year = lubridate::year(.data$datetime)) %>% dplyr::group_by(.data$year) %>% tidyr::nest() @@ -276,15 +277,15 @@ get_NARR_thredds <- function(start_date, end_date, lat.in, lon.in, ) } flx_data <- post_process(flx_data_raw) %>% - dplyr::select(datetime, narr_flx_vars$CF_name) + dplyr::select("datetime", narr_flx_vars$CF_name) sfc_data <- post_process(sfc_data_raw) %>% - dplyr::select(datetime, narr_sfc_vars$CF_name) + dplyr::select("datetime", narr_sfc_vars$CF_name) met_data <- dplyr::full_join(flx_data, sfc_data, by = "datetime") %>% - dplyr::arrange(datetime) + dplyr::arrange(.data$datetime) if (drop_outside) { met_data <- met_data %>% - dplyr::filter(datetime >= start_date, datetime < (end_date + lubridate::days(1))) + dplyr::filter(.data$datetime >= start_date, .data$datetime < (end_date + lubridate::days(1))) } met_data