Dear all, If you know how to add a table under a plot, could you please send me your code? In R documentation, there is a function addtable2plot{}, do you know where to download the function? Thank you in advance, Helen [[alternative HTML version deleted]]
Hi, the function is in the plotrix package, so you have to install and call that package first. After installing see example(addtable2plot). HTH, daniel ________________________________________ Felad?: r-help-bounces at r-project.org [r-help-bounces at r-project.org] ; meghatalmazó: Helen Gao [helengao432 at gmail.com] K?ldve: 2014. m?jus 23. 16:38 To: r-help at r-project.org T?rgy: [R] how to add a table under a plot? Dear all, If you know how to add a table under a plot, could you please send me your code? In R documentation, there is a function addtable2plot{}, do you know where to download the function? Thank you in advance, Helen [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
There is an addtable2plot function in the plotrix package, which is on CRAN and can be installed using install.packages or other standard ways of installing packages. If you need the table to line up with parts of the plot then you could leave extra margin area and call the axis function multiple times (without plotting the line or tick marks and on different line numbers) to place the table elements. Or use the mtext function to place the individual elements in the margin. Both could benefit from using a loop. On Fri, May 23, 2014 at 8:38 AM, Helen Gao <helengao432 at gmail.com> wrote:> Dear all, > > If you know how to add a table under a plot, could you please send me your > code? > > In R documentation, there is a function addtable2plot{}, do you know where > to download the function? > > Thank you in advance, > Helen > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
I'd go with the addtable2plot but you can also do bascially the same thing in ggplot2 (again you have to install the ggplot2 package. Here is an example of the ggplot2 approach http://stackoverflow.com/questions/12318120/adding-table-within-the-plotting-region-of-a-ggplot-in-r John Kane Kingston ON Canada> -----Original Message----- > From: helengao432 at gmail.com > Sent: Fri, 23 May 2014 15:38:45 +0100 > To: r-help at r-project.org > Subject: [R] how to add a table under a plot? > > Dear all, > > If you know how to add a table under a plot, could you please send me > your > code? > > In R documentation, there is a function addtable2plot{}, do you know > where > to download the function? > > Thank you in advance, > Helen > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.____________________________________________________________ FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!