mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 07:26:12 +01:00
remove rlang dependency
This commit is contained in:
parent
965fe8681b
commit
2ca01e2d8d
@ -36,7 +36,6 @@ Imports:
|
||||
xml2 (>= 1.0.0),
|
||||
knitr (>= 1.0.0),
|
||||
readr,
|
||||
rlang (>= 0.2.0),
|
||||
rvest (>= 0.3.2),
|
||||
tibble
|
||||
Suggests:
|
||||
|
6
R/freq.R
6
R/freq.R
@ -55,7 +55,6 @@
|
||||
#' @importFrom dplyr %>% select pull n_distinct group_by arrange desc mutate summarise
|
||||
#' @importFrom utils browseVignettes
|
||||
#' @importFrom tibble tibble
|
||||
#' @importFrom rlang ensyms
|
||||
#' @keywords summary summarise frequency freq
|
||||
#' @rdname freq
|
||||
#' @name freq
|
||||
@ -115,11 +114,14 @@ frequency_tbl <- function(x,
|
||||
if (x.name == ".") {
|
||||
x.name <- NULL
|
||||
}
|
||||
dots <- rlang::ensyms(...)
|
||||
dots <- base::eval(base::substitute(base::alist(...)))
|
||||
ndots <- length(dots)
|
||||
|
||||
if (ndots > 0 & ndots < 10) {
|
||||
cols <- as.character(dots)
|
||||
if (!all(cols %in% colnames(x))) {
|
||||
stop("one or more columns not found: `", paste(cols, collapse = "`, `"), '`', call. = FALSE)
|
||||
}
|
||||
x <- x[, cols]
|
||||
} else if (ndots >= 10) {
|
||||
stop('A maximum of 9 columns can be analysed at the same time.', call. = FALSE)
|
||||
|
Loading…
Reference in New Issue
Block a user