SantanderMetGroup / downscaleR

An R package for climate data bias correction and downscaling (part of the climate4R bundle)
https://github.com/SantanderMetGroup/climate4R
GNU General Public License v3.0
104 stars 59 forks source link

Unable to Perform dowscaleCV #109

Closed idriswada007 closed 9 months ago

idriswada007 commented 10 months ago

Greetings, I am currently using the climate4R package to downscale GCMs (precipitation) in the Sub-Saharan region. I loaded the predictors and predictand files. I am using six folds of 5 years each for the folds. I performed the downscaleCV function. `dir.obs <- "C:/R_workstation/downscaling" di.obs <- dataInventory(dir.obs) stationInfo(dir.obs) y <- loadStationData(dataset = dir.obs, var="precip", years = years) %>% binaryGrid(condition = "GE", threshold = 1.5, partial = TRUE) str(y) y_bin <- binaryGrid(y, condition = "GE", threshold = 1.5) x <- makeMultiGrid(z, q, t500, t750, slp, tp, skip.temporal.check = TRUE)

(vars <- getVarNames(x)) met.1 <- list(which.combine = vars, v.exp = .95, rot = FALSE) met1cv.bin <- downscaleCV(x = x, y = y_bin, method = "GLM", family = binomial(link = "logit"), folds = folds, prepareData.args = list(global.vars = NULL, local.predictors = NULL, spatial.predictors = met.1, combined.only = TRUE))`

Then I got this error which I was not able to find its solution. Thank you. fold: 1 --> calculating... Error in aperm.default(array3D, match(c("time", "lat", "lon"), dimNames)) : 'perm' is of wrong length 3 (!= 4)

idriswada007 commented 9 months ago

solved the problem