[R] Tables in graphics window

Tanya Murphy tmurph6 at po-box.mcgill.ca
Wed Nov 20 15:58:44 CET 2002


James Holtman and Marc Schwartz:

Thank you for your replies. I am slowly getting closer to the output I was 
hoping for.

Plotting a table:

Finally I used this method for plotting the text table:
# Drug table
## Print dates as DMY (otherwise printed as an integer)
ond <- as.date(ON)
offd <- as.date(OFF)
## Create plot region
par(mar = c(1, 1, 1, 1) + 0.1) 
plot.new()
## Headings (Bold)
text(0,1,paste(“Start date”), adj=c(0,1), font=2)
text(0.3,1,paste(“Stop date”), adj=c(0.5,1) , font=2)
text(0.6,1,paste(“ARVs”), adj=c(0.5,1) , font=2)
## Plot data (double spaced)
text(0,0.85,paste(ond, collapse='\n\n'), adj=c(0,1))
text(0.3, 0.85,paste(offd, collapse='\n\n'), adj=c(0.5,1))
text(0.6, 0.85,paste(ARVS, collapse='\n\n'), adj=c(0.5,1))

After playing with the size of the columns, the result looks good.

Tanya


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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