-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
(I originally requested this at tidyverse/tibble/issues/1555, but they suggested requesting here instead.)
Would you consider adding a data.table method to as_tibble()? On extremely cursory testing, it may be as simple as adapting as_tibble.data.frame() with an extra line to remove the .internal.selfref attribute:
library(tibble)
library(data.table)
data(mpg, package = "ggplot2")
# two identical tibbles
mpg2 <- copy(mpg)
identical(mpg, mpg2)
#> [1] TRUE
# after converting to data.table and back to tibble, no longer identical
setDT(mpg2)
mpg2 <- as_tibble(mpg2)
identical(mpg, mpg2)
#> [1] FALSE
# identical again after removing ".internal.selfref" attribute
attr(mpg2, ".internal.selfref") <- NULL
identical(mpg, mpg2)
#> [1] TRUECreated on 2023-09-22 with reprex v2.0.2
AngelFelizR
Metadata
Metadata
Assignees
Labels
No labels