Debian Codegraph @

man/skim-obj.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/skim_obj.R
3 \name{skim-obj}
4 \alias{skim-obj}
5 \alias{has_type_column}
6 \alias{has_variable_column}
7 \alias{has_skimr_attributes}
8 \alias{has_skim_type_attribute}
9 \alias{has_skimmers}
10 \alias{is_data_frame}
11 \alias{is_skim_df}
12 \alias{is_one_skim_df}
13 \alias{is_skim_list}
14 \alias{could_be_skim_df}
15 \alias{assert_is_skim_df}
16 \alias{assert_is_skim_list}
17 \alias{assert_is_one_skim_df}
18 \title{Test if an object is compatible with \code{skimr}}
19 \usage{
20 has_type_column(object)
21
22 has_variable_column(object)
23
24 has_skimr_attributes(object)
25
26 has_skim_type_attribute(object)
27
28 has_skimmers(object)
29
30 is_data_frame(object)
31
32 is_skim_df(object)
33
34 is_one_skim_df(object)
35
36 is_skim_list(object)
37
38 could_be_skim_df(object)
39
40 assert_is_skim_df(object)
41
42 assert_is_skim_list(object)
43
44 assert_is_one_skim_df(object)
45 }
46 \arguments{
47 \item{object}{Any \code{R} object.}
48 }
49 \description{
50 Objects within \code{skimr} are identified by a class, but they require additional
51 attributes and data columns for all operations to succeed. These checks help
52 ensure this. While they have some application externally, they are mostly
53 used internally.
54 }
55 \details{
56 Most notably, a \code{skim_df} has columns \code{skim_type} and \code{skim_variable}. And
57 has the following special attributes
58 \itemize{
59 \item \code{data_rows}: n rows in the original data
60 \item \code{data_cols}: original number of columns
61 \item \code{df_name}: name of the original data frame
62 \item \code{dt_key}: name of the key if original is a data.table
63 \item \code{groups}: if there were group variables
64 \item \code{base_skimmers}: names of functions applied to all skim types
65 \item \code{skimmers_used}: names of functions used to skim each type
66 }
67
68 The functions in these checks work like \code{\link[=all.equal]{all.equal()}}. The return \code{TRUE} if
69 the check passes, or otherwise notifies why the check failed. This makes them
70 more useful when throwing errors.
71 }
72 \section{Functions}{
73 \itemize{
74 \item \code{has_type_column()}: Does the object have the \code{skim_type} column?
75
76 \item \code{has_variable_column()}: Does the object have the \code{skim_variable} column?
77
78 \item \code{has_skimr_attributes()}: Does the object have the appropriate \code{skimr} attributes?
79
80 \item \code{has_skim_type_attribute()}: Does the object have a \code{skim_type} attribute? This makes
81 it a \code{one_skim_df}.
82
83 \item \code{has_skimmers()}: Does the object have skimmers?
84
85 \item \code{is_data_frame()}: Is the object a data frame?
86
87 \item \code{is_skim_df()}: Is the object a \code{skim_df}?
88
89 \item \code{is_one_skim_df()}: Is the object a \code{one_skim_df}? This is similar to a
90 \code{skim_df}, but does not have the \code{type} column. That is stored as an
91 attribute instead.
92
93 \item \code{is_skim_list()}: Is the object a \code{skim_list}?
94
95 \item \code{could_be_skim_df()}: Is this a data frame with \code{skim_variable} and
96 \code{skim_type} columns?
97
98 \item \code{assert_is_skim_df()}: Stop if the object is not a \code{skim_df}.
99
100 \item \code{assert_is_skim_list()}: Stop if the object is not a \code{skim_list}.
101
102 \item \code{assert_is_one_skim_df()}: Stop if the object is not a \code{one_skim_df}.
103
104 }}