简体   繁体   中英

Cannot load ggplot2 in R

I tried to load ggplot2 and got the following error message.

library(ggplot2)
sh: otool: command not found
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
  call: system2("otool", c("-L", shQuote(DLL)), stdout = TRUE)
  error: error in running command
Error: package or namespace load failed for ‘ggplot2’

Assuming you are using Mac OSX, you can resolve this issue by deleting X11 (Applications > Utilities > X11), as well as the folder in "/opt" (from Finder, go to folder > /opt). Then, reinstall X11 ( http://xquartz.macosforge.org/trac ). Restart your R session and you should be good to go.

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