I have a dataframe containing the best predictors by their contribution to a model:
bestpredictors
var contrib
2 Pfallwinter 8.1141
15 Tofall 58.0000
23 ai 5.3573
26 radmean 7.9753
27 radseason 0.9027
Every variable name is also a raster object. So, how can I make a raster stack with those variables? Like this:
predictors<-stack(Pfallwinter,Tofall,ai,radmean,radseason)
I have tried to extracting the string character and using the do.call
and eval
functions but seems that isn't the correct way, because they can't call the object already saved.