remove rlang dependency

This commit is contained in:
dr. M.S. (Matthijs) Berends 2018-07-01 22:23:34 +02:00
parent 965fe8681b
commit 2ca01e2d8d
2 changed files with 4 additions and 3 deletions

View File

@ -36,7 +36,6 @@ Imports:
xml2 (>= 1.0.0),
knitr (>= 1.0.0),
readr,
rlang (>= 0.2.0),
rvest (>= 0.3.2),
tibble
Suggests:

View File

@ -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)