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
This function works if myData is a data frame, but it returns an error if myData is a data table.
Error in melt.data.table(input, id.vars = by, measure.vars = var) :
argument "var" is missing, with no default
This will work if I default var to a NULL value, but then the data frame version will result in an error.
My question is: Is there a reason for the inconsistency? It would be nice to have melt.data.table suppor missing arguments so that there is not a need for the programmer to check the class of myData.
The text was updated successfully, but these errors were encountered:
@dardesta, thanks for the report. But, could you please provide a minimal reproducible example - what's myData, var, by etc..? So that I can try to reproduce the issue. Thanks.
I have a transpose function that imitates the arguments used in SAS.
transpose = function(input, by, var){
melt(input, id.vars = by, measure.vars=var)
}
Function Call
transpose(myData, by="Year")
This function works if myData is a data frame, but it returns an error if myData is a data table.
Error in melt.data.table(input, id.vars = by, measure.vars = var) :
argument "var" is missing, with no default
This will work if I default var to a NULL value, but then the data frame version will result in an error.
My question is: Is there a reason for the inconsistency? It would be nice to have melt.data.table suppor missing arguments so that there is not a need for the programmer to check the class of myData.
The text was updated successfully, but these errors were encountered: