Skip to content

DT::formatXXX() should throw clearer errors when table is not a table object #785

@shrektan

Description

@shrektan

Ref to https://stackoverflow.com/questions/60659666/changing-color-for-cells-on-dt-table-in-shiny

The new beginners may call DT::formatXXX() on DT::renderDT(). It will cause an error (DT v1.12) complaining the "data's column name is", which is difficult for the user to figure out.

I think a clearer error message should be thrown.

The example

DT::formatPercentage(list(), 'a')
#> Error in name2int(name, names, rownames): You specified the columns: a, but the column names of the data are

Created on 2020-03-25 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions