美文网首页R语言报错集锦
Error in get(x, envir = ns, inhe

Error in get(x, envir = ns, inhe

作者: QIQIXIE | 来源:发表于2019-09-29 13:05 被阅读0次

    问题来源

    今天安装Y叔的yyplot包的时候出现这样的报错

    > install.packages("/Users/xieqiqi/Downloads/yyplot-master/",repos = NULL,type = "source")
    ERROR: dependencies ‘dlstats’, ‘gglayer’, ‘meme’, ‘RISmed’, ‘rsvg’, ‘scholar’ are not available for package ‘yyplot’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/yyplot’
    Warning in install.packages :
      installation of package ‘/Users/xieqiqi/Downloads/yyplot-master/’ had non-zero exit status
    

    错误的根源应该是没有这些依赖包,于是我把缺少的依赖包安装一遍

    install.packages("dlstats")
    install.packages("meme")
    install.packages("RISmed")
    install.packages("rsvg")
    install.packages("scholar")
    install.packages("/Users/xieqiqi/Downloads/gglayer-master/",repos = NULL,type = "source")
    

    这时候新的问题就出现了,安装gglayer的时候又出现了以下的错误

    Error in get(x, envir = ns, inherits = FALSE) : 
      找不到对象'setup_data_continuous_color'
    错误: unable to load R code in package ‘gglayer’
    停止执行
    ERROR: lazy loading failed for package ‘gglayer’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/gglayer’
    Warning in install.packages :
      installation of package ‘/Users/xieqiqi/Downloads/gglayer-master/’ had non-zero exit status
    

    解决思路

    把错误关键词setup_data_continuous_color往谷歌里贴一下,会发现直接定位到了github上gglayer包里面的https://github.com/GuangchuangYu/gglayer/issues/1,其实y叔已经解答过这个问题


    安装ggtree
    > install.packages("/Users/xieqiqi/Downloads/ggtree-master/",repos = NULL,type = "source")
    * installing *source* package ‘ggtree’ ...
    ** using staged installation
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
    * DONE (ggtree)
    > install.packages("/Users/xieqiqi/Downloads/gglayer-master/",repos = NULL,type = "source")
    * installing *source* package ‘gglayer’ ...
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    Registered S3 method overwritten by 'treeio':
      method     from
      root.phylo ape 
    ** testing if installed package keeps a record of temporary installation path
    * DONE (gglayer)
    

    不幸的事情又发生了,继续安装yyplot的时候又出现以下报错

    Error : .onLoad failed in loadNamespace() for 'sysfonts', details:
      call: dyn.load(file, DLLpath = DLLpath, ...)
      error: 无法载入共享目标对象‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so’::
      dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
      Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/sysfonts/libs/sysfonts.so
      Reason: image not found
    错误: unable to load R code in package ‘yyplot’
    停止执行
    ERROR: lazy loading failed for package ‘yyplot’
    * removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/yyplot’
    错误: Failed to install 'yyplot' from GitHub:
      (由警告转换成)installation of package ‘/var/folders/l2/z_43t_mx3s30hlr5175g782w0000gn/T//RtmpPD1C3Z/fileedc76d280378/yyplot_0.0.8.tar.gz’ had non-zero exit status
    

    继续解决问题,同样找到这样的答案


    咱们安装xquartz,下载地址https://www.xquartz.org,安装完这个程序之后再安装yyplot
    > install.packages("/Users/xieqiqi/Downloads/yyplot-master/",repos = NULL,type = "source")
    * installing *source* package ‘yyplot’ ...
    ** using staged installation
    ** R
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    ** testing if installed package can be loaded from final location
    ** testing if installed package keeps a record of temporary installation path
    * DONE (yyplot)
    

    好了,搞定,我是小琪,一枚有点小理想的小医生,咱们明天见!


    作者:解琪琪
    链接:https://www.jianshu.com/u/bcb81276c29d
    来源:简书
    简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

    相关文章

      网友评论

        本文标题:Error in get(x, envir = ns, inhe

        本文链接:https://www.haomeiwen.com/subject/zhiiuctx.html