How do I use qqplot with r -f -


i have little script

library(ggplot2)  print(qplot(1:10, 1:10))  readlines("stdin", n = 1) 

that trying run with

r -f littlescript.r 

unfortunately, expected plot not displayed. in fact, nothing displayed @ all. understand should use print() on qplot()'s output, yet, doesn't in case.

when running script, r doesn't invoke graphics default.

you can add command x11() enable it:

library(ggplot2) x11() print(qplot(1:10, 1:10))  readlines("stdin", n = 1) 

alternatively save plot adding call jpeg/pdf etc etc:

library(ggplot2) jpeg("myfilepath.jpg") print(qplot(1:10, 1:10)) dev.off() readlines("stdin", n = 1) 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -