Skip to content

Commit

Permalink
search registered S3 method for melt generic
Browse files Browse the repository at this point in the history
  • Loading branch information
odelmarcelle authored Jan 2, 2021
1 parent 33d67c4 commit ee35980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/fmelt.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# redirection as well

melt <- function(data, ..., na.rm = FALSE, value.name = "value") {
if (is.data.table(data)) {
if (inherits(data, sub("melt\\.", "", as.character(methods(melt))))) {
UseMethod("melt", data)
# if data is not data.table and reshape2 is installed, this won't dispatch to reshape2's method;
# if no method is registered for data and reshape2 is installed, this won't dispatch to reshape2's method;
# CRAN package edarf and others fail without the else branch
# nocov start
} else {
Expand Down

0 comments on commit ee35980

Please sign in to comment.