Note 1: aldf
is a compact alias for as_labeled_data_frame
: they do the same
thing, and the former is easier to type
Note 2: as_labeled_data_frame
is used internally by other labelr commands
and is not intended for interactive use.
To minimize dependencies and complexities, labelr label-assigning
functions are designed to work exclusively with Base R data.frames, not
alternative data structures like matrices or augmented data.frames, such as
data.tables or tibbles.
as_labeled_data_frame
determines whether data argument is a conventional
Base R data.frame, some kind of augmented data.frame (e.g., data.table,
tibble), or not a data.frame at all (e.g., matrix). If the submitted object
is a type of data.frame, the object will be returned with the class
labeled.data.frame applied, the class data.frame retained, and any other
previous class attributes discarded. If the supplied object is not any kind
of data.frame (i.e., a matrix is not any kind of data.frame, while a data.table
is a kind of data.frame), an error is thrown.