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 need to define a class that will work tightly with dplyr. As suggested in #1429 "...you need to define a method for your class for each dplyr method that correctly restores all the classes and attributes...". For most verbs it can be done because they are implemented as generic functions but not rowwise() (namely in dplyr 0.7.1). I understand that it only works with data frames but in current implementation one can't define a method for classes inheriting data.frame.
Is it intentional or just missing functionality? Maybe something like this might be better:
rowwise <- function(data) {
UseMethod("rowwise")
}
rowwise.default <- function(data) {
stop("Input should be a data.frame.")
}
rowwise.data.frame <- function(data) {
assert_all_white_list(data)
structure(data, class = c("rowwise_df", "tbl_df", "tbl", "data.frame"))
}
The text was updated successfully, but these errors were encountered:
I need to define a class that will work tightly with
dplyr
. As suggested in #1429 "...you need to define a method for your class for each dplyr method that correctly restores all the classes and attributes...". For most verbs it can be done because they are implemented as generic functions but notrowwise()
(namely in dplyr 0.7.1). I understand that it only works with data frames but in current implementation one can't define a method for classes inheritingdata.frame
.Is it intentional or just missing functionality? Maybe something like this might be better:
The text was updated successfully, but these errors were encountered: