as.dfObj: Promote a Data Frame to Another Object Class

Description Usage Arguments Details Value See Also

View source: R/as.dfObj.bare.R

Description

Promote a data frame to another object class, or do validity checking of such an object. This is an internal function not intended to be called by package users.

Usage

1
as.dfObj(x, objClass)

Arguments

x

An object inheriting from data.frame. Each row contains information about the content, location, and/or graphical properties of one table entry, hvrule, or block. Alternatively, x may be NULL, in which case a valid but empty object (no entries, hvrules, or blocks) is returned.

objClass

Character string giving the class of the object to be returned/ checked. One of: "tblEntries", "tblBlocks", "prEntries", "prHvrules", "prBlocks".

Details

This is a backend to the as.<objClass> functions.

The purpose of this function is to reduce code repetition by factoring out common tasks when promoting a data frame to one of the data frame-based objects in the package (or checking the validity of such objects).

For all objects, row names are set equal to the id column.

Value

An object with S3 classes given by objClass and "data.frame".

See Also

tblEntries, tblBlocks, prEntries, prHvrules, prBlocks; dfSpecs returns info about the fields required for each object class.


tablesgg documentation built on June 3, 2021, 1:06 a.m.