Worldclim: getData() in R (latitudelongitude coordinates).在 utils::unzip(zipfile, exdir = dirname(zipfile)) 出错:'exdir'不存在。utils::unzip(zipfile, exdir = dirname(zipfile))中出错:'exdir'不存在。

问题描述 投票:1回答:1

使用getData()上传.csv文件中的经纬度坐标。

很抱歉提出这样一个基本问题,但我是R的新手,我在使用函数getData()上传包含经纬度坐标的.csv文件时遇到了问题。我的想法是在worldlcim中上传数据。

我使用的代码是。

bioclim.data <- getData(name = "worldclim",
                    var = "bio",
                    res = 2.5,
                    path "~/Documents/TerneyProposal/UpalPublishedPapers/Blue_Whale_Paper/Data_Blue_Whale_Project/Blue_Whale_GPS_CSV.csv")enter code here

但是,我一直收到这个错误信息。

trying URL 'https://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip'
Content type 'application/zip' length 129319755 bytes (123.3 MB)
==================================================
downloaded 123.3 MB


 Could not download file -- perhaps it does not exist
Error in utils::unzip(zipfile, exdir = dirname(zipfile)) : 
 'exdir' does not exist

我不明白这条信息是因为我的.csv文件不是在压缩文件里的 而当我使用函数read.csv("data")时这个文件也很容易打开

非常好的问候,如果有谁能好心建议一下?

非常感谢

r directory latitude-longitude raster
1个回答
0
投票

欢迎来到社区! 这种错误有点误导人... 我想主要问题可能是你的文件不在它所期望的文件夹里。运行.看看工作文件夹是什么。

getwd()

看看工作文件夹是什么... 是它期待文件的地方。要么把文件移到那个文件夹里,要么你可以通过写文件,把你的会话的工作目录改成文件所在的文件夹。

setwd("pathToYourFile")

如果你是在windows下,记得把那些讨厌的... \/.

试试吧!

© www.soinside.com 2019 - 2024. All rights reserved.