%-=%.bandicoot_oop | R Documentation |
bandicoot_oop
objectThis function performs the in-place subtraction operator using the
..iadd..()
method.
If it is not applicable, error will be raised.
## S3 method for class 'bandicoot_oop'
x %-=% y
x |
|
y |
Another object. |
Depends on the method.
COMPANY <- new_class(class_name = "COMPANY")
company <- COMPANY$instantiate
register_method(COMPANY,
..init.. = function(name, age) {
self$name <- name
self$age <- age
})
register_method(COMPANY,
..isub.. = function(y) {
self$age <- self$age[self$name != y]
self$name <- self$name[self$name != y]
})
good_company <- company(c("patrick", "james"),
c(33, 34))
good_company %-=% "patrick"
good_company$name
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.