tableList {tableMatrix}R Documentation

tableList constructor

Description

tableList constructor, creates tableList object from a data.frame or a data.table and from aid data. The goal is to wrap data.table and any additional data structures together. tableList behaves like a data.table object. Groups of attributes can be stored together via dataType.

Usage

tableList(tabData, aidData = list(), dataType = NULL)

Arguments

tabData

A data.frame or a data.table.

aidData

Aid structures, generally in the form of a list.

dataType

Named list. Contains names of groups of attributes, elements are attributes which belong to the group.

Value

A tableList object

See Also

dim.tableList, dimnames.tableList rbind.tableList

Examples


data(chickwts)

# Bundle chickwts data.frame together with a linear model
TL <- tableList(chickwts, lm(weight~feed, chickwts))

# tableList behaves like a data.table  
mean(TL[feed=="casein", weight])

# Aid part of the tableList object carries the linear model
aid(TL)

# dataType support
TL <- tableList(chickwts, lm(weight~feed, chickwts), dataType=list(group1="weight", group2="feed"))


[Package tableMatrix version 0.82.0 Index]