This article demonstrates how to show a simple graph with help X11 system available in Cygwin/X
1.) How to install X11 in Cygwin
Double click the setup and launch the list of software shown in the previous article
choose the below two softwares
xinit
xorg-server
Compete the installation
2.) How to start the X11
Go to Start Menu
Click on "XWin Server"
Wait for 30 seconds
in your taskbar you will see two icons as below
Right Click the second icon and choose the menu option
System Tools -> Cygwin Terminal
Write your R code as below "sample2.r"
x <- seq(0, 10, by = 0.01)
y <- sin ( x )
x11()
plot ( x, y, type = "l" )
Sys.sleep ( 10 )
in your terminal you issue the below command
rscript sample2.r
You will see the graph window which will show for 10 seconds and disappear
You have successfully created a R code for GUI graph
Finished!