简体   繁体   中英

Error with X11 on R

I tried the following command in RStudio version Version 0.99.441 in Linux system:

 X11(width=800,height=600,pointsize=12)

But it gives me the error:

No protocol specified
Error in .External2(C_X11, d$display, d$width, d$height, d$pointsize,  : 
 unable to start device X11cairo
In addition: Warning message:
In X11(width = 800, height = 600, pointsize = 12) :
 unable to open connection to X11 display ''

I am not able to find out the problem here.

ADDITION

capabilities()

It gives the following output:

jpeg         png        tiff       tcltk         X11        aqua    http/ftp     sockets      libxml 
TRUE        TRUE        TRUE        TRUE       FALSE       FALSE        TRUE        TRUE        TRUE 
fifo      cledit       iconv         NLS     profmem       cairo         ICU long.double     libcurl 
TRUE        TRUE        TRUE        TRUE        TRUE        TRUE       FALSE        TRUE        TRUE    

As per r-manual :

X11 starts a graphics device driver for the X Window System (version 11). This can only be done on machines/accounts that have access to an X server.

That means you have to have a 'nix system that has a support for graphics devices. Since you're running a shell account you're connected to a server that doesn't have any or you don't have the privileges.

In this situation you can either contact the admin of your server and ask about installing the xvfb ( ref ). Or you can run R on a virtual machine on your own computer.

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