[R] plot(all.effects)

From: Michael Kubovy <kubovy_at_virginia.edu>
Date: Tue 24 Oct 2006 - 14:39:15 GMT


Dear r-helpers,

plot(all.effects()) uses trellis for its output, and often produces several effect plots in a layout. Can anyone tell me how to set the arguments to plot.effect which default to row=1, col=1, nrow=1, ncol=1, more=FALSE so that I can plot multiple effect plots on one layout?

I was hoping that a call like

last <- rep(c(TRUE, FALSE), c(3, 1))
lay <-matrix(c(1:4,), 2, 2, byrow = T)
for(i in 1:4) {

	tmp.lm <- lm(y ~ a + b, data)
	spl <- which(lay == i, arr.ind = TRUE)
	rowN = spl[1]
	colN = spl[2]
	plot(all.effects(tmp.lm), row = rowN, col = colN, nrow = 2, ncol =  
2, more = last[i])
}

would work (my data are complicated, and have not had the time to set up a replicable example).

Here is what I ran, and what R told me:
for(i in 1:4) {

        tmp.lm <- lm(duration ~ (pitch + vis + aud + display)^2 - aud:display - vis:aud -

		pitch:vis, data = subset(txt, subj == unique(txt$subj)[i]))
	spl <- which(lay == i, arr.ind = TRUE)
	rowN = spl[1]
	colN = spl[2]
	plot(all.effects(tmp.lm), rug = F, ask = F,
		main = paste('Subject = ',sep = '', i),
		row = rown, col = coln, nrow = 2, ncol = 2, more = last[i])
  }
Error in plot.effect(x[[(i - 1) * cols + j]], row = i, col = j, nrow = rows, :

        formal argument "row" matched by multiple actual arguments



Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766

WWW: http://www.people.virginia.edu/~mk9y/

R-help@stat.math.ethz.ch 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. Received on Wed Oct 25 08:54:35 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 24 Oct 2006 - 23:30:13 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.