tables: Display all objects of class 'data.table'

Description Usage Arguments Value See Also Examples

Description

Lists all data.table's in memory, including number of rows, column names and any keys.

Usage

1
tables(mb = TRUE, order.col = "NAME", width = 80, env=parent.frame(), silent=FALSE)

Arguments

mb

TRUE adds size of the data.table in MB to the output (slow in older versions of R).

order.col

Quoted column name to sort the output by

width

Number of characters to truncate the COLS output

env

Usually tables() is executed at the prompt where parent.frame() returns .GlobalEnv. tables() may also be useful inside functions where parent.frame() is the local scope of the function, or set it to .GlobalEnv

silent

By default tables() is expected to be called at the prompt for its compact print output. silent=TRUE prints nothing. The data statistics are returned as a data.table, silently, whether silent is TRUE or FALSE

Value

A data.table containing the information printed.

See Also

data.table, setkey, ls, objects, object.size

Examples

1
2
3
4
    DT = data.table(A=1:10,B=letters[1:10])
    DT2 = data.table(A=1:10000,ColB=10000:1)
    setkey(DT,B)
    tables()

Example output

     NAME   NROW NCOL MB COLS   KEY
[1,] DT       10    2  1 A,B    B  
[2,] DT2  10,000    2  1 A,ColB    
Total: 2MB

data.table documentation built on May 2, 2019, 4:57 p.m.