-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Labels
Milestone
Description
By following the principles defined at http://adv-r.hadley.nz/s3.html#inheritance
-
Provide a constructor that can also be used to create subclassed objects
new_tibble <- function(data, ..., subclass = NULL) { stopifnot(is.data.frame(data)) structure( data, ..., class = c(subclass, "tibble", "tbl_df", "data.frame") ) }
-
Provide a reconstruct method
reconstruct.tibble <- function(new, old) { new_tibble(new) }
-
Call
S3::reconstruct()in all methods that return a tibble
nacnudus