mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 08:32:04 +02:00
(v0.7.1.9036) preserve ab/mo classes in subsetting
This commit is contained in:
9
R/ab.R
9
R/ab.R
@ -279,12 +279,13 @@ as.data.frame.ab <- function (x, ...) {
|
||||
}
|
||||
}
|
||||
|
||||
#' @exportMethod pull.ab
|
||||
#' @exportMethod [.ab
|
||||
#' @export
|
||||
#' @importFrom dplyr pull
|
||||
#' @noRd
|
||||
pull.ab <- function(.data, ...) {
|
||||
pull(as.data.frame(.data), ...)
|
||||
"[.ab" <- function (x, ...) {
|
||||
# this function is needed to preserve the "ab" class for any subsetting, like df %>% filter(...)
|
||||
y <- NextMethod()
|
||||
structure(y, class = "ab")
|
||||
}
|
||||
|
||||
#' @importFrom pillar type_sum
|
||||
|
Reference in New Issue
Block a user