Original link:tecdat.cn/?p = 6481

 

Summary data set

## Skim summary statistics ## n obs: 150 ## n variables: 5 ## ## Variable type: factor ## variable missing complete n n_unique top_counts ## 1 Species 0 150 150 3 set: 50, ver: 50, vir: 50, NA: 0 ## ordered ## 1 FALSE ## ## Variable type: Numeric ## variable missing complete N mean SD min P25 median P75 Max ## 1 Petal.Length 0 150 150 3.76 1.77 1 1.6 4.35 Width 0 150 150 1.2 0.76 0.1 0.3 1.3 1.8 2.5 ## 3 tap. Length 0 150 150 5.84 0.83 4.3 5.1 5.8 6.4 Petal 7.9 # # 4 Sepal. Width 0 150 150 3.06 3.3 4.4 0.44 2, 2.8 3 # # # # hist 1 ▇ ▁ ▁ ▂ ▅ ▅ ▃ ▁ # # 2 ▇ ▁ ▁ ▅ ▃ ▃ ▂ ▂ ▂ # # 3 ▇ ▅ ▇ ▆ ▅ ▂ ▂ # # 4 ▁ ▂ ▅ ▇ ▃ ▂ ▁ ▁Copy the code

Select the specific column to summarize

## Skim summary statistics ## n obs: 150 ## n variables: 5 ## ## Variable type: Numeric ## variable missing complete N mean SD min P25 median P75 Max ## 1 Petal.Length 0 150 150 3.76 1.77 1 1.6 4.35 5.1 6.9 # # 2 Sepal. Length 0 150 150 5.84 0.83 4.3 5.1 5.8 6.4 7.9 # # # # hist 1 ▇ ▁ ▁ ▂ ▅ ▅ ▃ ▂ ▁ # # 2 ▇ ▅ ▇ ▆ ▅ ▂ ▂Copy the code

Processing packet data

Dplyr ::group_by can handle data that has been grouped.

## Skim summary statistics ## n obs: 150 ## n variables: 5 ## group variables: Species ## ## Variable type: Numeric ## Species variable missing complete N mean SD min P25 median ## 1 setosa Petal.Length 0 50 50 1.46 0.17 1 1.4 Petal.Width 0 50 50 0.25 0.11 0.1 0.2 0.2 ## 3 Setosa Sepal.Length 0 50 50 5.01 0.35 4.3 Petal 5 ## 4 Setosa Sepal.Width 0 50 50 3.43 0.38 2.3 3.2 3.4 ## 5 versicolor Petal.Length 0 50 50 4.26 0.47 3 4 4.35 ## 6 versicolor Petal.Width 0 50 50 1.33 0.2 1 1.2 1.3 versicolor Sepal.Length 0 50 50 5.94 0.52 4.9 5.6 5.9 ## 8 versicolor Sepal.Width 0 50 50 2.77 0.31 2 2.52 2.8 ## 9 virginica Petal.Length 0 50 50 5.55 0.55 4.5 5.1 5.55 ## 10 virginica Petal.Width 0 50 50 2.03 0.27 1.4 1.8 2 ## 11 virginica Sepal.Length 0 50 50 6.59 0.64 4.9 6.23 6.5 ## 12 virginica Sepal. Width 0 50 50 2.97 0.32 2.2 2.8 3 # # p75 Max hist # # 1, 1.58 1.9 ▁ ▁ ▅ ▇ ▇ ▅ ▂ ▁ # # 2, 0.3 0.6 ▂ ▇ ▁ ▂ ▂ ▁ ▁ ▁ # # 3 5.2 5.8 ▂ ▃ ▅ ▇ ▇ ▃ ▁ ▂ # # 4 3.68 4.4 ▁ ▁ ▃ ▅ ▇ ▃ ▂ ▁ ▁ # # 5 4.6 5.1 ▃ ▂ ▆ ▆ ▇ ▇ ▃ # # 6 1.5 1.8 ▆ ▃ ▇ ▅ ▆ ▂ ▁ ▁ # # 7 6.3 7 ▃ ▂ ▇ ▇ ▇ ▃ ▅ ▂ # # 8 3 3.4 ▁ ▂ ▃ ▅ ▃ ▇ ▃ ▁ # # 9 5.88 6.9 ▂ ▇ ▃ ▇ ▅ ▂ ▁ ▂ # # 10 2.3 2.5 ▂ ▁ ▇ ▃ ▃ ▆ ▅ ▃ # # 11, 6.9 7.9 ▁ ▁ ▃ ▇ ▅ ▃ ▂ ▃ # # 12 3.18 3.8 ▁ ▃ ▇ ▇ ▅ ▃ ▁ ▂Copy the code

Specify statistics and classes

Users can specify their own statistics using a list combined with the skim_with() function.

## Skim summary statistics
##  n obs: 150 
##  n variables: 5 
## 
## Variable type: numeric 
##       variable iqr  mad
## 1 Sepal.Length 1.3 1.04
Copy the code

 

Thank you so much for reading this article, and leave a comment below if you have any questions!