to <- bootstraps(mtcars, times = 25)
# Imitate a vctrs/dplyr operation,
# where the class might be lost along the way
x <- tibble::as_tibble(to)
# Say we added a new column to `x`. Here we mock a `mutate()`.
x$foo <- "bar"
# This is still reconstructable to `to`
rset_reconstruct(x, to)
# Say we lose the first row
x <- x[-1, ]
# This is no longer reconstructable to `to`, as `x` is no longer an rset
# bootstraps object with 25 bootstraps if one is lost!
rset_reconstruct(x, to)
Run the code above in your browser using DataLab