Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to plot in new window by default in R?

Tags:

terminal

plot

r

I tried to run some R scripts within a terminal and just found that I have to run 'dev.new()' first every time I want to make new plots.

Is it possible, with some environment settings, R in a Terminal could plot in new frame by default (like what Rstudio does)?

Thanks!

Sorry, I made a mistake when asked the question. it should be a new plot in a new window (not a plot with a new frame). Sorry for the confusions.

like image 423
L.J Avatar asked Mar 22 '23 10:03

L.J


1 Answers

I think this should do what you want.

plot<-function(...){
  grDevices::dev.new()
  graphics::plot(...)
}
like image 80
Ben Avatar answered Apr 05 '23 22:04

Ben