[R] Problem with specifiying column widths in layout

Peter H Singleton psingleton at fs.fed.us
Wed Mar 12 20:51:13 CET 2008


I am trying to generate a graphic with a matrix of 9 line graphs (3 rows, 3
columns), all with the same y-axis range, and only showing the y-axis
labels and title at the left edge of each row of the matrix. I have been
trying to use the widths argument in layout to specify a larger column
width in the left column so that I have room for the y-axis labels and
title, but I get the following error:

> layout(matrix(1:9, ncol=3, widths=c(2,1,1), byrow=TRUE))

Error in matrix(1:9, ncol = 3, widths = c(2, 1, 1), byrow = TRUE) :
  unused argument(s) (widths = c(2, 1, 1))

I think I'm correctly following the example on p80 in Murrell, and I've
seen other people using this syntax in listserv posts, but I'm obviously
doing something wrong. Any suggestions?

<<->><<->><<->><<->><<->><<->><<->>
Peter Singleton
USFS Pacific Northwest Research Station



More information about the R-help mailing list