I am trying to convert the outputs of a model into a raster based on both a temperature raster and a seasonality raster. I have over 2100 bands so ifelse statements aren't going to cut it.
An example would be that I had my model outputs in a dataframe - with the range of temperature values in column 1, the seasonality in column 2 and the outputs in column 3:
a<-rep(1:100,10) b<-sort(rep(1:10,100)) c<-rnorm(1000,5,3) df<-data.frame(a,b,c)
And I have a raster of temperature
t = raster(matrix(1:100,10,10))
And a raster of seasonality
s = raster(matrix(rep(1:10,10),10,10))
I need to write a new raster which is based on the values of s and t, but consists of the model outputs of column 3 of the data frame.