本文介绍了在Mac上包含cairo R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用命令install.packages('Cairo')在Rstudio中使用'Cairo'软件包并没有问题.我收到此消息-

I'm trying to use 'Cairo' package in Rstudio, using the command install.packages('Cairo')and it goes through with no problem. I get this message-

The downloaded binary packages are in
/var/folders/xn/c1nj85gx62b89876s15sbv9h0000gn/T//RtmpK9JM0l/downloaded_packages 

该软件包出现在软件包列表中,但是当我尝试使用library(Cairo)library('Cairo')包含该软件包时我收到此错误消息-

The package appears in the packages list, but when I try to include the package using library(Cairo) or library('Cairo') I get this error mesage-

Error : .onLoad failed in loadNamespace() for 'Cairo', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Cairo/libs/Cairo.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libXrender.1.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/Cairo/libs/Cairo.so
  Reason: image not found
Error: package or namespace load failed for ‘Cairo’

sessionInfo()

R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)

locale:
[1] he_IL.UTF-8/he_IL.UTF-8/he_IL.UTF-8/C/he_IL.UTF-8/he_IL.UTF-8

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods  
[9] base     

other attached packages:
[1] GenomicRanges_1.24.2 GenomeInfoDb_1.8.3   IRanges_2.6.1       
[4] S4Vectors_0.10.2     ggbio_1.20.2         BiocGenerics_0.18.0 
[7] ggplot2_2.1.0        BiocInstaller_1.22.3 shiny_0.13.2        

我不确定为什么会这样,有什么帮助吗?谢谢!

I'm not sure why is this happening, any help?Thanks!

推荐答案

您应该下载Mac版的X11,称为XQuartz.它不再与OS X一起提供,因此您必须单独下载: https://www.xquartz. org/

You should download X11 for Mac, which is called XQuartz. It doesn't ship with OS X any more, so you have to download it separately from: https://www.xquartz.org/

这篇关于在Mac上包含cairo R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 12:17