It is possible to run a r script from the terminal:
Let's say I have a file "message.r" which contains the following:
print("hello world")
I can run the script from the terminal with the the following command:
$ Rscript message.r
[1] "hello world"
Let's says now that I have a script containg code for a plot names plot.r
with the following content:
x = c(1,2,3)
y = c(2,3,6)
plot(x,y)
Entering the command
Rscript plot.r
nothing happens
How to make display a plot from the terminal?