---
title: "Explore"
output: html_document
---

## Describe Data

```{r fig.height=3, echo=FALSE, message=FALSE, warning=FALSE}
data %>% explore_tbl()
```

```{r echo=FALSE, message=FALSE, warning=FALSE}
describe_tbl(data)
d <- describe(data)
knitr::kable(d)
```

## Describe Target

```{r echo=FALSE, fig.height=3, fig.width=5, message=FALSE, warning=FALSE}
data %>% explore(!!sym(var_name_target))
```

## Explore Variables

```{r include=FALSE}
# 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)

```

```{r echo=FALSE, fig.height=0.5, fig.width=10, message=FALSE, warning=FALSE}
plot_legend_targetpct()
```

```{r echo=FALSE, fig.height=fig_height, fig.width=10, message=FALSE, warning=FALSE}
for (i in seq_along(buckets)) {
  suppressWarnings({
    data[buckets[[i]]] %>% 
      explore_all(ncol = 2, target = !!sym(var_name_target), 
                  split = FALSE)
  })
}
```
