/
data-doc.R
221 lines (190 loc) · 5.54 KB
/
data-doc.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Documenting exported data -----------------------------------------------
#' Means and sample sizes for GRIM-testing
#'
#' A fictional dataset with means and sample sizes of flying pigs. It can be
#' used to demonstrate the functionality of [`grim_map()`] and functions
#' building up on it.
#' @include utils.R grim-map.R seq-decimal.R
#'
#' @format A tibble (data frame) with 12 rows and 2 columns. The columns are:
#' \describe{
#' \item{x}{String. Means.}
#' \item{n}{Numeric. Sample sizes.}
#' }
#' @return A tibble (data frame).
#'
#' @seealso [`pigs2`] for GRIM-testing percentages instead of means, [`pigs3`]
#' for DEBIT-testing, and [`pigs4`] for detecting duplicates.
#'
#' @seealso [`pigs2`] for GRIM-testing percentages instead of means, [`pigs3`]
#' for DEBIT-testing, [`pigs4`] for detecting duplicates, and [`pigs5`] for
#' GRIMMER-testing.
#'
"pigs1"
#' Percentages and sample sizes for GRIM-testing
#'
#' A fictional dataset with percentages and sample sizes of flying pigs. It can
#' be used to demonstrate the functionality of `grim_map()`, particularly its
#' `percent` argument, and functions building up on it.
#' @include utils.R grim.R seq-decimal.R
#'
#' @format A tibble (data frame) with 6 rows and 2 columns. The columns are:
#' \describe{
#' \item{x}{String. Percentages.}
#' \item{n}{Numeric. Sample sizes.}
#' }
#' @return A tibble (data frame).
#'
#' @seealso `pigs1` for GRIM-testing means instead of percentages, [`pigs3`] for
#' DEBIT-testing, and [`pigs4`] for detecting duplicates.
#'
#' @seealso `pigs1` for GRIM-testing means, [`pigs3`] for DEBIT-testing,
#' [`pigs4`] for detecting duplicates, and [`pigs5`] for GRIMMER-testing.
#'
"pigs2"
#' Binary means and standard deviations for using DEBIT
#'
#' A fictional dataset with means and standard deviations from a binary
#' distribution related to flying pigs. It can be used to demonstrate the
#' functionality of `debit_map()` and functions building up on it.
#' @include utils.R debit-map.R seq-decimal.R
#'
#' @format A tibble (data frame) with 7 rows and 3 columns. The columns are:
#' \describe{
#' \item{x}{String. Means.}
#' \item{sd}{String. Standard deviations.}
#' \item{n}{Numeric. Sample sizes.}
#' }
#' @return A tibble (data frame).
#'
#' @seealso `pigs1` for GRIM-testing means, [`pigs2`] for GRIM-testing
#' percentages, and [`pigs4`] for detecting duplicates.
#'
#' @seealso `pigs1` for GRIM-testing means, [`pigs2`] for GRIM-testing
#' percentages instead of means, [`pigs4`] for detecting duplicates, and
#' [`pigs5`] for GRIMMER-testing.
#'
"pigs3"
#' Data with duplications
#'
#' A fictional dataset with observations of flying pigs. It contains multiple
#' duplicates. The dataset can be used to demonstrate the functionality of
#' `duplicate_*()` functions such as `duplicate_count()`.
#' @include utils.R duplicate-detect.R
#'
#' @format A tibble (data frame) with 5 rows and 3 columns, describing various
#' body measures of the fictional pigs. The columns are:
#' \describe{
#' \item{snout}{String. Snout width.}
#' \item{tail}{String. Tail length.}
#' \item{wings}{String. Wingspan.}
#' }
#' @return A tibble (data frame).
#'
#' @seealso `pigs1` for GRIM-testing means, [`pigs2`] for GRIM-testing
#' percentages, [`pigs3`] for using DEBIT, and [`pigs5`] for GRIMMER-testing.
#'
"pigs4"
#' Means, SDs, and sample sizes for GRIMMER-testing
#'
#' A fictional dataset with means, standard deviations (SDs), and sample sizes
#' of flying pigs. It can be used to demonstrate the functionality of
#' `grimmer_map()` and functions building up on it.
#' @include utils.R grimmer-map.R seq-decimal.R
#'
#' @format A tibble (data frame) with 12 rows and 3 columns. The columns are:
#' \describe{
#' \item{x}{String. Means.}
#' \item{sd}{String. Standard deviations.}
#' \item{n}{Numeric. Sample sizes.}
#' }
#' @return A tibble (data frame).
#'
#' @seealso `pigs1` for (only) GRIM-testing the same means as here, [`pigs2`]
#' for GRIM-testing percentages instead of means, [`pigs3`] for DEBIT-testing,
#' and [`pigs4`] for detecting duplicates.
#'
"pigs5"
# # Code for creating the data (normally outcommented) --------------------
# # GRIM for means:
# pigs1 <- tibble::tribble(
# ~x, ~n,
# "7.22", 32,
# "4.74", 25,
# "5.23", 29,
# "2.57", 24,
# "6.77", 27,
# "2.68", 28,
# "7.01", 29,
# "7.38", 26,
# "3.14", 27,
# "6.89", 31,
# "5.00", 25,
# "0.24", 28,
# )
#
#
# # GRIM for percentages:
# pigs2 <- tibble::tribble(
# ~x,
# "67.4",
# "54.2",
# "54.0",
# "69.8",
# "68.1",
# "55.4",
# ) %>%
# dplyr::mutate(n = 150)
#
#
# # DEBIT:
# pigs3 <- tibble::tribble(
# ~x, ~sd,
# "0.53", "0.50",
# "0.44", "0.50",
# "0.77", "0.42",
# "0.19", "0.35",
# "0.34", "0.47",
# "0.93", "0.25",
# "0.12", "0.33"
# ) %>%
# dplyr::mutate(n = 1683)
#
#
# pigs4 <- tibble::tribble(
# ~snout, ~tail, ~wings,
# "4.73", "6.88", "6.09",
# "8.13", "7.33", "8.27",
# "4.22", "5.17", "4.40",
# "4.22", "7.57", "5.92",
# "5.17", "8.13", "5.17"
# )
#
#
# # GRIMMER:
# pigs5 <- tibble::tribble(
# ~x, ~sd, ~n,
# "7.22", "5.30", 38,
# "4.74", "6.55", 31,
# "5.23", "2.55", 35,
# "2.57", "2.57", 30,
# "6.77", "2.18", 33,
# "2.68", "2.59", 34,
# "7.01", "6.68", 35,
# "7.38", "3.65", 32,
# "3.14", "5.32", 33,
# "6.89", "4.18", 37,
# "5.00", "2.18", 31,
# "0.24", "6.43", 34
# )
#
#
# # Save data:
# usethis::use_data(
# pigs1,
# pigs2,
# pigs3,
# pigs4,
# pigs5,
# overwrite = TRUE
# )