ShuguangSun / ess-view-data

View data support for ESS
GNU General Public License v3.0
47 stars 5 forks source link

When using data.table backend `ess-view-data-unique` throws `could not find function` #14

Closed Loisel closed 2 years ago

Loisel commented 2 years ago

This is what I get when I try to filter unique values for the mpg column of mtcars:

# Trace: as.data.table(mtcars)
# Last:  %>% unique(., by = .(mpg))
Error in .(mpg) : could not find function "."

I'm using magrittr 2.0.1, data.table 1.14.2 on R 4.1.1, and ess-view-data 20211001.1717.

Eventually this is not surprising since .() is only replaced by list() in the square brackets of a data.table (DT[...]) as far as I know. Do I have to load any additional packages?

ShuguangSun commented 2 years ago

Fixed. Pleaes help test it.

It seems due to the change from data.table:

      by: 'character' or 'integer' vector indicating which combinations
          of columns from 'x' to use for uniqueness checks. By default
          all columns are being used. That was changed recently for
          consistency to data.frame methods. In version '< 1.9.8'
          default was 'key(x)'.
Loisel commented 2 years ago

Looks good, thanks for the timely response!