[R] plotting text tables

Emmanuel Paradis paradis at isem.univ-montp2.fr
Wed Nov 14 09:23:45 CET 2001

At 17:32 13/11/01 +0100, Miguel Angel Merino Alonso wrote:
>Could anyone provide me a function to plot text tables (formatted)
>in a graphical device (ie postcript) ???
>Thanks in advance

I am not sure there is a function designed to do that. You can play with
plot(..., type="n"), and text(), e.g.:

# generate a table of Poisson counts
table(rpois(100,5)) -> tt
n <- length(tt)
# the following plot() command gives a blank device but sets the axes
# you may adjust the ylim option for your precise need
plot(1:n, type="n", xaxt="n", yaxt="n", xlab="", ylab="", ylim=c(1, 2),
# here also you may adjust the "1.5", "1.3", and "1.4" for your data
text(1:n, rep(1.5, n), dimnames(tt)[[1]])
text(1:n, rep(1.3, n), as.character(tt))

Hope this helps.

Emmanuel Paradis

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list