as_tibble.data.frame() appears to strip some custom attributes. So far, I've only noticed this for n, but there may be others. I think it should either strip all the non-standard attributes or preserve them all, and document the behaviour either way.
library(tibble)
df <- data.frame(x=1:2, y=3:4)
attr(df, "n") <- 5
attr(df, "m") <- 6
attributes(df) # data.frame has m and n attributes.
#> $names
#> [1] "x" "y"
#>
#> $class
#> [1] "data.frame"
#>
#> $row.names
#> [1] 1 2
#>
#> $n
#> [1] 5
#>
#> $m
#> [1] 6
attributes(as_tibble(df)) # tibble has m but not n.
#> $class
#> [1] "tbl_df" "tbl" "data.frame"
#>
#> $row.names
#> [1] 1 2
#>
#> $names
#> [1] "x" "y"
#>
#> $m
#> [1] 6
Created on 2024-04-02 with reprex v2.1.0