2

I'm running R from Unix and would like to see all output without any pop-ups. So, for example, if in unix I run

R -f test.r

Where test.r is

value = pnorm(rnorm(10000))
hist(value,breaks=10)

I would like the output to include a histogram drawn in the terminal. Is this possible? I'm assuming I need some kind of Unix plotting package.

erin
  • 413
  • 2
  • 7
  • 12
  • 1
    Maybe this? http://stackoverflow.com/a/9151960/1201032 – flodel Jul 19 '13 at 14:34
  • possible duplicate of [How can I generate ascii "graphical output" from R?](http://stackoverflow.com/questions/9151884/how-can-i-generate-ascii-graphical-output-from-r) – David LeBauer Dec 04 '14 at 05:49

1 Answers1

5

There is txtplot package. Here is an example from the manual on how to output a histogram:

## text based barchart
x <- factor(c("orange", "orange", "red", "green", "green", "red", "yellow", "purple", "purple", orange"))
txtbarchart(x)

If you need more complex plots I would recommend you take a look at gnuplot and Rgnuplot package that allows to call it from R. gnuplot has "dumb" terminal type which outputs ascii graphics.

Alex Vorobiev
  • 4,349
  • 21
  • 29