unclass_tbl {ricu} | R Documentation |
Internal utilities for ICU data objects
Description
In order to remove all id_tbl
/ts_tbl
-related attributes, as well as
extra class-labels, the exported but marked internal function
unclass_tbl()
can be used. This function provides what one might expect
from an id_tbl
/ts_tbl
-specific implementation of the S3 generic
function data.table::as.data.table()
. The inverse functionality if
provided by reclass_tbl()
which attempts to add attributes as seen in
template
to the object passed as x
. The logical flag stop_on_fail
controls how to proceed if the attributes of template
are incompatible
with the object x
. Finally, in order to generate a template, as_ptype()
creates an empty object with the appropriate attributes.
Usage
unclass_tbl(x)
reclass_tbl(x, template, stop_on_fail = TRUE)
as_ptype(x)
Arguments
x |
Object to modify/query |
template |
Object after which to model the object in question |
stop_on_fail |
Logical flag indicating whether to consider failed object validation as error |
Value
-
unclass_tbl()
: adata.table
-
reclass_tbl()
: either anid_tbl
or ats_tbl
depending on the type of the object passed astemplate
-
as_ptype()
: an object of the same type asx
, but with on data