简体   繁体   中英

R can't load ggplot2

I've never had a problem loading ggplot2 before today, but for some reason R can't load it any more. I get no error message, R just locks up. Yesterday I installed the biclust and eisa packages. I ran all three packages without any problems. I also tried to load biclust and eisa and both caused R to lock up as well. I deleted all three packages and then reinstalled ggplot2, but had no luck. I downloaded the latest version of R, but that didn't work either. Any help would be appreciated.

OK, I just had (and fixed) what might be the same problem: attempting to execute library(ggplot2) would cause R to hang forever. Reinstall of R didn't fix it. Going back to an earlier version of R didn't fix it. Removal and/or reinstall of ggplot2 (and other) packages didn't fix it.

To see if you have the same problem that I did, try opening a Terminal shell, and type just 'R'. If you get error messages like these, then you might have the same problem I did:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Version/3.1/Resources/library/grDevices/libs/grDevices.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/grDevices/libs/grDevices.so, 6): Symbol not found: __cg_png_create_info_struct
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /usr/local/lib/libPng.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO

If this is your problem, I think what has happened is that sometime recently you installed a copy of libPng, perhaps via Macports or Homebrew. And, that copy is found first on your PATH (mine was in /usr/local/lib ), and it doesn't contain the right symbol.

To fix this, I chose to uninstall Homebrew completely (I was no longer using any brew commands), using the convenient script here:

https://gist.github.com/SteveBenner/11254428

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM