我想在R中创建一个循环来自动选择文件并将其转换为不同的文件类型(.tif到.asc)。我不想手动选择每个文件,是否有方法在R中做到这一点?
这就是我一直在手动做的事情,但它很慢而且乏味。
bioclim19<-file.choose()
bioclim19asc<-raster(bioclim19)
bioclim19asc<-aggregate(bioclim19asc,fact=2)
writeRaster(bioclim19asc,"bioclim19.asc",format="ascii")
1条答案
按热度按时间s4n0splo1#
正如IRFTM所建议的,下面的代码可能符合您的要求..让我知道这是否有帮助..