as.data.frame.exdf: Convert an exdf object to a data frame

View source: R/exdf.R

as.data.frame.exdfR Documentation

Convert an exdf object to a data frame

Description

Converts an exdf object to a data frame by appending the units and categories to the top of each column in the exdf object's main_data data frame. Typically this function is used for displaying the contents of an exdf object; in fact, it is used internally by View, write.csv, and other functions. The main_data of an exdf object x can be accessed directly (without including the units and categories in the first row) via x[['main_data']] as with any other list element.

Usage

  ## S3 method for class 'exdf'
as.data.frame(x, ...)

Arguments

x

An exdf object.

...

Unused.

Value

A data frame formed from x.

See Also

exdf

Examples

simple_exdf <- exdf(data.frame(A = 1), data.frame(A = 'u'), data.frame(A = 'c'))
as.data.frame(simple_exdf) # Includes units and categories in the first rows
simple_exdf[['main_data']] # Just returns the main data

PhotoGEA documentation built on April 11, 2025, 5:48 p.m.