Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
Another thought I had was to use Sweave. I could, in theory, use Sweave to create a plot only 7 inches high, and then a summary table 4 inches high below it, all on the same page of a Latex document. Could be messy, but might work. On 6/1/10 11:18 AM, Dennis Murphy wrote: > > > On Tue, Jun 1,

Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
You are correct, I initially missed the "as.mcmc" step. Without it, R doesn't want to squeeze so many plots onto a page. Thanks! On 6/1/10 10:48 AM, Dennis Murphy wrote: > Hi: > > Ben's example worked for me as follows: > > x <- matrix(runif(22000),ncol=22) > library(lattice) > library(coda) >

Re: [R] Plot multiple columns

2010-06-01 Thread Dennis Murphy
Hi: Ben's example worked for me as follows: x <- matrix(runif(22000),ncol=22) library(lattice) library(coda) m <- as.mcmc(x) xyplot(m, layout = c(2, 11)) layout = uses columns first, then rows...I always forget that :) It also has an optional third argument for pages, which might come in handy

Re: [R] Plot multiple columns

2010-06-01 Thread Noah Silverman
Hi, I used the term "run", as each iteration of the Gibbs sampler produces 22 variables (coefficients for Beta in a regression model) The example wont work On 6/1/10 5:54 AM, Ben Bolker wrote: > Noah Silverman smartmediacorp.com> writes: > > >> I'm running a long MCMC chain that is generat

Re: [R] Plot multiple columns

2010-06-01 Thread Ben Bolker
Noah Silverman smartmediacorp.com> writes: > > I'm running a long MCMC chain that is generating samples for 22 variables. > > I have each run of the chain as a row in a matrix. > So: Chain[,1] is the column with all the samples for variable one. > Chain[,2] is the column with all the samples

Re: [R] Plot multiple columns

2010-06-01 Thread baptiste auguie
Hi, You could use melt from the reshape package to create a long format data.frame. This is more easy to plot with lattice or ggplot2, and you can then use facetting to arrange several plots on the same page. The dummy example below produces 10 pages of output with 10 graphs per page. library(ggp

Re: [R] Plot multiple columns

2010-06-01 Thread Ivan Calandra
Hi, Try with: par(mfrow=c(11,2)) It should work better! Remember that mfrow is an argument of the function par(), not a function itself. One other tip: think about using pdf, ps, png, or SVG devices, I find it easier and nicer. HTH, Ivan Le 6/1/2010 10:02, Noah Silverman a écrit : I'm ru

[R] Plot multiple columns

2010-06-01 Thread Noah Silverman
I'm running a long MCMC chain that is generating samples for 22 variables. I have each run of the chain as a row in a matrix. So: Chain[,1] is the column with all the samples for variable one. Chain[,2] is the column with all the samples for variable 2, etc. I'd like to fit all 22 on a single