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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: fairness_heatmap
> ### Title: Fairness heatmap
> ### Aliases: fairness_heatmap
> 
> ### ** Examples
> 
> 
> data("german")
> 
> y_numeric <- as.numeric(german$Risk) - 1
> 
> lm_model <- glm(Risk ~ .,
+   data = german,
+   family = binomial(link = "logit")
+ )
> 
> rf_model <- ranger::ranger(Risk ~ .,
+   data = german,
+   probability = TRUE,
+   num.trees = 200,
+   num.threads = 1
+ )
> 
> explainer_lm <- DALEX::explain(lm_model, data = german[, -1], y = y_numeric)
Preparation of a new explainer is initiated
  -> model label       :  lm  ( [33m default [39m )
  -> data              :  1000  rows  9  cols 
  -> target variable   :  1000  values 
  -> predict function  :  yhat.glm  will be used ( [33m default [39m )
  -> predicted values  :  No value for predict function target column. ( [33m default [39m )
  -> model_info        :  package stats , ver. 4.6.0 , task classification ( [33m default [39m ) 
  -> predicted values  :  numerical, min =  0.1369187 , mean =  0.7 , max =  0.9832426  
  -> residual function :  difference between y and yhat ( [33m default [39m )
  -> residuals         :  numerical, min =  -0.9572803 , mean =  4.352454e-17 , max =  0.8283475  
 [32m A new explainer has been created! [39m 
> explainer_rf <- DALEX::explain(rf_model, data = german[, -1], y = y_numeric)
Preparation of a new explainer is initiated
  -> model label       :  ranger  ( [33m default [39m )
  -> data              :  1000  rows  9  cols 
  -> target variable   :  1000  values 
  -> predict function  :  yhat.ranger  will be used ( [33m default [39m )
  -> predicted values  :  No value for predict function target column. ( [33m default [39m )
  -> model_info        :  package ranger , ver. 0.17.0 , task classification ( [33m default [39m ) 
  -> predicted values  :  numerical, min =  0.07287302 , mean =  0.6989152 , max =  0.9974848  
  -> residual function :  difference between y and yhat ( [33m default [39m )
  -> residuals         :  numerical, min =  -0.7219256 , mean =  0.001084826 , max =  0.6142332  
 [32m A new explainer has been created! [39m 
> 
> fobject <- fairness_check(explainer_lm, explainer_rf,
+   protected = german$Sex,
+   privileged = "male"
+ )
Creating fairness classification object
-> Privileged subgroup		: character ([32m Ok [39m )
-> Protected variable		: factor ([32m Ok [39m ) 
-> Cutoff values for explainers	: 0.5 ( for all subgroups ) 
-> Fairness objects		: 0 objects 
-> Checking explainers		: 2 in total ( [32m compatible [39m )
-> Metric calculation		: 10/13 metrics calculated for all models ( [33m3 NA created[39m )
[32m Fairness object created succesfully [39m 
> 
> # same explainers with different cutoffs for female
> fobject <- fairness_check(explainer_lm, explainer_rf, fobject,
+   protected = german$Sex,
+   privileged = "male",
+   cutoff = list(female = 0.4),
+   label = c("lm_2", "rf_2")
+ )
Creating fairness classification object
-> Privileged subgroup		: character ([32m Ok [39m )
-> Protected variable		: factor ([32m Ok [39m ) 
-> Cutoff values for explainers	: female: 0.4, male: 0.5 
-> Fairness objects		: 1 object ( [32m compatible [39m )
-> Checking explainers		: 4 in total ( [32m compatible [39m )
-> Metric calculation		: 10/13 metrics calculated for all models ( [33m3 NA created[39m )
[32m Fairness object created succesfully [39m 
> 
> 
> fh <- fairness_heatmap(fobject)
> 
> plot(fh)
Error in rep(yes, length.out = len) : 
  attempt to replicate an object of type 'object'
Calls: plot -> plot.fairness_heatmap -> ifelse
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
                        user system elapsed
ceteris_paribus_cutoff 2.478  0.111   7.646
fairness_check         1.300  0.055   6.463