mirror of
https://github.com/msberends/AMR.git
synced 2024-12-26 08:06:12 +01:00
remove rlang dependency
This commit is contained in:
parent
965fe8681b
commit
2ca01e2d8d
@ -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:
|
||||||
|
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 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user