1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 15:21:58 +02:00

(v0.7.1.9062) mo/ab assignment improvements

This commit is contained in:
2019-08-26 16:02:03 +02:00
parent 13d4fef801
commit 7a6fce4eb8
19 changed files with 383 additions and 378 deletions

22
R/ab.R
View File

@ -287,14 +287,6 @@ as.data.frame.ab <- function (x, ...) {
attributes(y) <- attributes(x)
y
}
#' @exportMethod [<-.ab
#' @export
#' @noRd
"[<-.ab" <- function(value) {
y <- NextMethod()
attributes(y) <- attributes(value)
y
}
#' @exportMethod [[.ab
#' @export
#' @noRd
@ -303,13 +295,21 @@ as.data.frame.ab <- function (x, ...) {
attributes(y) <- attributes(x)
y
}
#' @exportMethod [<-.ab
#' @export
#' @noRd
"[<-.ab" <- function(i, j, ..., value) {
y <- NextMethod()
attributes(y) <- attributes(i)
class_integrity_check(y, "antimicrobial code", AMR::antibiotics$ab)
}
#' @exportMethod [[<-.ab
#' @export
#' @noRd
"[[<-.ab" <- function(i, j, ..., value) {
y <- NextMethod()
attributes(y) <- attributes(value)
y
attributes(y) <- attributes(i)
class_integrity_check(y, "antimicrobial code", AMR::antibiotics$ab)
}
#' @exportMethod c.ab
#' @export
@ -317,7 +317,7 @@ as.data.frame.ab <- function (x, ...) {
c.ab <- function(x, ...) {
y <- NextMethod()
attributes(y) <- attributes(x)
y
class_integrity_check(y, "antimicrobial code", AMR::antibiotics$ab)
}
#' @importFrom pillar type_sum