Tengo el mismo problema para las funciones biasCorrection()
y downscaleCV()
. Tiene que ver con el formato de fechas de las estaciones de monitoreo, que cargue de la siguiente manera:
nombre.carpeta <- 'datos_transformados_a_ASCII'
meses <- 1:12
anhos <- 2010:2011
y <- loadStationData(dataset = nombre.carpeta,
var="precip",
years = anhos,
season = meses,
tz='GMT')
[2020-09-30 13:57:10] Loading data ...
[2020-09-30 13:57:10] Retrieving metadata ...
[2020-09-30 13:57:10] Done.
Warning message:
In if (class(out$Data) == "numeric") datadimnames <- "time" :
la condición tiene longitud > 1 y sólo el primer elemento será usado
Donde, si no uso tz="GMT"
, algunas fechas quedan en NA y el problema se vuelve mayor.
y <- loadStationData(dataset = nombre.carpeta,
var="precip",
years = anhos,
season = meses
pad applied on the interval: day
Error in seq.Date(xlim[1], xlim[2], (xlim[2] - xlim[1])/10) : 'by' is NA
Además: Warning message:
There are NA values in the column Dates. The records with NA values are returned
in the final rows of the dataframe.
Aquí va una muestra:
> y$Dates$start[271:286]
[1] "2010-09-28 00:00:00" "2010-09-29 00:00:00" "2010-09-30 00:00:00" "2010-10-01 00:00:00" "2010-10-02 00:00:00"
[6] "2010-10-03 00:00:00" "2010-10-04 00:00:00" "2010-10-05 00:00:00" "2010-10-06 00:00:00" "2010-10-07 00:00:00"
[11] "2010-10-08 00:00:00" "2010-10-09 00:00:00" NA "2010-10-11 00:00:00" "2010-10-12 00:00:00"
[16] "2010-10-13 00:00:00"
En fin, cuando ejecuto la función biasCorrection()
, me aparece el siguiente mensaje:
pr.sum.bias.correction <- biasCorrection(x=pr.sum,
y = y,
precipitation = TRUE,
#window = 10,
method = "pqm")# %>% redim(drop = TRUE)
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
y con downscaleCV()
, lo siguiente:
M6cv.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 = spatial.pars.M6,
combined.only = TRUE))
fold: 1 --> calculating...
[2020-09-30 14:05:31] Performing PC analysis on 3 variables plus a combination ...
[2020-09-30 14:05:31] Done.
Error in as.POSIXlt.character(field.list[[1]]$Dates$start) :
character string is not in a standard unambiguous format
¿Cómo podría solucionar este problema? Gracias por su tiempo.