library(explore)
library(rlang)

Introduction

This is an R Notebook that helps you to explore your data. To use your owen data just replace the code below.

The Notebook uses the R package {explore} and is designed to explore small datasets as well as large datasets (with > 100 variables)

Data must be in a "tidy" format (each row is an observation, each column is a variable, each cell is a single value)

# Replace this code with your own data and target
data <- create_data_churn()
var_name_target <- "churn"

Data Understanding

Explore Table

data  |>  explore_tbl()

Describe Table

data  |>  describe_tbl()

Describe Variables

d <- describe(data)
knitr::kable(d)

Explore Variables

# create buckets of variables
buckets <- data  |>  
  explore::get_var_buckets(
    bucket_size = 100
  )

# height of each plot
fig_height <- data[buckets[[1]]]  |>  
  explore::total_fig_height()
for (i in seq_along(buckets)) {
  data[buckets[[i]]]  |>  
    explore_all(ncol = 2)
}

Finding Insights

Explore Target

data |> explore(!!sym(var_name_target))

Explore Variables + Target

# create buckets of variables
buckets <- data  |>  
  explore::get_var_buckets(
    var_name_target = var_name_target,
    bucket_size = 100
  )

# height of each plot
fig_height <- data[buckets[[1]]]  |>  
  explore::total_fig_height(var_name_target = var_name_target)
for (i in seq_along(buckets)) {
  data[buckets[[i]]]  |>  
    explore_all(ncol = 2, target = !!sym(var_name_target), split = TRUE)
}

Explain Target

data  |>  explain_tree(target = !!sym(var_name_target))


rolkra/explore documentation built on April 17, 2024, 10:58 p.m.