Running examples in ‘SSLR-Ex.R’ failed
The error most likely occurred in:

> ### Name: democratic
> ### Title: General Interface for Democratic model
> ### Aliases: democratic
> 
> ### ** Examples
> 
> library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
✔ ggplot2 3.3.3     ✔ purrr   0.3.4
✔ tibble  3.0.4     ✔ dplyr   1.0.2
✔ tidyr   1.1.2     ✔ stringr 1.4.0
✔ readr   1.4.0     ✔ forcats 0.5.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
> library(tidymodels)
── Attaching packages ────────────────────────────────────── tidymodels 0.1.2 ──
✔ broom     0.7.3      ✔ recipes   0.1.15
✔ dials     0.0.9      ✔ rsample   0.0.8 
✔ infer     0.5.3      ✔ tune      0.1.2 
✔ modeldata 0.1.0      ✔ workflows 0.2.1 
✔ parsnip   0.1.4      ✔ yardstick 0.0.7 
── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
✖ scales::discard() masks purrr::discard()
✖ dplyr::filter()   masks stats::filter()
✖ recipes::fixed()  masks stringr::fixed()
✖ dplyr::lag()      masks stats::lag()
✖ yardstick::spec() masks readr::spec()
✖ recipes::step()   masks stats::step()
> library(caret)
Loading required package: lattice

Attaching package: ‘caret’

The following objects are masked from ‘package:yardstick’:

    precision, recall, sensitivity, specificity

The following object is masked from ‘package:purrr’:

    lift

> library(SSLR)
> 
> data(wine)
> 
> set.seed(1)
> train.index <- createDataPartition(wine$Wine, p = .7, list = FALSE)
> train <- wine[ train.index,]
> test  <- wine[-train.index,]
> 
> cls <- which(colnames(wine) == "Wine")
> 
> #% LABELED
> labeled.index <- createDataPartition(wine$Wine, p = .2, list = FALSE)
> train[-labeled.index,cls] <- NA
> 
> #We need a model with probability predictions from parsnip
> #https://tidymodels.github.io/parsnip/articles/articles/Models.html
> #It should be with mode = classification
> 
> 
> rf <-  rand_forest(trees = 100, mode = "classification") %>%
+   set_engine("randomForest")
> 
> 
> bt <-  boost_tree(trees = 100, mode = "classification") %>%
+   set_engine("xgboost")
> 
> 
> m <- democratic(learners = list(rf,bt)) %>% fit(Wine ~ ., data = train)
Error: This engine requires some package installs: 'xgboost'
Backtrace:
     █
  1. ├─democratic(learners = list(rf, bt)) %>% fit(Wine ~ ., data = train)
  2. ├─generics::fit(., Wine ~ ., data = train)
  3. ├─SSLR::fit.model_sslr(., Wine ~ ., data = train)
  4. │ ├─base::system.time(model <- object$fit_function(eval_env$x, eval_env$y))
  5. │ └─object$fit_function(eval_env$x, eval_env$y)
  6. │   └─SSLR:::democraticG(y, m_learners_base, m_preds_base)
  7. │     └─gen.learners[[i]](labeled, y[labeled])
  8. │       └─`%>%`(...)
  9. ├─parsnip::fit_xy(...)
 10. └─parsnip::fit_xy.model_spec(...)
 11.   └─parsnip:::check_installs(object)
Timing stopped at: 0.872 0.01 0.925
Execution halted