为了对大型栅格数据集执行 kmean 聚类分析,我尝试使用该函数将RasterBrick
对象转换为对象,但是当我将 .grd 文件读回时,所有信息都丢失了。big.matrix
brick
R
library(raster)
library(bigmemory)
library(biganalytics)
#initialize raster
one <- raster(matrix(rnorm(400), 20, 20))
two <- raster(matrix(rnorm(400), 20, 20))
three <- raster(matrix(rnorm(400), 20, 20))
#save brick object as .grd file
brick(one, two, three, filename = "test")
#read .grd file in as big.matrix
big_matrix <- as.big.matrix("test.grd", type = "double")
#check dimensions
dim(big_matrix)
#perform kmeans
bigkmeans(big_matrix, 3)
我可以在我的目录中看到 .grd 和 .gri 文件,但我不知道如何将它们读回,或者如何将 .grd 文件提供给bigkmean
函数。知道我该怎么做吗?