[R] How to make two figures in one plot - package vcd

Muhammad Subianto subianto at gmail.com
Fri Sep 16 15:16:59 CEST 2005


Dear all,
I have a problem to make figures with two columns in package vcd.
Here an example code I take from "\library\vcd\html\plot.loglm.html"
What I need, I want to make two figures in one plot.
How could I do that.
I have tried with
layout(rbind(c(1, 1, 2, 2)))
but the same result, two plot.

Best wishes, Muhammad Subianto

library(vcd)
oldpar <- par(mfrow=c(1, 2))
## mosaic display for PreSex model
data(PreSex)
fm <- loglm(~ PremaritalSex * ExtramaritalSex * (Gender + MaritalStatus),
             data = aperm(PreSex, c(3, 2, 4, 1)))
## visualize Pearson statistic
plot(fm, split_vertical = TRUE)
## visualize LR statistic
plot(fm, split_vertical = TRUE, residuals_type = "deviance")
par(oldpar)


 > version
          _
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    2
minor    1.1
year     2005
month    06
day      20
language R
 >
 > packageDescription("vcd")
Package: vcd
Version: 0.9-3
Date: 2005-09-01
....




More information about the R-help mailing list