Describe the class(es) of an object
describe_class(x, strict_description = TRUE) # S3 method for factor describe_class(x, strict_description = TRUE) # S3 method for default describe_class(x, strict_description = TRUE)
x | The object to describe |
---|---|
strict_description | Should differing factor levels be treated
as differences for the purposes of identifying mismatches?
|
A character scalar describing the class(es) of an object where if the scalar will match, columns in a data.frame (or similar object) should bind together without issue.
For package developers, an S3 generic method can be written for
describe_class()
for custom classes that may need more definition
than the default method. This function is called by compare_df_cols
.
factor
: Describe factors with their levels
and if they are ordered.
default
: List all classes of an object.
Other Data frame type comparison:
compare_df_cols_same()
,
compare_df_cols()
describe_class(1)#> [1] "numeric"#> [1] "factor(levels=c(\"A\"))"#> [1] "ordered, factor(levels=c(\"A\", \"B\"))"#> [1] "factor"