rstudio / DT

R Interface to the jQuery Plug-in DataTables
https://rstudio.github.io/DT/
Other
587 stars 184 forks source link

Error in isRowColList since R 4.3.0 #1095

Closed AntoineMichelet closed 8 months ago

AntoineMichelet commented 8 months ago

Hi, Since R 4.3.0 :

"Calling && or || with LHS or (if evaluated) RHS of length greater than one is now always an error, with a report of the form 'length = 4' in coercion to 'logical(1)' Environment variable _R_CHECK_LENGTH_1LOGIC2 no longer has any effect."

Function isRowColList in datatables.R is implemented like this: isRowColList = function(x) is.list(x) && names(x) %in% c('rows', 'cols')

And then fails when it is called with error : length = 2' in coercion to 'logical(1)'

Suggested fix: isRowColList = function(x) is.list(x) && all(names(x) %in% c('rows', 'cols'))

Rgds,


By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

yihui commented 8 months ago

Should be fixed now. Thanks for the report! You can install the development version via

remotes::install_github('rstudio/DT')