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
This supersedes #155, #211, #218.
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
Provide a reconstruct method
Call
S3::reconstruct()in all methods that return a tibbleThis supersedes #155, #211, #218.