问题
I have installed XQuartz on my machine using homebrew and then I restarted my machine, when I try to use the fix() command in RStudio I get the following error
> College=read.csv("College.csv",header=T,na.strings ="?")
> fix(College)
Error in edit.data.frame(get(subx, envir = parent), title = subx, ...) :
X11 is not available
When I try to the following in terminal it works as expected. How can I make the same command work in RStudio
回答1:
Putting this as an answer in case other find this.
This particular issue was due to using Homebrew R on macOS which (at the time of this Q) didn't compile with X11 support.
I should have had the OP execute capabilities()
first. That would have displayed something like:
## jpeg png tiff tcltk X11 aqua http/ftp
## TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## sockets libxml fifo cledit iconv NLS profmem
## TRUE TRUE TRUE TRUE TRUE TRUE TRUE
## cairo ICU long.double libcurl
## TRUE TRUE TRUE TRUE
If X11
is FALSE
, then you have an R installation w/o support for X11 and should use the macOS R distribution from CRAN.
来源:https://stackoverflow.com/questions/47898202/rstudio-on-mac-os-x-10-13-getting-x11-is-not-available-error-when-trying-to-use