[R] superimpose multiple scatterplot matrices

Richard M. Heiberger rmh at temple.edu
Thu Jul 2 20:22:19 CEST 2009


Ping-Hsun Hsieh wrote:
> Dear R- experts,
>
>  
>
> I am trying to superimpose two or more scatterplot matrices generated by pairs() to visualize the differences over each datasets, but have not been very successful. Two data frames, df1 and df2 for example, each has the same five variables in columns.
>
> My goal is to paint each dataset with a color on the same plot panel for each pair of the five variables.
>   
Use the lattice splom instead of the regular graphics pairs plot.

tmp <- data.frame(a=rnorm(100), b=rnorm(100, m=rep(c(1,3), each=50)),
                            cc=rnorm(100), g=rep(letters[1:2], each=50))
splom(~tmp[1:3], groups=tmp$g)




More information about the R-help mailing list