title: Fastshap summary plot - Error: can't combine <double> and <factor<919a3>>
body: <p>I'm trying to get a summary plot using fastshap explain function as in the code below.</p>
  <pre><code>p_function_G&lt;- function(object, newdata)
    caret::predict.train(object,
                         newdata = 
                         newdata,
                         type = &quot;prob&quot;)[,&quot;AntiSocial&quot;] # select G class
  
  
  
  
  # Calculate the Shapley values
  #
  # boostFit: is a caret model using catboost algorithm
  # trainset: is the dataset used for bulding the caret model.
  #   The dataset contains 4 categories W,G,R,GM
  #    corresponding to 4 diferent animal  behaviors
  library(caret)
  
  shap_values_G &lt;- fastshap::explain(xgb_fit,
                    X = game_train,                   
                    pred_wrapper = 
                    p_function_G,
                    nsim = 50,
                    newdata= game_train[which(game_test==&quot;AntiSocial&quot;),])
  ) 
  
  </code></pre>
  <p>However I'm getting error</p>
  <p>Error in 'stop_vctrs()':
  can't combine latitude  and gender &lt;factor&lt;919a3&gt;&gt;</p>
  <p>What's the way out?</p>