我试图从互联网上下载该文件,但无法加载下载的文件(光栅格式)。
# download the data
download.file("https://zenodo.org/record/4287825/files/ChinaClim_baseline_prec_01.tif?download=1", destfile="prec_01.tif")
# load into Raster
library(raster)
raster("prec_01.tif")
# Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
# Cannot create a RasterLayer object from this file.我的代码有什么问题吗?谢谢。
发布于 2021-11-19 08:57:26
download.file("https://zenodo.org/record/4287825/files/ChinaClim_baseline_prec_01.tif?download=1", destfile="prec_01.tif", mode="wb") # On windows add mode = "wb" to download.file() as suggested by Martin Morgan
# load into Raster
library(raster)
raster("prec_01.tif")https://stackoverflow.com/questions/70031277
复制相似问题