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.
as.dfObj(x, objClass)
An object with S3 classes given by objClass
and "data.frame".
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.
Character string giving the class of the object to be returned/ checked. One of: "tblEntries", "tblBlocks", "prEntries", "prHvrules", "prBlocks".
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.
tblEntries
, tblBlocks
,
prEntries
, prHvrules
, prBlocks
;
dfSpecs
returns info about the fields required for each
object class.