我试图在R中运行“白盒”包。
要开始,我遵循链接中的步骤:https://github.com/giswqs/whiteboxR
install.packages("whitebox")
whitebox::install_whitebox()控制台:
------------------------------------------------------------------------
Could not find WhiteboxTools!
------------------------------------------------------------------------
Your next step is to download and install the WhiteboxTools binary:
> whitebox::install_whitebox()
If you have WhiteboxTools installed already run `wbt_init(exe_path=...)`':
> wbt_init(exe_path='/home/user/path/to/whitebox_tools')
For whitebox package documentation, ask for help:
> ??whitebox
For more information visit https://giswqs.github.io/whiteboxR/
------------------------------------------------------------------------
Performing one-time download of WhiteboxTools binary from
https://www.whiteboxgeo.com/WBT_Windows/WhiteboxTools_win_amd64.zip
(This could take a few minutes, please be patient...)
trying URL 'https://www.whiteboxgeo.com/WBT_Windows/WhiteboxTools_win_amd64.zip'
Content type 'application/zip' length 15383844 bytes (14.7 MB)
downloaded 14.7 MB
WhiteboxTools binary is located here: C:/Users/frsu0056/OneDrive - Umeå universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe
You can now start using whitebox
library(whitebox)
wbt_version()下载后,我运行:
library(whitebox)
if(wbt_init()==TRUE){print("all good")}#confirms if the whitebox_tools.exe exists in,'C:/Users/frsu0056/OneDrive - Umeå universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe'.控制台:
[1] "all good"现在,如果我试图运行白盒包中的任何函数,它将返回一条奇怪的错误消息。
例如
wbt_version()返回:
Error :
Error running WhiteboxTools
whitebox.exe_path: "C:/Users/frsu0056/OneDrive - Umeå universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe"; File exists? TRUE
Arguments: --version
Error in system(exeargs, intern = TRUE, ignore.stderr = ignore.stderr, : '"C:/Users/frsu0056/OneDrive - UmeÃ¥ universitet/Documents/R/win-library/4.1/whitebox/WBT/whitebox_tools.exe"' not found然而,wbt_init()返回TRUE,因此该文件存在于给定的目录中。但是,wbt_version()函数找不到它。
因此,这个故事适用于白盒包中的任何功能。它只是找不到.exe文件,但是文件存在于它应该在的文件夹中。
其他人也会遇到同样的问题吗?这里有什么问题吗?
下面是位于目录中的.exe文件。

发布于 2022-11-10 21:44:58
在我的经验中,白盒的问题是它不能解码空间。我不认为问题在于单驱动器文件夹本身,只是文件路径中有空格。我建议不要将软件包安装在一个驱动器文件夹或路径有空格的任何其他文件夹中。若要更改安装库的文件夹,请参阅解决方案:Change R default library path using .libPaths in Rprofile.site fails to work
https://stackoverflow.com/questions/71411760
复制相似问题