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
When using pander to print a data.table, if the first variable on which the table is keyed is a factor variable, pander causes an error to be thrown. The problem is on lines 258 and 260 of S3.R:
row.names.dt <- x[[data.table::key(x)[1]]]
If the first variable is a factor variable, then when you attempt to set the row.names:
data.table::setattr(x, 'row.names', row.names.dt)
An error is thrown:
Error in setattr(test, "row.names", test[[key(test)[1]]]) :
row names must be 'character' or 'integer', not 'integer'
Coercing row.names.dt to character before passing it to setattr() should solve the issue.
The text was updated successfully, but these errors were encountered:
When using pander to print a data.table, if the first variable on which the table is keyed is a factor variable, pander causes an error to be thrown. The problem is on lines 258 and 260 of
S3.R
:If the first variable is a factor variable, then when you attempt to set the
row.names
:An error is thrown:
Coercing
row.names.dt
to character before passing it tosetattr()
should solve the issue.The text was updated successfully, but these errors were encountered: