r - Worldclim:R中的getData()(纬度/经度坐标):utils :: unzip(zipfile,exdir = dirname(zipfile))中的错误:'exdir'不存在
问题描述
使用 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 文件不在 zip 文件中,而且当我使用函数 read.csv("data") 时,这个文件也很容易打开
非常亲切的问候,如果有人可以请建议?
提前谢谢了!
解决方案
欢迎来到社区!这些类型的错误有点误导......我认为主要问题可能是您的文件不在它期望的文件夹中。跑:
getwd()
看看工作文件夹是什么......这就是它所期望的文件。将文件移动到该文件夹中,或者您可以将会话的工作目录更改为文件所在的文件夹,方法是:
setwd("pathToYourFile")
如果您在 Windows 上,请记住将那些讨厌的更改\
为/
.
试试看!
推荐阅读
- java - 如何在 recylerview 项目中创建 recylerview?
- php - laravel 我如何显示枢轴:来自 get() 方法的数据
- swiftui - SwiftUI:WKWebView 未加载
- python - 自加入所有不同的值并在 Pandas 中应用聚合函数
- symfony - SELECT 的 Symfony 值
- asp.net - REST API 服务返回 JSON,但 Chrome 显示双重编码
- c - 我如何正确地 malloc 这个结构?
- puppet - 如何在 puppet 模板中获取 gid 和 uid?
- javascript - 使用 svelte/store 测试 svelte 组件
- java - 这将是一个 if 语句