You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am surprised that otype() and ftype() do not detect and report when the argument is an R6 object/method... yet. It would be great to have them support R6 in the future.
library(R6)
Person <- R6Class("Person",
public = list(
name = NULL,
hair = NULL,
initialize = function(name = NA, hair = NA) {
self$name <- name
self$hair <- hair
self$greet()
},
set_hair = function(val) {
self$hair <- val
},
greet = function() {
cat(paste0("Hello, my name is ", self$name, ".\n"))
}
)
)
ann <- Person$new("Ann", "black")
otype(ann)
This example should return "R6", not "S3".
Cheers,
Florent
The text was updated successfully, but these errors were encountered:
Hi Hadley,
I am surprised that otype() and ftype() do not detect and report when the argument is an R6 object/method... yet. It would be great to have them support R6 in the future.
This example should return "R6", not "S3".
Cheers,
Florent
The text was updated successfully, but these errors were encountered: