r - Printing plot depending on variable conditions on 2 pdf pages -
i'am trying print plot, depending on variable 12 terms. plot result of cluster classification on sequences, using om distance.
i print plot on 1 pdf page :
pdf("yyy.pdf", height=11,width=20) seqiplot(xxx.seq, group=xxx$variable, cex.legend = 2, cex.plot = 1.5, border = na, sortv =xxx.om) dev.off()
but printing small ... try print on 2 pages, :
pdf("yyy.pdf", height=11,width=20) seqiplot(xxx.seq, group=xxx$variable, variable="1":"6", cex.legend = 2, cex.plot = 1.5, border = na, sortv =xxx.om) seqiplot(xxx.seq, group=xxx$variable, variable="7":"12", cex.legend = 2, cex.plot = 1.5, border = na, sortv = xxx.om) dev.off()
but doesn't work ... know how can ask r separate terms' variables 2 groups, print 6 graphics per pdf page ?
the solution plot separately subset of groups want on each page. here example using biofam
data provided traminer
. group variable p02r04
religious participation takes 10 different values.
library(traminer) data(biofam) bs <- seqdef(biofam[,10:25]) group <- factor(biofam$p02r04) lv <- levels(group) sel <- (group %in% lv[1:6]) seqiplot(bs[sel,], group=group[sel], sortv="from.end", withlegend=false) seqiplot(bs[!sel,], group=group[!sel], sortv="from.end")
if sorting index plot variable should indeed take same subset of sort variable, e.g. sortv=xxx.om[sel]
in case.
Comments
Post a Comment