Hello, I would like to include a table (of rax data, not summary statistics - in case this makes any difference) alongside a plot. I know how to use 'layout' to divide my page into sections, but is it possible to put a table into one of these? Thanks! Tanya Murphy -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> Hello, I would like to include a table (of rax data, not > summary statistics - > in case this makes any difference) alongside a plot. I know > how to use > 'layout' to divide my page into sections, but is it possible > to put a table > into one of these? > > Thanks! > Tanya MurphyTanya, Take a look at these two posts from earlier this summer where I provide some conceptual and coding examples of plotting column aligned/justified text in a graphics window. http://www.r-project.org/nocvs/mail/r-help/2002/5760.html (concept) http://www.r-project.org/nocvs/mail/r-help/2002/5764.html (example code) The above examples are for a single "main" plot window, but you should be able to use these approaches in your various plot regions within a single window. As I point out in the first post, using demo(graphics) will also give you some sample code in creating spreadsheet-like cells within the plot region into which you can plot math symbols, etc. If you have any follow questions, let me know. Best regards and HTH, Marc Schwartz -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._