Skip to content

Commit

Permalink
Declare all functions explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
mrustl committed Jun 28, 2024
1 parent 9432b17 commit 9de50de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export(select_hydrologic_years)
importFrom(dplyr,across)
importFrom(dplyr,arrange)
importFrom(dplyr,bind_rows)
importFrom(dplyr,cur_column)
importFrom(dplyr,filter)
importFrom(dplyr,first)
importFrom(dplyr,group_by)
Expand All @@ -33,6 +34,7 @@ importFrom(dplyr,rename_with)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(dplyr,summarize)
importFrom(dplyr,sym)
importFrom(ggplot2,aes)
importFrom(ggplot2,geom_col)
importFrom(ggplot2,geom_line)
Expand Down
8 changes: 4 additions & 4 deletions R/recalculate_ctop_with_virtualstorage.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ combine_dataframes <- function(df_list) {
#' @export
#' @importFrom tibble tibble
#' @importFrom dplyr across arrange first if_else lag group_by mutate summarize
#' rename_with left_join
#' rename_with left_join cur_column sym
#' @importFrom tidyselect starts_with
#' @importFrom stringr str_replace
recalculate_ctop_with_virtualstorage <- function(atm,
Expand Down Expand Up @@ -102,10 +102,10 @@ vs_list <- lapply(seq_len(length(c_tops)), function(i) {
~ (. + get(paste0("store_",
stringr::str_replace(pattern = "_first",
replacement = "_sum",
cur_column())))) / Prec_first,
dplyr::cur_column())))) / Prec_first,
.names = "cor_{col}"),
across(matches("^Prec_cTop.*_sum"),
~ (. + get(paste0("store_", cur_column()))) / Prec_sum,
~ (. + get(paste0("store_", dplyr::cur_column()))) / Prec_sum,
.names = "cor_{col}")
)

Expand All @@ -119,7 +119,7 @@ vs_list <- lapply(seq_len(length(c_tops)), function(i) {
"tAtm_start",
cor_Prec_sel))),
by = c("tAtm" = "tAtm_start")) %>%
dplyr::mutate(!!sym(c_tops[i]) := dplyr::if_else(store == 0 & !is.na(.data[[cor_Prec_sel]]),
dplyr::mutate(!!dplyr::sym(c_tops[i]) := dplyr::if_else(store == 0 & !is.na(.data[[cor_Prec_sel]]),
.data[[cor_Prec_sel]],
.data[[c_tops[i]]]))

Expand Down

0 comments on commit 9de50de

Please sign in to comment.