tbl_df is transformed as list in S4 class
问题 When I tried to use tbl_df in S4 classes, tbl_df slots seems to be transformed into list . library('tibble') setOldClass(c('tbl_df', 'tbl', 'data.frame')) setClass(Class = 'TestClass', slots = c(name = 'character'), contains = 'tbl_df') tmp1 <- new('TestClass', tibble(x = 1:5, y = 1, z = x ^ 2 + y), name = 'firsttest') tmp1@.Data [[1]] [1] 1 2 3 4 5 [[2]] [1] 1 1 1 1 1 [[3]] [1] 2 5 10 17 26 Can I visit the tmp1@.Data just like a tbl_df object? like tmp1@.Data # A tibble: 5 x 3 x y z * <int>