Hi,
I have this code that I took from Calibration and cross validation · SantanderMetGroup/downscaleR Wiki · GitHub, and I tried to run it, it runs very good till the final line it gives me this error, I don't have any idea how could I fix it. I hope some one can help me with that.
Error in arr[, , , ind, ] <- grid[["Data"]] :
number of items to replace is not a multiple of replacement length.
The code is as following:
library(downscaleR)
library(climate4R.datasets)
# precipitation
data(VALUE_Iberia_pr)
y <- VALUE_Iberia_pr
# temperature
data(VALUE_Iberia_tas)
y.t <- VALUE_Iberia_tas
# precipitation
data(NCEP_Iberia_pr)
x <- gridArithmetics(NCEP_Iberia_pr, 86400, operator = "*")
# temperature
data(NCEP_Iberia_tas)
x.t <- NCEP_Iberia_tas
library(visualizeR)
library(sp)
spatialPlot(climatology(x), backdrop.theme = "coastline",
sp.layout = list(list(SpatialPoints(getCoordinates(y)),
pch = 17, col = "black", cex = 1.5)))
cal <- biasCorrection(y = y, x = x, newdata = x, precipitation = TRUE, method = "delta")