I tried to perform an Exploratory Data Analysis (EDA) with the fantastic package dlookr
. My outcome variable is binary.
<code>raw_data[1:200, c(1:15, 599)] %>% eda_web_report(output_file = "temp.html", output_dir = here::here())
# processing file: eda_temp.Rmd
# |............................................ | 86% [group-numerical] Error in `tab[2, 4]`:
# ! subscript out of bounds
# Backtrace:
# 1. dlookr:::html_target_numerical(...)
# 3. reactable::reactable(...)
# 4. base::lapply(...)
# 5. reactable (local) FUN(X[[i]], ...)
# 6. base::lapply(...)
# 7. reactable (local) FUN(X[[i]], ...)
# 8. reactable:::callFunc(details, index, key)
# 10. dlookr (local) `<fn>`(6L)
#
# Quitting from lines 363-375 [group-numerical] (eda_temp.Rmd)
</code>
<code>raw_data[1:200, c(1:15, 599)] %>% eda_web_report(output_file = "temp.html", output_dir = here::here())
# processing file: eda_temp.Rmd
# |............................................ | 86% [group-numerical] Error in `tab[2, 4]`:
# ! subscript out of bounds
# Backtrace:
# 1. dlookr:::html_target_numerical(...)
# 3. reactable::reactable(...)
# 4. base::lapply(...)
# 5. reactable (local) FUN(X[[i]], ...)
# 6. base::lapply(...)
# 7. reactable (local) FUN(X[[i]], ...)
# 8. reactable:::callFunc(details, index, key)
# 10. dlookr (local) `<fn>`(6L)
#
# Quitting from lines 363-375 [group-numerical] (eda_temp.Rmd)
</code>
raw_data[1:200, c(1:15, 599)] %>% eda_web_report(output_file = "temp.html", output_dir = here::here())
# processing file: eda_temp.Rmd
# |............................................ | 86% [group-numerical] Error in `tab[2, 4]`:
# ! subscript out of bounds
# Backtrace:
# 1. dlookr:::html_target_numerical(...)
# 3. reactable::reactable(...)
# 4. base::lapply(...)
# 5. reactable (local) FUN(X[[i]], ...)
# 6. base::lapply(...)
# 7. reactable (local) FUN(X[[i]], ...)
# 8. reactable:::callFunc(details, index, key)
# 10. dlookr (local) `<fn>`(6L)
#
# Quitting from lines 363-375 [group-numerical] (eda_temp.Rmd)
I noticed the problem was that the output variable (binary Yes/No) was in the numeric format (0/1). So, a simple mutate
with as.factor()
was the solution.