d.t: data.table shortened alternatives

Description Usage Arguments Value TODO See Also Examples

Description

Shortented versions of data.table's functions data.table, rbindlist, and base's data.frame.

Usage

1
2
3
4
5
6
d.t(..., keep.rownames = FALSE, check.names = FALSE, key = NULL)

d.f(..., row.names = NULL, check.rows = FALSE, check.names = TRUE,
  fix.empty.names = TRUE, stringsAsFactors = default.stringsAsFactors())

rbl(l, use.names = fill, fill = FALSE, idcol = NULL)

Arguments

...

Just as ... in data.frame. Usual recycling rules are applied to vectors of different lengths to create a list of equal length vectors.

keep.rownames

If ... is a matrix or data.frame, TRUE will retain the rownames of that object in a column named rn.

check.names

Just as check.names in data.frame.

key

Character vector of one or more column names which is passed to setkey. It may be a single comma separated string such as key="x,y,z", or a vector of names such as key=c("x","y","z").

row.names

NULL or a single integer or character string specifying a column to be used as row names, or a character or integer vector giving the row names for the data frame.

check.rows

if TRUE then the rows are checked for consistency of length and names.

fix.empty.names

logical indicating if arguments which are “unnamed” (in the sense of not being formally called as someName = arg) get an automatically constructed name or rather name "". Needs to be set to FALSE even when check.names is false if "" names should be kept.

stringsAsFactors

logical: should character vectors be converted to factors? The ‘factory-fresh’ default is TRUE, but this can be changed by setting options(stringsAsFactors = FALSE).

l

A list containing data.table, data.frame or list objects. At least one of the inputs should have column names set. ... is the same but you pass the objects by name separately.

use.names

If TRUE items will be bound by matching column names. By default FALSE for rbindlist (for backwards compatibility) and TRUE for rbind (consistency with base). Columns with duplicate names are bound in the order of occurrence, similar to base. When TRUE, at least one item of the input list has to have non-null column names.

fill

If TRUE fills missing columns with NAs. By default FALSE. When TRUE, use.names has to be TRUE, and all items of the input list has to have non-null column names.

idcol

Generates an index column. Default (NULL) is not to. If idcol=TRUE then the column is auto named .id. Alternatively the column name can be directly provided, e.g., idcol = "id".

If input is a named list, ids are generated using them, else using integer vector from 1 to length of input list. See examples.

Value

Functions return the same objects as the original functions.

TODO

See Also

data.table

Examples

1
2
3
4
5
6
7
8
# Normal example #
dt <- d.t(x = c(1:3), y = letters[1:3], key = 'y')
key(dt)
# Without argument name #
d.t(c(1:3))

d.f(c(1:3)) # Normal data.frame
rbl(list(d.t(a = 1, b = 1), d.t(a = 2, b = 2)))

equastat/Emisc documentation built on May 16, 2019, 8:24 a.m.