, as.matrix raster, .
, library require:
library(raster)
r <- raster()
r[] <- 1:ncell(r)
as.matrix, :
> str(as.matrix(r))
int [1:180, 1:360] 1 361 721 1081 1441 1801 2161 2521 2881 3241 ...
as.matrix, :
> base::as.matrix(r)
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
length of 'dimnames' [1] not equal to array extent
, , : raster::as.matrix(r)