【发布时间】:2020-03-20 08:21:31
【问题描述】:
library(raster)
library(sp)
library(rgdal)
library(maptools)
library(sf)
library(dplyr)
library(devtools)
library(DGVMTools)
library(Metrics)
library(hydroGOF)
library(sp)
library(grid)
library(latticeExtra)
> Y
class : RasterLayer
dimensions : 2803, 5303, 14864309 (nrow, ncol, ncell)
resolution : 0.008333333, 0.008333333 (x, y)
extent : 60.85, 105.0417, 15.95833, 39.31667 (xmin, xmax, ymin, ymax)
crs : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
source : memory
names : layer
values : 0, 26.53035 (min, max)
> X
class : RasterLayer
dimensions : 2803, 5303, 14864309 (nrow, ncol, ncell)
resolution : 0.008333333, 0.008333333 (x, y)
extent : 60.85, 105.0417, 15.95833, 39.31667 (xmin, xmax, ymin, ymax)
crs : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
source : memory
names : VegH
values : 0, 17.99169 (min, max)
我正在这两个栅格之间绘制scatter-plot,
plot(x,Y)
但是由于像素太多,警告来了:
警告信息:在 .local(x, y, ...) 中:绘图使用了 0.7% 的样本 的细胞。您可以使用“maxpixels”来增加样本)
在将两个栅格都转换为dataframe 并绘制scatter-plot 后,散点图大约需要 1 小时才能出现,并显示一个大的黑色块。 可重现的栅格:
r1 <- r2 <- raster(nrows=2803, ncols=5303)
values(r1) <- runif(ncell(r1))
values(r2) <- runif(ncell(r2))
我的问题是如何有效地绘制两个大型栅格数据集之间的散点图,这也可以通过视觉诊断?
【问题讨论】:
标签: rasters r scatter-plot dataframe scatter-plot r raster scatter-plot tiff