-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataReporter_presidentData_custom.Rmd
373 lines (222 loc) · 10.3 KB
/
dataReporter_presidentData_custom.Rmd
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
---
dataReporter: yes
title: presidentData
subtitle: "Autogenerated data summary from dataReporter"
date: 2020-12-03 15:20:52
output: pdf_document
geometry: margin=2cm
documentclass: report
header-includes:
- \renewcommand{\chaptername}{Part}
- \newcommand{\fullline}{\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}}
- \newcommand{\bminione}{\begin{minipage}{0.75 \textwidth}}
- \newcommand{\bminitwo}{\begin{minipage}{0.25 \textwidth}}
- \newcommand{\emini}{\end{minipage}}
---
```{r , echo=FALSE, include=FALSE, warning=FALSE, message=FALSE, error=FALSE}
library("ggplot2")
library("pander")
```
```{r 'visualFunctions', echo=FALSE, include=FALSE, warning=FALSE, message=FALSE, error=FALSE}
ggAggHist <- getFromNamespace("ggAggHist", "dataReporter")
ggAggBarplot <- getFromNamespace("ggAggBarplot", "dataReporter")
```
# Data report overview
The dataset examined has the following dimensions:
---------------------------------
Feature Result
------------------------ --------
Number of observations 46
Number of variables 11
---------------------------------
### Checks performed
The following variable checks were performed, depending on the data type of each variable:
---------------------------------------------------------------------------------------------------------------------------------
character factor labelled haven labelled numeric integer logical Date
---------------------------------- ----------- ---------- ---------- ---------------- ---------- ---------- ---------- ----------
Identify miscoded missing values $\times$ $\times$ $\times$ $\times$ $\times$ $\times$ $\times$ $\times$
---------------------------------------------------------------------------------------------------------------------------------
Please note that all numerical values in the following have been rounded to 2 decimals.
# Summary table
--------------------------------------------------------------------------------------------------
Variable class # unique values Missing observations Any problems?
------------------------ ---------------- ----------------- ---------------------- ---------------
[lastName] Name 40 0.00 % $\times$
[firstName] Name 31 0.00 % $\times$
[orderOfPresidency] factor 46 0.00 % $\times$
[birthday] Date 45 0.00 %
[stateOfBirth] character 23 0.00 %
[assassinationAttempt] numeric 2 0.00 %
[sex] factor 1 0.00 % $\times$
[ethnicity] factor 2 0.00 %
[presidencyYears] numeric 11 4.35 % $\times$
[ageAtInauguration] character 23 0.00 %
[favoriteNumber] complex 11 0.00 % $\times$
--------------------------------------------------------------------------------------------------
# Variable list
## lastName
* The variable has class Name which is not supported by dataReporter.
\fullline
## firstName
* The variable has class Name which is not supported by dataReporter.
\fullline
## orderOfPresidency
* The variable is a key (distinct values for each observation).
\fullline
## birthday
\bminione
--------------------------------------------------
Feature Result
------------------------- ------------------------
Variable type Date
Number of missing obs. 0 (0 %)
Number of unique values 45
Mode "1837-03-18"
Min. and max. 1300-03-01; 1961-08-04
1st and 3rd quartiles 1790-03-29; 1890-10-14
--------------------------------------------------
\emini
\bminitwo
```{r 'Var-4-birthday', echo=FALSE, fig.width=4, fig.height=3, message=FALSE, warning=FALSE}
ggAggHist(data = structure(list(xmin = structure(c(-250000, -2e+05,
-150000, -1e+05, -50000), class = "Date"), xmax = structure(c(-2e+05,
-150000, -1e+05, -50000, 0), class = "Date"), ymin = c(0, 0,
0, 0, 0), ymax = c(1L, 0L, 0L, 21L, 24L)), row.names = c(NA,
-5L), class = "data.frame"), vnam = "birthday")
```
\emini
\fullline
## stateOfBirth
\bminione
-------------------------------------
Feature Result
------------------------- -----------
Variable type character
Number of missing obs. 0 (0 %)
Number of unique values 23
Mode "Ohio"
-------------------------------------
\emini
\bminitwo
```{r 'Var-5-stateOfBirth', echo=FALSE, fig.width=4, fig.height=3, message=FALSE, warning=FALSE}
pander(x = structure(c("Arkansas", "California", "Connecticut",
"Georgia", "Gondor", "Hawaii", "Illinois", "Iowa", "Kentucky",
"Massachusetts", "Missouri", "Nebraska", "New Hampshire", "New Jersey",
"New york", "New York", "North Carolina", "Ohio", "Pennsylvania",
"Tennessee", "Texas", "Vermont", "Virginia", NA, "1", "1", "1",
"1", "1", "1", "1", "1", "1", "4", "1", "1", "1", "2", "1", "4",
"2", "8", "1", "1", "2", "2", "7", "0", "2.17%", "2.17%", "2.17%",
"2.17%", "2.17%", "2.17%", "2.17%", "2.17%", "2.17%", "8.7%",
"2.17%", "2.17%", "2.17%", "4.35%", "2.17%", "8.7%", "4.35%",
"17.39%", "2.17%", "2.17%", "4.35%", "4.35%", "15.22%", "0%"), .Dim = c(24L,
3L), .Dimnames = list(NULL, c("value", "count", "percentage"))),
keep.trailing.zeros = TRUE)
```
\emini
\fullline
## assassinationAttempt
* Note that this variable is treated as a factor variable below, as it only takes a few unique values.
\bminione
-----------------------------------
Feature Result
------------------------- ---------
Variable type numeric
Number of missing obs. 0 (0 %)
Number of unique values 2
Mode "0"
Reference category 0
-----------------------------------
\emini
\bminitwo
```{r 'Var-6-assassinationAttempt', echo=FALSE, fig.width=4, fig.height=3, message=FALSE, warning=FALSE}
pander(x = structure(c("0", "1", NA, "35", "11", "0", "76.09%",
"23.91%", "0%"), .Dim = c(3L, 3L), .Dimnames = list(NULL, c("value",
"count", "percentage"))), keep.trailing.zeros = TRUE)
```
\emini
\fullline
## sex
* The variable only takes one (non-missing) value: \"Male\". The variable contains 0 \% missing observations.
\fullline
## ethnicity
\bminione
--------------------------------------------
Feature Result
------------------------- ------------------
Variable type factor
Number of missing obs. 0 (0 %)
Number of unique values 2
Mode "Caucasian"
Reference category African American
--------------------------------------------
\emini
\bminitwo
```{r 'Var-8-ethnicity', echo=FALSE, fig.width=4, fig.height=3, message=FALSE, warning=FALSE}
pander(x = structure(c("African American", "Caucasian", NA, "1",
"45", "0", "2.17%", "97.83%", "0%"), .Dim = c(3L, 3L), .Dimnames = list(
NULL, c("value", "count", "percentage"))), keep.trailing.zeros = TRUE)
```
\emini
\fullline
## presidencyYears
\bminione
-------------------------------------
Feature Result
------------------------ ------------
Variable type numeric
Number of missing obs. 2 (4.35 %)
Median 4
1st and 3rd quartiles 3.75; 8
Min. and max. 0; Inf
-------------------------------------
\emini
\bminitwo
```{r 'Var-9-presidencyYears', echo=FALSE, fig.width=4, fig.height=3, message=FALSE, warning=FALSE}
ggAggHist(data = structure(list(xmin = c(0, 2, 4, 6, 8, 10),
xmax = c(2, 4, 6, 8, 10, 12), ymin = c(0, 0, 0, 0, 0, 0),
ymax = c(7L, 19L, 3L, 13L, 0L, 1L)), class = "data.frame", row.names = c(NA,
-6L)), vnam = "presidencyYears")
```
\emini
- The following suspected missing value codes enter as regular values: \"Inf\".
\fullline
## ageAtInauguration
\bminione
-------------------------------------
Feature Result
------------------------- -----------
Variable type character
Number of missing obs. 0 (0 %)
Number of unique values 23
Mode "54"
-------------------------------------
\emini
\bminitwo
```{r 'Var-10-ageAtInauguration', echo=FALSE, fig.width=4, fig.height=3, message=FALSE, warning=FALSE}
pander(x = structure(c("42", "43", "46", "47", "48", "49", "50",
"51", "52", "54", "55", "56", "57", "58", "60", "61", "62", "64",
"65", "68", "69", "70", "87", NA, "1", "1", "2", "2", "1", "2",
"2", "4", "2", "5", "4", "3", "4", "1", "1", "3", "1", "2", "1",
"1", "1", "1", "1", "0", "2.17%", "2.17%", "4.35%", "4.35%",
"2.17%", "4.35%", "4.35%", "8.7%", "4.35%", "10.87%", "8.7%",
"6.52%", "8.7%", "2.17%", "2.17%", "6.52%", "2.17%", "4.35%",
"2.17%", "2.17%", "2.17%", "2.17%", "2.17%", "0%"), .Dim = c(24L,
3L), .Dimnames = list(NULL, c("value", "count", "percentage"))),
keep.trailing.zeros = TRUE)
```
\emini
\fullline
## favoriteNumber
* The variable has class complex which is not supported by dataReporter.
\fullline
Report generation information:
* Created by: AHP (username: `root`).
* Report creation time: tor dec 03 2020 15:20:52
* Report was run from directory: `/home/ahp/bshome/Talks/whyR`
* dataReporter v1.0.0 [Pkg: 2020-12-02 from local]
* R version 4.0.2 (2020-06-22).
* Platform: x86_64-pc-linux-gnu (64-bit)(Ubuntu 18.04.5 LTS).
* Function call: `makeDataReport(data = presidentData, output = "pdf", replace = TRUE,
vol = "_custom", summaries = setSummaries(numeric = defaultNumericSummaries(remove = "uniqueValues")),
visuals = setVisuals(character = "tableVisual", factor = "tableVisual"),
checks = setChecks(all = "identifyMissing"))`