Skip to contents

Allow to quickly check if an object is a data.table

Usage

check_dt(dt)

Arguments

dt

The object to check

Value

A boolean:

* TRUE the object is a data.table

* FALSE the object is not a data.table

Details

This function checks if the class data.table is among the considered object's classes.

Examples

# load data.table
library(data.table)
#> data.table 1.14.4 using 2 threads (see ?getDTthreads).  Latest news: r-datatable.com
#> 
#> Attaching package: ‘data.table’
#> The following objects are masked from ‘package:lubridate’:
#> 
#>     hour, isoweek, mday, minute, month, quarter, second, wday, week,
#>     yday, year
#> The following objects are masked from ‘package:dplyr’:
#> 
#>     between, first, last

# data.table creation
dt <- data.table()

# check if `dt` is a data.table
check_dt(dt)
#> [1] TRUE