Hi R Users, I need to produce a simple report consisting of some graphs and a statistic. Here simplification of it: # graphics output test a <- c(1,3,2,1,4) b <- c(2,1,1,1,2) c <- c(4,7,2,4,5) d <- rnorm(500) e <- rnorm(600) op <- par(mfrow=c(3,2)) pie(a) pie(b) pie(c) text(ks.test(d,e)) obviously, the ks.test does not make it to the output. How can this be archived by a) simply dumpting the text into the fourth quad so that coordination is relative to the quarter? b) the output is actually presented as a little table without the need to use a LaTeX solution? Thanks a lot, Ralf
Fun question. Here is one solution that has come to mind: # graphics output test a <- c(1,3,2,1,4) b <- c(2,1,1,1,2) c <- c(4,7,2,4,5) d <- rnorm(500) e <- rnorm(600) op <- par(mfrow=c(2,2)) pie(a) pie(b) pie(c) txt <- capture.output(ks.test(d,e)) txt <- txt[txt != ""] txt <- paste(txt, collapse = " \n ") plot(1:20, col = "white", axes = F, xlab = "", ylab = "") text(10,10, txt) ----------------Contact Details:------------------------------------------------------- Contact me: Tal.Galili@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Thu, Aug 5, 2010 at 1:02 AM, Ralf B <ralf.bierig@gmail.com> wrote:> Hi R Users, > > I need to produce a simple report consisting of some graphs and a > statistic. Here simplification of it: > > # graphics output test > a <- c(1,3,2,1,4) > b <- c(2,1,1,1,2) > c <- c(4,7,2,4,5) > d <- rnorm(500) > e <- rnorm(600) > op <- par(mfrow=c(3,2)) > pie(a) > pie(b) > pie(c) > text(ks.test(d,e)) > > obviously, the ks.test does not make it to the output. How can this be > archived by a) simply dumpting the text into the fourth quad so that > coordination is relative to the quarter? b) the output is actually > presented as a little table without the need to use a LaTeX solution? > > Thanks a lot, > Ralf > > ______________________________________________ > R-help@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. >[[alternative HTML version deleted]]
On Wed, 4 Aug 2010 18:02:41 -0400 Ralf B <ralf.bierig at gmail.com> wrote:> b) the output is actually > presented as a little table without the need to use a LaTeX solution? >If it's not imperative to have the ks.test output in the graphic, why not copy/paste and use some monospace font? Liviu
Hi, To add tables, the gplots package has a textplot() function, and for Grid graphics there is a grid.table() function in gridExtra. HTH, baptiste On 5 August 2010 00:02, Ralf B <ralf.bierig at gmail.com> wrote:> Hi R Users, > > I need to produce a simple report consisting of some graphs and a > statistic. Here simplification of it: > > # graphics output test > a <- c(1,3,2,1,4) > b <- c(2,1,1,1,2) > c <- c(4,7,2,4,5) > d <- rnorm(500) > e <- rnorm(600) > op <- par(mfrow=c(3,2)) > pie(a) > pie(b) > pie(c) > text(ks.test(d,e)) > > obviously, the ks.test does not make it to the output. How can this be > archived by a) simply dumpting the text into the fourth quad so that > coordination is relative to the quarter? b) the output is actually > presented as a little table without the need to use a LaTeX solution? > > Thanks a lot, > Ralf > > ______________________________________________ > 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. >