eda_variable_summary: Display a summary of the variables

View source: R/exploratory_data_analysis.R

eda_variable_summaryR Documentation

Display a summary of the variables

Description

[Experimental]

Exports the basic statistics of the variables within a data frame into a temporary directory. This includes a plots of the prevalence of missing values and frequency of category levels and a table image containing variable's type summary count of the number of rows, missing values, unique values and zero values for each variable.

Usage

eda_variable_summary(.dataset)

Arguments

.dataset

A data frame requiring exploratory data analysis.

Value

The data frame is returned invisibly so that the function can be used in a piped workflow.

Figures

01-summary_table.png 02-missing_data.png 03-category_data.png

See Also

This is an example of exploratory data analysis using the dlookr and inspectdf packages.

Other exploratory data analysis: eda_variable_collection(), eda_variable_correlation(), eda_variable_distribution(), eda_variable_outliers()

Examples

# example from palmerpenguins
# https://allisonhorst.github.io/palmerpenguins/reference/penguins_raw.html
suppressPackageStartupMessages({
  suppressWarnings({
    library(palmerpenguins)
  })
})

suppressWarnings({
  suppressMessages({
    eda_variable_summary(penguins_raw)
  })
})

# move figures from temporary directory
suppressPackageStartupMessages({
  suppressWarnings({
    library(fs)
    library(here)
  })
})
if(dir_exists(here("man", "figures"))) {
  file_move(path(tempdir(), "figures", "01-summary_table.png"),
            here("man", "figures", "01-summary_table.png"))

  file_move(path(tempdir(), "figures", "02-missing_data.png"),
            here("man", "figures", "02-missing_data.png"))

  file_move(path(tempdir(), "figures", "03-category_data.png"),
            here("man", "figures", "03-category_data.png"))
}

gcfrench/store documentation built on May 17, 2024, 5:52 p.m.