[R] postcript file / xyplot function [Broadcast]

Richard M. Heiberger rmh at temple.edu
Tue Oct 3 15:16:36 CEST 2006


I recommend you get a better editor, one that highlights mismatched
parentheses.

Your statement

xyplot(data[,3] ~ data[,2] | data[,1],
       panel=function(x,y) {panel.xyplot(x,y)

was never completed, the close "}" is missing, hence it never executed.

Please use better spacing in your functions as it makes it
easier for the human to read them.


In this example, since you are using the default panel function, the
simpler statement

xyplot(data[,3] ~ data[,2] | data[,1])

would have sufficed.

Even better, use a data.frame, rather than a matrix, 
and use variable names for legibility,
and you could write

xyplot(y ~ x | a, data=mydata)
 

Rich



More information about the R-help mailing list