Objects within skimr
are identified by a class, but they require additional
attributes and data columns for all operations to succeed. These checks help
ensure this. While they have some application externally, they are mostly
used internally.
Usage
has_type_column(object)
has_variable_column(object)
has_skimr_attributes(object)
has_skim_type_attribute(object)
has_skimmers(object)
is_data_frame(object)
is_skim_df(object)
is_one_skim_df(object)
is_skim_list(object)
could_be_skim_df(object)
assert_is_skim_df(object)
assert_is_skim_list(object)
assert_is_one_skim_df(object)
Details
Most notably, a skim_df
has columns skim_type
and skim_variable
. And
has the following special attributes
data_rows
: n rows in the original datadata_cols
: original number of columnsdf_name
: name of the original data framedt_key
: name of the key if original is a data.tablegroups
: if there were group variablesbase_skimmers
: names of functions applied to all skim typesskimmers_used
: names of functions used to skim each type
The functions in these checks work like all.equal()
. The return TRUE
if
the check passes, or otherwise notifies why the check failed. This makes them
more useful when throwing errors.
Functions
has_type_column()
: Does the object have theskim_type
column?has_variable_column()
: Does the object have theskim_variable
column?has_skimr_attributes()
: Does the object have the appropriateskimr
attributes?has_skim_type_attribute()
: Does the object have askim_type
attribute? This makes it aone_skim_df
.has_skimmers()
: Does the object have skimmers?is_data_frame()
: Is the object a data frame?is_skim_df()
: Is the object askim_df
?is_one_skim_df()
: Is the object aone_skim_df
? This is similar to askim_df
, but does not have thetype
column. That is stored as an attribute instead.is_skim_list()
: Is the object askim_list
?could_be_skim_df()
: Is this a data frame withskim_variable
andskim_type
columns?assert_is_skim_df()
: Stop if the object is not askim_df
.assert_is_skim_list()
: Stop if the object is not askim_list
.assert_is_one_skim_df()
: Stop if the object is not aone_skim_df
.