Running examples in 'autostats-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: tidy_xgboost
> ### Title: tidy xgboost
> ### Aliases: tidy_xgboost
> 
> ### ** Examples
> 
> 
> options(rlang_trace_top_env = rlang::current_env())
> 
> 
> # regression on numeric variable
> 
> iris %>%
+  framecleaner::create_dummies(Species) -> iris_dummy
1 column(s) have become 3 dummy columns
> 
> iris_dummy %>%
+  tidy_formula(target= Petal.Length) -> petal_form
> 
> iris_dummy %>%
+  tidy_xgboost(
+    petal_form,
+    trees = 500,
+    mtry = .5
+  )  -> xg1
Warning: `early_stop` was reduced to 499.
> 
> xg1 %>%
+  visualize_model(top_n = 2)
> 
> xg1 %>%
+  tidy_predict(newdata = iris_dummy, form = petal_form) -> iris_preds
> 
> iris_preds %>%
+  eval_preds()
# A tibble: 2 x 5
  .metric .estimator .estimate model target      
  <chr>   <chr>          <dbl> <chr> <chr>       
1 rmse    standard      0.0412 Table Petal.Length
2 rsq     standard      0.999  Table Petal.Length
> 
> 
> # binary classification
> # returns probabilty and labels
> 
> iris %>%
+  tidy_formula(Species) -> species_form
> 
> iris %>%
+  dplyr::filter(Species != "versicolor") %>%
+  dplyr::mutate(Species = forcats::fct_drop(Species)) -> iris_binary
> 
> iris_binary %>%
+  tidy_xgboost(formula = species_form, trees = 50L, mtry = 0.2) -> xgb_bin
Warning: `early_stop` was reduced to 49.
[21:15:30] WARNING: amalgamation/../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'binary:logistic' was changed from 'error' to 'logloss'. Explicitly set eval_metric if you'd like to restore the old behavior.
> 
> xgb_bin %>%
+  tidy_predict(newdata = iris_binary, form = species_form) -> iris_binary1
[1] "Species_preds_prob_Table"
> 
> iris_binary1 %>%
+  eval_preds()
# A tibble: 3 x 5
  .metric  .estimator .estimate model target 
  <chr>    <chr>          <dbl> <chr> <chr>  
1 accuracy binary             1 Table Species
2 f_meas   binary             1 Table Species
3 roc_auc  binary             1 Table Species
> 
> 
> # multiclass classification that returns labels
> 
> 
> 
> 
> iris %>%
+  tidy_xgboost(species_form,
+               objective = "multi:softmax",
+               trees = 100,
+               tree_depth = 3L,
+               loss_reduction = 0.5) -> xgb2
Warning: `early_stop` was reduced to 99.
[21:15:31] WARNING: amalgamation/../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softmax' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.
> 
> 
> 
> xgb2 %>%
+  tidy_predict(newdata = iris, form = species_form) -> iris_preds
> 
> iris_preds %>%
+  eval_preds(yardstick::j_index)
# A tibble: 3 x 5
  .metric  .estimator .estimate model target 
  <chr>    <chr>          <dbl> <chr> <chr>  
1 accuracy multiclass     0.987 Table Species
2 f_meas   macro          0.987 Table Species
3 j_index  macro          0.98  Table Species
> 
> 
> # multiclass classification that returns probabilities
> 
> 
> iris %>%
+  tidy_xgboost(species_form,
+               objective = "multi:softprob",
+               trees = 50L,
+               sample_size = .2,
+               mtry = .5,
+               tree_depth = 2L,
+               loss_reduction = 3) -> xgb2_prob
Warning: `early_stop` was reduced to 49.
[21:15:32] WARNING: amalgamation/../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.
> 
> xgb2_prob %>%
+  tidy_predict(newdata = iris_preds, form = species_form) -> iris_preds1
Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if `.name_repair` is omitted as of tibble 2.0.0.
Using compatibility `.name_repair`.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
> 
> # also requires the labels in the dataframe to evaluate preds
> # the model name must be supplied as well. Then roc metrics can be calculated
> iris_preds1 %>%
+  eval_preds(softprob_model = "xgb2_prob", yardstick::average_precision
+  )
Error:
! In metric: `roc_auc`
No valid variables provided to `...`.
Backtrace:
 1. iris_preds1 %>% ...
 2. autostats::eval_preds(., softprob_model = "xgb2_prob", yardstick::average_precision)
 7. yardstick eval_func(...)
 8. base::mapply(...)
 9. yardstick `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
Execution halted