Last chance! 50% off unlimited learning
Sale ends in
Explore a dataset or variable
explore(
data,
var,
var2,
n,
target,
targetpct,
split,
min_val = NA,
max_val = NA,
auto_scale = TRUE,
na = NA,
...
)
Plot object
A dataset
A variable
A variable for checking correlation
A Variable for number of observations (count data)
Target variable (0/1 or FALSE
/TRUE
)
Plot variable as target% (FALSE
/TRUE
)
Alternative to targetpct (split = !targetpct)
All values < min_val are converted to min_val
All values > max_val are converted to max_val
Use 0.2 and 0.98 quantile for min_val
and max_val
(if min_val
and max_val
are not defined)
Value to replace NA
Further arguments (like flip = TRUE
/FALSE
)
## Launch Shiny app (in interactive R sessions)
if (interactive()) {
explore(iris)
}
## Explore grafically
# Load library
library(magrittr)
# Explore a variable
iris %>% explore(Species)
iris %>% explore(Sepal.Length)
iris %>% explore(Sepal.Length, min_val = 4, max_val = 7)
# Explore a variable with a target
iris$is_virginica <- ifelse(iris$Species == "virginica", 1, 0)
iris %>% explore(Species, target = is_virginica)
iris %>% explore(Sepal.Length, target = is_virginica)
# Explore correlation between two variables
iris %>% explore(Species, Petal.Length)
iris %>% explore(Sepal.Length, Petal.Length)
# Explore correlation between two variables and split by target
iris %>% explore(Sepal.Length, Petal.Length, target = is_virginica)
Run the code above in your browser using DataLab