RConsortium / S7

S7: a new OO system for R
https://rconsortium.github.io/S7
Other
386 stars 32 forks source link

Should S7 data return S3 objects? #380

Open hadley opened 9 months ago

hadley commented 9 months ago

e.g.

library(S7)

mydf <- new_class("mydf", class_data.frame)
S7_data(mydf(data.frame(x = 1, y = 2)))
#> $x
#> [1] 1
#> 
#> $y
#> [1] 2
#> 
#> attr(,"row.names")
#> [1] 1

Created on 2023-11-22 with reprex v2.0.2.9000

Shouldn't that return a data frame?