You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a package to work with objects that are a special case of a tbl_df in which there is 'interval' information in the columns (i.e. one column for start of interval and one column for end of interval).
I have a constructor that adds a class to an existing data.frame or tbl_df (and some attributes too). But it seems that dplyr verbs like to remove any classes that I add.
Your class is incorrect - it should be c("something_else", "data.frame").
And I think doing this correctly is up to you - you need to define a method for your class for each dplyr method that correctly restores all the classes and attributes. It's going to be extremely fiddly to do this in dplyr, and it doesn't seem like a huge benefit to me given that there's already a work around (which is arguably the correct thing to do anyway.
I'm building a package to work with objects that are a special case of a
tbl_df
in which there is 'interval' information in the columns (i.e. one column forstart
of interval and one column forend
of interval).I have a constructor that adds a class to an existing
data.frame
ortbl_df
(and some attributes too). But it seems thatdplyr
verbs like to remove any classes that I add.For example:
But dplyr verbs strip the new class...
I notice that dplyr 0.4.3 now preserves attributes, but it looks like classes are still getting eaten.
Is this something that's on anyone's radar? I haven't been able to find an issue for it.
The text was updated successfully, but these errors were encountered: