mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 06:30:48 +01:00
(v0.7.1.9056) mo and ab subsetting
This commit is contained in:
1 parent
7108454ba5
commit
920212e815
46 files changed
+144
-69
No files matched your search
@@ -1723,10 +1723,42 @@ as.data.frame.mo <- function(x, ...) {
|
||||
#' @exportMethod [.mo
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[.mo" <- function (x, ...) {
|
||||
# this function is needed to preserve the "mo" class for any subsetting, like df %>% filter(...)
|
||||
"[.mo" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
to_class_mo(y)
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @exportMethod [<-.mo
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[<-.mo" <- function(i, j, ..., value) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(value)
|
||||
y
|
||||
}
|
||||
#' @exportMethod [[.mo
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[.mo" <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
#' @exportMethod [[<-.mo
|
||||
#' @export
|
||||
#' @noRd
|
||||
"[[<-.mo" <- function(value) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(value)
|
||||
y
|
||||
}
|
||||
#' @exportMethod c.mo
|
||||
#' @export
|
||||
#' @noRd
|
||||
c.mo <- function(x, ...) {
|
||||
y <- NextMethod()
|
||||
attributes(y) <- attributes(x)
|
||||
y
|
||||
}
|
||||
|
||||
#' @rdname as.mo
|
||||
|
||||
Reference in new issue
Block a user