无法安装flextable

Luc*_*caS 2 r flextable

我在安装时遇到了问题Flextable,这似乎是由于gdtools包装所致。看起来gdtools依赖于.dylib文件吗?有任何想法吗?

> install.packages("flextable")

  There is a binary version available but the source version is later:
          binary source needs_compilation
flextable  0.4.0  0.4.2             FALSE

installing the source package ‘flextable’

trying URL 'https://cran.rstudio.com/src/contrib/flextable_0.4.2.tar.gz'
Content type 'application/x-gzip' length 135276 bytes (132 KB)
==================================================
downloaded 132 KB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'default/Australia/Melbourne'
* installing *source* package ‘flextable’ ...
** package ‘flextable’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so, 6): Library not loaded: /opt/X11/lib/libcairo.2.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so
  Reason: image not found
ERROR: lazy loading failed for package ‘flextable’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/flextable’
Warning in install.packages :
  installation of package ‘flextable’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/fs/2zzbjym545vgl0hvq4pvs6sc0000gn/T/Rtmpdo3FMp/downloaded_packages’
Run Code Online (Sandbox Code Playgroud)

Luc*_*caS 5

我设法通过重新安装石英解决了这个问题:https : //www.xquartz.org


Dav*_*hel 5

对于Mac用户。Mac os X更新有时会发生这种情况。这需要Homebrew(可以使用以下命令安装:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run Code Online (Sandbox Code Playgroud)
  1. 关闭所有R会话(不是强制性的,但根据经验,这是最佳解决方案)。

在终端中,运行以下命令:

brew update
brew upgrade
brew reinstall cairo
Run Code Online (Sandbox Code Playgroud)
  1. 打开R会话并运行以下代码:

    install.packages(“ gdtools”,type =“源”)