任何人都知道可能会发生什么?这是我的控制台打印输出。奇怪的是,前四个as.data.frame
行没有问题,但最后一行给了我“光栅IO期间的失败”错误。
library("raster", lib.loc="~/R/win-library/3.3")
library("rgdal", lib.loc="~/R/win-library/3.3")
#> rgdal: version: 1.1-10, (SVN revision 622)
#> Geospatial Data Abstraction Library extensions to R successfully loaded
#> Loaded GDAL runtime: GDAL 2.0.1, released 2015/09/15
#> Path to GDAL shared files: C:/Users/JV-Desktop/Documents/R/win-library/3.3/rgdal/gdal
#> Loaded PROJ.4 runtime: Rel. 4.9.2, 08 September 2015, [PJ_VERSION: 492]
#> Path to PROJ.4 shared files: C:/Users/JV-Desktop/Documents/R/win-library/3.3/rgdal/proj
liMax <- as.data.frame(raster("D:/LiDAR/LiDAR/30_m/m_30_max.tif"), xy=TRUE)
CanopyBase <- as.data.frame(raster("D:/LiDAR/LiDAR/30_m/m_30_avg.tif") - raster("D:/LiDAR/LiDAR/30_m/m_30_std.tif"), xy=TRUE)
rawData.li <- merge(liMax,CanopyBase)
processed.li <- rawData.li[complete.cases(rawData.li),]
satMax <- as.data.frame(stack("D:/LiDAR/Landsat/For_Joe/Max_2015.tif"), xy=TRUE)
satMed <- as.data.frame(stack("D:/LiDAR/Landsat/For_Joe/Med_2015.tif"), xy=TRUE)
#> Error: Failure during raster IO
如果有帮助,可以打印最后两个文件的信息:
stack("D:/LiDAR/Landsat/For_Joe/Max_2015.tif")
# class : RasterStack
# dimensions : 5640, 8763, 49423320, 7 (nrow, ncol, ncell, nlayers)
# resolution : 30, 30 (x, y)
# extent : -1491300, -1228410, 2709840, 2879040 (xmin, xmax, ymin, ymax)
# coord. ref. : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
# names : Max_2015.1, Max_2015.2, Max_2015.3, Max_2015.4, Max_2015.5, Max_2015.6, Max_2015.7
stack("D:/LiDAR/Landsat/For_Joe/Med_2015.tif")
# class : RasterStack
# dimensions : 5640, 8763, 49423320, 7 (nrow, ncol, ncell, nlayers)
# resolution : 30, 30 (x, y)
# extent : -1491300, -1228410, 2709840, 2879040 (xmin, xmax, ymin, ymax)
# coord. ref. : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
# names : Med_2015.1, Med_2015.2, Med_2015.3, Med_2015.4, Med_2015.5, Med_2015.6, Med_2015.7
# min values : -0.3208517, -0.5767694, -0.5474564, ?, ?, ?, ?
# max values : 1, 1, 1, ?, ?, ?, ?
我希望这是足够的信息,我正确地问这个问题。我是stackoverflow的新手,对R和编码来说相对较新。感谢您提供的任何见解。