ListData: Makes a list includable in a data.frame

View source: R/ListData.R

ListDataEnvR Documentation

Makes a list includable in a data.frame

Description

data.frame objects treat lists as variables and not as cases. This functions presents the list as data to a data.frame. For better printing the elements of the list will be represented as a name.

Usage

ListDataEnv

ListData(x)

ListDataRecover(hash)

storingDigester(x, env = environment(x))

## S3 method for class 'ListData'
format(x, ...)

## S3 method for class 'BData'
format(x, ...)

## S3 method for class 'ListData'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

## S3 method for class 'BData'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

a list like to be converted to something includable in a data.frame.

hash

the displayed name of the object as character string

env

the environment keeping the object in the hash, if none provided, .GlobalEnv is used.

...

for generic use

row.names

the row names for the dataset

optional

unused, see [as.data.frame] for details

Format

An object of class environment of length 1.

Details

The first letter of the name is the first letter of the class, then comes a '_' and then a alphanumerical digest, of the objects. As long as the object is in reach, it can be inspected by this name.

Afterwards an NA of class "ForgottenObject" is returned.

Value

the object x with an additional "ListData" class attribute

Methods (by generic)

  • format(ListData): formats as the digest

  • as.data.frame(ListData): converts to a data.frame

Functions

  • ListDataEnv: the environment in which the digests can be found

  • ListDataRecover(): recovers object from the digest

  • storingDigester(): returns a recoverable digest of the object

  • format(BData): formats as the digest

  • as.data.frame(BData): converts to a data.frame

Examples

FX = ListData(
   list(function(x) x,
        function(x) x^2,
        function(x) x^3))
FX
D = data.frame(X=FX,Y=FX)
D
N = format(FX)[[1]]
N
ListDataRecover(N)
attach(ListDataEnv)
get(N)
N2 = storingDigester(function(x) sin(x))
N2
ListDataRecover(N2)
detach(ListDataEnv)


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.