我正在使用包 nhdR
(link to package page) 在 R 中工作。
nhdR
需要 7zip
来解压缩使用包函数(例如 nhd_plus_get()
)下载的数据。我使用的是 MacBook pro,所以我通过自制软件 (brew install p7zip
) 通过终端安装了 7zip。这似乎工作得很好。
但是,当我调用需要 nhdR
的 7zip
函数时,R 似乎无法识别我安装了 7zip
。据我所知,配置 R 以使用 7zip
不需要额外的步骤。知道发生了什么吗?我需要在 R 中指定一些路径到 7zip
的位置吗?我有点失去它,所以感谢任何帮助。
我跑过的:
终端:
brew install p7zip
7z
7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=utf8,Utf16=on,HugeFiles=on,64 bits,8 CPUs LE)
Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
(还返回命令和开关列表)
RStudio:
nhdR::nhd_plus_get(vpu = 15, component = "NHDSnapshot")
哪个返回
Error in nhd_plus_get(vpu = 15, component = "NHDSnapshot") :
The 7-zip program is needed to unpack NHD downloads (http://www.7-zip.org/).
进一步挖掘,
nhdR:::has_7z()
$yes
[1] FALSE
$path
[1] NA
会话信息:
R version 4.1.0 (2021-05-18)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.4
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
(加上很多包)