As mentioned in #3542, reshape2 is dead since a year ago.
We removed it from suggests but still have some snippets like:
ns = tryCatch(getNamespace("reshape2"), error=function(e)
stop("The dcast generic in data.table has been passed a ",class(data)[1L]," (not a data.table) but the reshape2 package is not installed to process this type. Please either install reshape2 and try again, or pass a data.table to dcast instead."))
ns$dcast(data, formula, fun.aggregate = fun.aggregate, ..., margins = margins,
subset = subset, fill = fill, value.var = value.var)
I don't think it makes sense to support such functionality anymore.
Question is, are we safe to just get rid of it right away, or do we need to lifecycle it out?
According to comment (probably very old one) in melt
# if data is not data.table and reshape2 is installed, this won't dispatch to reshape2's method;
# CRAN package edarf and others fail without the else branch
Question is, should we create generic methods for dcast and melt?
I thought we already have such generics?
On Tue, May 14, 2019, 8:03 PM Jan Gorecki notifications@github.com wrote:
According to comment (probably very old one) in melt
# if data is not data.table and reshape2 is installed, this won't dispatch to reshape2's method; # CRAN package edarf and others fail without the else branchQuestion is, should we create generic methods for dcast and melt?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Rdatatable/data.table/issues/3549?email_source=notifications&email_token=AB2BA5PBOSH2Y5EUNCUVY3TPVKTALA5CNFSM4HLKLF2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVLID5A#issuecomment-492208628,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB2BA5IOPCXMR57VRAE3X3TPVKTALANCNFSM4HLKLF2A
.
lines 98-108 of NAMESPACE?
By default, if any of the columns to be melted are of type
factor, it'll be coerced tocharactertype. This is to be compatible withreshape2'smelt.data.frame.
Now that we're taking ownership of dcast/melt, do we want to continue this backward-compatibility?
Of course we'd have to go through a deprecation cycle, but ultimately do we agree with this behavior?
Ditto:
warning("To be consistent with reshape2's melt, id.vars and measure.vars are internally guessed when both are 'NULL'. All non-numeric/integer/logical type columns are considered id.vars, which in this case are columns [%s]. Consider providing at least one of 'id' or 'measure' vars in future.", CHAR(STRING_ELT(concat(dtnames, idcols), 0)));
FWIW reshape2 is not dead nor deprecated, it is only "retired". This means that development has stopped but it continues to be maintained on CRAN and will continue to work for the foreseeable future.
You can see our lifecycle definitions at https://www.tidyverse.org/lifecycle/#retired.