diff --git a/NAMESPACE b/NAMESPACE index d712b318a..8381a14a7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -139,7 +139,6 @@ S3method(split, data.table) export(dcast, melt) S3method(dcast, data.table) S3method(melt, data.table) -S3method(melt, default) # exported for historical reasons -- if reshape2 is higher on search path, # dcast(DT) will not dispatch since reshape2::dcast is not generic. So users diff --git a/NEWS.md b/NEWS.md index 4afcc380b..10c3e6961 100644 --- a/NEWS.md +++ b/NEWS.md @@ -46,7 +46,7 @@ 9. `foverlaps()` no longer crashes due to out-of-bounds access to list and integer vectors when `y` has no rows or the non-range part of the join fails, [#7597](https://github.com/Rdatatable/data.table/issues/7597). Thanks to @nextpagesoft for the report and @aitap for the fix. -10. The dynamic library now exports only `R_init_data_table`, preventing symbol name conflicts like `hash_create` with PostgreSQL, [#7605](https://github.com/Rdatatable/data.table/issues/7605). Thanks to @ced75 for the report and @aitap for the fix +10. The dynamic library now exports only `R_init_data_table`, preventing symbol name conflicts like `hash_create` with PostgreSQL, [#7605](https://github.com/Rdatatable/data.table/issues/7605). Thanks to @ced75 for the report and @aitap for the fix. ### Notes @@ -60,6 +60,8 @@ 5. The data.table test suite is a bit more robust to lacking UTF-8 support via a new `requires_utf8` argument to `test()` to skip tests when UTF-8 support is not available, [#7336](https://github.com/Rdatatable/data.table/issues/7336). Thanks @MichaelChirico for the suggestion and @ben-schwen for the implementation. +6. `melt()` and `dcast()` no longer provide nudges when receiving incompatible inputs (e.g. data.frames). As of now, we only define methods for `data.table` inputs. + ## data.table [v1.18.0](https://github.com/Rdatatable/data.table/milestone/37?closed=1) 23 December 2025 ### BREAKING CHANGE diff --git a/R/fcast.R b/R/fcast.R index 1bcc2916f..c11eb76d5 100644 --- a/R/fcast.R +++ b/R/fcast.R @@ -12,9 +12,6 @@ dcast = function( data, formula, fun.aggregate = NULL, ..., margins = NULL, subset = NULL, fill = NULL, value.var = guess(data) ) { - # TODO(>=1.19.0): Remove this, just let dispatch to 'default' method fail. - if (!is.data.table(data)) - stopf("The %1$s generic in data.table has been passed a %2$s, but data.table::%1$s currently only has a method for data.tables. Please confirm your input is a data.table, with setDT(%3$s) or as.data.table(%3$s). If you intend to use a method from reshape2, try installing that package first, but do note that reshape2 is superseded and is no longer actively developed.", "dcast", class1(data), deparse(substitute(data))) # nocov UseMethod("dcast", data) } diff --git a/R/fmelt.R b/R/fmelt.R index e0596f73f..85a8a641e 100644 --- a/R/fmelt.R +++ b/R/fmelt.R @@ -7,11 +7,6 @@ melt = function(data, ..., na.rm = FALSE, value.name = "value") { UseMethod("melt", data) } -# TODO(>=1.19.0): Remove this, just let dispatch to 'default' method fail. -melt.default = function(data, ..., na.rm = FALSE, value.name = "value") { - stopf("The %1$s generic in data.table has been passed a %2$s and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is superseded and is no longer actively developed, and this redirection is now deprecated. To continue using melt methods from reshape2 while both packages are attached, e.g. melt.list, you can prepend the namespace, i.e. reshape2::%1$s(%3$s). In the next version, this warning will become an error.", "melt", class1(data), deparse(substitute(data))) # nocov -} - patterns = function(..., cols=character(0L), ignore.case=FALSE, perl=FALSE, fixed=FALSE, useBytes=FALSE) { # if ... has no names, names(list(...)) will be ""; # this assures they'll be NULL instead