1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 08:46:11 +01:00

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), xml2 (>= 1.0.0),
knitr (>= 1.0.0), knitr (>= 1.0.0),
readr, readr,
rlang (>= 0.2.0),
rvest (>= 0.3.2), rvest (>= 0.3.2),
tibble tibble
Suggests: Suggests:

View File

@ -55,7 +55,6 @@
#' @importFrom dplyr %>% select pull n_distinct group_by arrange desc mutate summarise #' @importFrom dplyr %>% select pull n_distinct group_by arrange desc mutate summarise
#' @importFrom utils browseVignettes #' @importFrom utils browseVignettes
#' @importFrom tibble tibble #' @importFrom tibble tibble
#' @importFrom rlang ensyms
#' @keywords summary summarise frequency freq #' @keywords summary summarise frequency freq
#' @rdname freq #' @rdname freq
#' @name freq #' @name freq
@ -115,11 +114,14 @@ frequency_tbl <- function(x,
if (x.name == ".") { if (x.name == ".") {
x.name <- NULL x.name <- NULL
} }
dots <- rlang::ensyms(...) dots <- base::eval(base::substitute(base::alist(...)))
ndots <- length(dots) ndots <- length(dots)
if (ndots > 0 & ndots < 10) { if (ndots > 0 & ndots < 10) {
cols <- as.character(dots) 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] x <- x[, cols]
} else if (ndots >= 10) { } else if (ndots >= 10) {
stop('A maximum of 9 columns can be analysed at the same time.', call. = FALSE) stop('A maximum of 9 columns can be analysed at the same time.', call. = FALSE)