Skip to content

Commit

Permalink
chore: explicit use of rlang and haven namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Feb 20, 2024
1 parent 4125c37 commit 2d3ea6b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
12 changes: 10 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export(xportr_order)
export(xportr_type)
export(xportr_write)
export(xpt_validate)
import(haven)
import(rlang)
importFrom(checkmate,assert)
importFrom(checkmate,assert_character)
importFrom(checkmate,assert_choice)
Expand Down Expand Up @@ -54,6 +52,7 @@ importFrom(dplyr,ungroup)
importFrom(glue,glue)
importFrom(glue,glue_collapse)
importFrom(graphics,stem)
importFrom(haven,write_xpt)
importFrom(janitor,make_clean_names)
importFrom(lifecycle,deprecated)
importFrom(magrittr,"%>%")
Expand All @@ -66,6 +65,15 @@ importFrom(purrr,map_dbl)
importFrom(purrr,pluck)
importFrom(purrr,walk)
importFrom(readr,parse_number)
importFrom(rlang,"%||%")
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(rlang,abort)
importFrom(rlang,inform)
importFrom(rlang,local_options)
importFrom(rlang,sym)
importFrom(rlang,warn)
importFrom(rlang,with_options)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_replace)
Expand Down
2 changes: 1 addition & 1 deletion R/length.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ xportr_length <- function(.df,
}

length_msg <- left_join(var_length_max, metadata[, c(variable_name, variable_length)], by = variable_name) %>%
filter(length.x < length.y)
filter(.data$length.x < .data$length.y)

max_length_msg(length_msg, verbose)
}
Expand Down
2 changes: 1 addition & 1 deletion R/support-test.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ minimal_table <- function(n_rows = 3, cols = c("x", "y")) {
d = sample(Sys.Date() + c(1, -1, 10, -10), size = n_rows, replace = TRUE),
e = sample(c(1, 2), replace = TRUE, size = n_rows)
) %>%
mutate(e = if_else(seq_along(e) %% 2 == 0, NA, e)) %>%
mutate(e = if_else(seq_along(.data$e) %% 2 == 0, NA, .data$e)) %>%
select(all_of(tolower(cols)))
}

Expand Down
4 changes: 3 additions & 1 deletion R/xportr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@
#' @keywords internal
#' @aliases xportr-package
#'
#' @import rlang haven
#' @importFrom haven write_xpt
#' @importFrom rlang abort warn inform with_options local_options .data := sym
#' %||%
#' @importFrom dplyr left_join bind_cols filter select rename rename_with n
#' everything arrange group_by summarize mutate ungroup case_when distinct
#' tribble if_else across as_tibble
Expand Down

0 comments on commit 2d3ea6b

Please sign in to comment.