-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinspectdf_functions.Rmd
45 lines (36 loc) · 1.3 KB
/
inspectdf_functions.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
InspectDF
==============================
#### InspectDF
inspectdf: Inspection, Comparison and Visualisation of Data Frames
inspectdf is collection of utilities for columnwise summary, comparison and visualisation of data frames. Functions are provided to summarise missingness, categorical levels, numeric distribution, correlation, column types and memory usage.
The package has three aims: to speed up repetitive checking and exploratory tasks for data frames
InspectDF
================================
Key functions
* ``inspect_types()``: summary of column types
* ``inspect_mem()``: summary of memory usage of columns
* ``inspect_na()``: columnwise prevalence of missing values
* ``inspect_cor()``: correlation coefficients of numeric columns
* ``inspect_imb()``: feature imbalance of categorical columns
* ``inspect_num()``: summaries of numeric columns
* ``inspect_cat()``: summaries of categorical columns
InspectDF
================================
```{r}
# Load dplyr for starwars data & pipe
library(dplyr)
# Single dataframe summary
inspect_cat(starwars)
```
InspectDF
================================
```{r}
# Paired dataframe comparison
inspect_cat(starwars, starwars[1:20, ])
```
InspectDF
================================
```{r}
# Grouped dataframe summary
starwars %>% group_by(species) %>% inspect_cat()
```