我在r中加载库土壤纹理有问题



我在MacOS 11.3.1上加载R版本4.1.1soiltexture包时遇到问题

我尝试了两种安装方法:

  1. install.packages(soiltexture)

安装

没有错误2。

install.packages(
pkgs = "soiltexture",
repos = "http://R-Forge.R-project.org"
) 
包含soiltexture包错误的

在此版本的R中不可用



当我只安装第一个选项我得到这个错误
Error: package or namespace load failed for ‘soiltexture’: .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/tcltk/libs/tcltk.so': dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /opt/X11/lib/libX11.6.dylib Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/tcltk/libs/tcltk.so Reason: image not found

我看到'tcltk'是一个基本包,所以我不确定从这里去哪里。

Have also tried

install.packages("devtools")
devtools::install_github("julienmoeys/soiltexture/pkg/soiltexture")

显示错误信息:

Downloading GitHub repo julienmoeys/soiltexture@HEAD
✓  checking for file ‘/private/var/folders/bq/x1vhzkf57p3fd9npyyb9wvlm0000gn/T/Rtmp1BYNgF/remotes14af6685ccbb4/julienmoeys-soiltexture-7586a8b/pkg/soiltexture/DESCRIPTION’ ...
─  preparing ‘soiltexture’:
✓  checking DESCRIPTION meta-information ...
─  installing the package to process help pages
-----------------------------------
─  installing *source* package ‘soiltexture’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) :
running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status 1
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /opt/X11/lib/libX11.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/tcltk/libs/tcltk.so
Reason: image not found
Execution halted
ERROR: lazy loading failed for package ‘soiltexture’
─  removing ‘/private/var/folders/bq/x1vhzkf57p3fd9npyyb9wvlm0000gn/T/RtmpdN89vG/Rinst1523015dba5c8/soiltexture’
-----------------------------------
ERROR: package installation failed
Error: Failed to install 'soiltexture' from GitHub: System command 'R' failed, exit status: 1, stdout + stderr: E> * checking for file ‘/private/var/folders/bq/x1vhzkf57p3fd9npyyb9wvlm0000gn/T/Rtmp1BYNgF/remotes14af6685ccbb4/julienmoeys-soiltexture-7586a8b/pkg/soiltexture/DESCRIPTION’ ... OK E> * preparing ‘soiltexture’: E> * checking DESCRIPTION meta-information ... OK E> * installing the package to process help pages E> ----------------------------------- E> * installing *source* package ‘soiltexture’ ... E> ** using staged installation E> ** R E> ** inst E> ** byte-compile and prepare package for lazy loading E> xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun E> Warning in system2("/usr/bin/otool", c("-L", shQuote(DSO)), stdout = TRUE) : E> running command ''/usr/bin/otool' -L '/Library/Frameworks/R.framework/Resources/library/tcltk/libs//tcltk.so'' had status

感谢所有的帮助!

tcl/tk在python流行之前是一种流行的UI脚本语言。

看看你的错误,我想你是在Windows上。该包缺少tcl共享库。请看这里- https://wiki.tcl-lang.org/page/How+to+compile+Tcl+and+related+C+extensions+on+Windows

步骤1-是tcl/tk工作没有R:找到tcltk的wish.exe并启动它。

步骤2—查看环境变量"MY_TCLTK"的值它是否指向Tcl/Tk的bin文件夹?如果没有:修复它。

如果没有定义:设置值为bin folder。

见这里- https://mirrors.dotsrc.org/cran/bin/windows/base/rw-FAQ.html#Package-TclTk-does-not-work_002e

最新更新