[R] Character graphics

Gabor Grothendieck ggrothendieck at myway.com
Mon Dec 8 06:09:20 CET 2003


I think you would have to roll your own or make use
of a second package.  With the free Macanova package, 
try this:

In R,

   write( x, file = "/temp.dat" )   # x is vector, e.g. x <- 1:20

In MacAnova,

   x <- vecread( "/temp.dat" )
   hist( x, freq:T, dumb:T, new:T, file:"/hist.out" )
   quit(F)  # exit Macanova without prompting

If you are using the Windows version of Macanova you could even transfer
the data through the clipboard (replacing the write and read parts above with
write(x,file="clipboard") and vecread(string:CLIPBOARD) ).  You could even
spawn Macanoava from R (system("macanowx -batch /hist.mac")) if you place
the Macanova commands in a file, hist.mac.

Here is the hist.out file:


                    Frequency histogram of vecread(string:CLIPBOARD)
           +---------------+--------------+---------------+---------------+---+
          4+..................................................................+
           |.            .            .            .            .            .|
           |.            .            .            .            .            .|
        3.5+.            .            .            .            .            .+
           |.            .            .            .            .            .|
          3+.            .            .            .            .            .+
 F         |.            .            .            .            .            .|
 r         |.            .            .            .            .            .|
 e      2.5+.            .            .            .            .            .+
 q         |.            .            .            .            .            .|
 u        2+.            .            .            .            .            .+
 e         |.            .            .            .            .            .|
 n      1.5+.            .            .            .            .            .+
 c         |.            .            .            .            .            .|
 y         |.            .            .            .            .            .|
          1+.            .            .            .            .            .+
           |.            .            .            .            .            .|
        0.5+.            .            .            .            .            .+
           |.            .            .            .            .            .|
          0+..................................................................+
           +---------------+--------------+---------------+---------------+---+
           0               5             10              15              20
                                vecread(string:CLIPBOARD)



---
Date: Mon, 08 Dec 2003 14:51:32 +1300 
From: Murray Jorgensen <maj at stats.waikato.ac.nz>
To: R-help <r-help at stat.math.ethz.ch> 
Subject: [R] Character graphics 

 
 
Does anyone else miss email-friendly character graphics such as the 
following example, produced using Minitab?

Histogram of C6 N = 478 N* = 21
Each * represents 2 observation(s)

Midpoint Count
-12 16 ********
-11 53 ***************************
-10 63 ********************************
-9 83 ******************************************
-8 93 ***********************************************
-7 74 *************************************
-6 45 ***********************
-5 13 *******
-4 6 ***
-3 2 *
-2 10 *****
-1 18 *********
0 1 *

BTW, Minitab 13 protests when you want to do this:

MTB > gstd
* NOTE * Character graphs are obsolete.

* NOTE * Standard Graphics are enabled.
Professional Graphics are disabled.
Use the GPRO command to enable Professional Graphics.

Has anyone tried to get similar unprofessional displays out of R?

Cheers, Murray

-- 
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz Fax 7 838 4155
Phone +64 7 838 4773 wk +64 7 849 6486 home Mobile 021 1395 862




More information about the R-help mailing list