%gt% | R Documentation |
The greater than operator
x %gt% y
x |
Object. |
y |
Another object. |
A Boolean value.
NAME <- new_class(class_name = "NAME")
name <- NAME$instantiate
register_method(NAME,
..init.. = function(first_name, last_name) {
self$first_name = first_name
self$last_name = last_name
})
register_method(NAME,
..gt.. = function(y) {
if (self$last_name == y$last_name) {
return(self$first_name > y$first_name)
}
return(self$last_name > self$last_name)
})
patrick <- name("Patrick", "Li")
james <- name("James", "Li")
patrick %gt% james
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.