ropensci / skimr

A frictionless, pipeable approach to dealing with summary statistics
https://docs.ropensci.org/skimr
1.11k stars 79 forks source link

data.table + dtplyr throws `lazy_dt()` error when running skim() #621

Closed rsaporta closed 3 years ago

rsaporta commented 3 years ago

Summary:

Warning: You are using a dplyr method on a raw data.table, which will call the

  • data frame implementation, and is likely to be inefficient.
  • To suppress this message, either generate a data.table translation with
  • lazy_dt() or convert to a data frame or tibble with
  • as.data.frame()/as_tibble().

Reproducible example

Setup

library(skimr)
library(data.table)

## ensure warnings are not silenced
options(warn = 1)

## create a simple data.table
DT_letters <- data.table(abc = letters)

skimming works as expected, no warnings

skim(DT_letters)

if dtplyr is loaded, warnings are thrown

library(dtplyr)
skim(DT_letters)
elinw commented 3 years ago

Is there a sample data set with different kinds of variables that people like to use for data.table examples?

elinw commented 3 years ago

Okay I merged in the support data table branch a while ago. So as far as I know the current master addresses this, so I'm closing. If it's not, let me know.