Displaying 2 results from an estimated 2 matches for "data_y_mt".
2023 Feb 21
1
Interpolación IDW
...iente error:
*Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce
class ?structure("RasterLayer", package = "raster")? to a data.frame*
El código es el siguiente:
*for (i in 1:nrows_mt) { data_it_mt <-
as.numeric(as.vector(data_y_mt[i,])) it_data_mt <- idw(data_it_mt,
sta_mt, grid, p = 1) grid <- data.frame(grid, valores = it_data_mt[ ,
1]) coordinates(grid) <- ~x+y gridded(grid) <- T grid <-
raster(grid, "valores") projection(grid) <- crs("+init=epsg:9377")
path <- ...
2023 Feb 17
1
Interpolación IDW
Hola, buen día a todos.
He estado mirando cómo interpolar unos datos anuales con el método IDW,
pero no consigo aún realizarlo.
idw_models <- list()
for (i in 1:ncol(data_y_mt)) {
#Extract the current variable
current_var <- names(data_y_mt)[i]
#Create an IDW model for the current variable
idw_model <- idw(current_var, sta_mt, grid, p = 1)
idw_models[[i]] <- idw_model
}
Ese es el código que llevo, pero me siento muy perdido. La variable*
data_y_mt*...