# Error using predict function terra package

**URL:** <https://renku.discourse.group/t/error-using-predict-function-terra-package/815>\
**Category:** General\
**Created:** [21 May 2023 10:11 UTC](https://renku.discourse.group/t/error-using-predict-function-terra-package/815 "2023-05-21T10:11:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sina](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@sina](https://renku.discourse.group/u/sina)\
**Post date:** [21 May 2023 10:11 UTC](https://renku.discourse.group/t/error-using-predict-function-terra-package/815/1 "2023-05-21T10:11:49Z")

</div>

I get an error when trying to perform a spatial prediction in Renku using a previously fitted GLM model and a SpatRaster containing the environmental predictors. I have updated the terra package and also tried running the code with changing the number of the “cores” argument or omitting the cores argument, which did not help. Does anyone know what could be causing this error?

this is my code:  
env ← rast(“data/rasters/predictors.tif”)  
cv\_data ← SDM\_list\_new[[2477804]]$simple\_glm  
pr\_cur\_prob ← terra::predict(env, cv\_data, cores = 1, type = “response”)

this is the error:  
Error in .runModel(model, fun, d, nl, const, na.rm, index, …) :  
argument “cores” is missing, with no default

---

<div class="post-metadata">

**Author:** ![rrrrrok](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/rrrrrok/32/117_2.png) [@rrrrrok](https://renku.discourse.group/u/rrrrrok)\
**Post date:** [25 May 2023 13:44 UTC](https://renku.discourse.group/t/error-using-predict-function-terra-package/815/2 "2023-05-25T13:44:53Z")

</div>

Hi @sina - are you able to run this code in the same way outside of Renku?
