XDataFrame-class {Cardinal}R Documentation

XDataFrame: DataFrame with eXtra metadata columns

Description

An XDataFrame is an extension of the DataFrame class as defined in the 'S4Vectors' package, modified to support eXtra "slot-columns" that behave differently from other columns. It is intended to facilitate data.frame-like classes that require specialized column access and behavior. The specialized slot-columns are stored as distinct slots, unlike regular columns.

Usage

XDataFrame(...)

Arguments

...

Arguments passed to the DataFrame().

Details

For the most part, XDataFrame behaves identically to DataFrame, with the exception of certain methods being overwritten to account for the additional eXtra "slot-columns" not counted among those returned by ncol(x). These additional columns should typically have their own getter and setter methods.

Methods

names(object):

Return the column names, not including any slot-columns.

length(object):

Return the number of columns, not including any slot-columns.

lapply(X, FUN, ..., slots = FALSE):

Returns a list of the same length as X, where each element is the result of applying FUN to the corresponding element of X. This version includes an additional argument for whether the slot-columns should be included or not. This method should be overwritten by subclasses to ensure correct behavior.

as.env(x, ...):

Create an environment from x with a symbol for each column, including the slot-columns. This method should be overwritten by subclasses to ensure correct behavior.

Author(s)

Kylie A. Bemis

See Also

DataFrame, MassDataFrame, PositionDataFrame

Examples

## Create an XDataFrame object
XDataFrame(x=1:10, y=letters[1:10])

[Package Cardinal version 2.0.4 Index]