Debian Codegraph @

man/stats.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/stats.R
3 \name{stats}
4 \alias{stats}
5 \alias{n_missing}
6 \alias{n_complete}
7 \alias{complete_rate}
8 \alias{n_whitespace}
9 \alias{sorted_count}
10 \alias{top_counts}
11 \alias{inline_hist}
12 \alias{n_empty}
13 \alias{min_char}
14 \alias{max_char}
15 \alias{n_unique}
16 \alias{ts_start}
17 \alias{ts_end}
18 \alias{inline_linegraph}
19 \alias{list_lengths_min}
20 \alias{list_lengths_median}
21 \alias{list_lengths_max}
22 \alias{list_min_length}
23 \alias{list_max_length}
24 \alias{min_date}
25 \alias{max_date}
26 \title{Summary statistic functions}
27 \usage{
28 n_missing(x)
29
30 n_complete(x)
31
32 complete_rate(x)
33
34 n_whitespace(x)
35
36 sorted_count(x)
37
38 top_counts(x, max_char = 3, max_levels = 4)
39
40 inline_hist(x, n_bins = 8)
41
42 n_empty(x)
43
44 min_char(x)
45
46 max_char(x)
47
48 n_unique(x)
49
50 ts_start(x)
51
52 ts_end(x)
53
54 inline_linegraph(x, length.out = 16)
55
56 list_lengths_min(x)
57
58 list_lengths_median(x)
59
60 list_lengths_max(x)
61
62 list_min_length(x)
63
64 list_max_length(x)
65
66 min_date(x)
67
68 max_date(x)
69 }
70 \arguments{
71 \item{x}{A vector}
72
73 \item{max_char}{In \code{top} = 3, max_levels = 4}
74
75 \item{max_levels}{The maximum number of levels to be displayed.}
76
77 \item{n_bins}{In \code{inline_hist}, the number of histogram bars.}
78
79 \item{length.out}{In \code{inline_linegraph}, the length of the character time
80 series.}
81 }
82 \description{
83 \code{skimr} provides extensions to a variety of functions with R's stats package
84 to simplify creating summaries of data. All functions are vectorized over the
85 first argument. Additional arguments should be set in the \code{\link[=sfl]{sfl()}} that sets
86 the appropriate skimmers for a data type. You can use these, along with other
87 vectorized R functions, for creating custom sets of summary functions for
88 a given data type.
89 }
90 \section{Functions}{
91 \itemize{
92 \item \code{n_missing()}: Calculate the sum of \code{NA} and \code{NULL} (i.e. missing) values.
93
94 \item \code{n_complete()}: Calculate the sum of not \code{NA} and \code{NULL} (i.e. missing)
95 values.
96
97 \item \code{complete_rate()}: Calculate complete values; complete values are not missing.
98
99 \item \code{n_whitespace()}: Calculate the number of rows containing only whitespace
100 values using s+ regex.
101
102 \item \code{sorted_count()}: Create a contingency table and arrange its levels in
103 descending order. In case of ties, the ordering of results is alphabetical
104 and depends upon the locale. \code{NA} is treated as a ordinary value for
105 sorting.
106
107 \item \code{top_counts()}: Compute and collapse a contingency table into a single
108 character scalar. Wraps \code{\link[=sorted_count]{sorted_count()}}.
109
110 \item \code{inline_hist()}: Generate inline histogram for numeric variables. The
111 character length of the histogram is controlled by the formatting options
112 for character vectors.
113
114 \item \code{n_empty()}: Calculate the number of blank values in a character vector.
115 A "blank" is equal to "".
116
117 \item \code{min_char()}: Calculate the minimum number of characters within a
118 character vector.
119
120 \item \code{max_char()}: Calculate the maximum number of characters within a
121 character vector.
122
123 \item \code{n_unique()}: Calculate the number of unique elements but remove \code{NA}.
124
125 \item \code{ts_start()}: Get the start for a time series without the frequency.
126
127 \item \code{ts_end()}: Get the finish for a time series without the frequency.
128
129 \item \code{inline_linegraph()}: Generate inline line graph for time series variables. The
130 character length of the line graph is controlled by the formatting options
131 for character vectors.
132 Based on the function in the pillar package.
133
134 \item \code{list_lengths_min()}: Get the length of the shortest list in a vector of lists.
135
136 \item \code{list_lengths_median()}: Get the median length of the lists.
137
138 \item \code{list_lengths_max()}: Get the maximum length of the lists.
139
140 \item \code{list_min_length()}: Get the length of the shortest list in a vector of lists.
141
142 \item \code{list_max_length()}: Get the length of the longest list in a vector of lists.
143
144 \item \code{min_date()}: Calculate the minimum within a
145 Date vector.
146
147 \item \code{max_date()}: Calculate the maximum of
148 Date vector.
149
150 }}
151 \seealso{
152 \code{\link[=get_skimmers]{get_skimmers()}} for customizing the functions called by \code{\link[=skim]{skim()}}.
153 }