我正在尝试使用 R-package 配置序列索引图的 y 轴TraMineR
,我想出了如何为 y 轴设置全局限制,如果您想比较两个或多个之间的某些序列的数量,这将很有帮助分组,因为它均衡了规模。但我没有设法设置 y 轴刻度(如在 xtstep 中)。也许您可以使用以下示例代码快速帮助我:
library(TraMineR)
data(mvad)
mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school",
"training")
mvad.labels <- c("Employment", "Further Education", "Higher Education",
"Joblessness", "School", "Training")
mvad.scodes <- c("EM", "FE", "HE", "JL", "SC", "TR")
## Define sequence objects
mvad.seq <- seqdef(mvad[, 17:86], alphabet = mvad.alphabet,
states = mvad.scodes, labels = mvad.labels, weights = mvad$weight, xtstep = 6)
## Plots
seqIplot(mvad.seq, group=mvad$gcse5eq, withlegend=TRUE, border=NA, xtstep=3, sortv="from.start") ## Default plot
seqIplot(mvad.seq, group=mvad$gcse5eq, withlegend=TRUE, border=NA, xtstep=3, sortv="from.start", ylim=c(0, 400)) ## Plot with custom ylim to compare the number of sequences between groups
默认的序列索引图如下所示,很难比较两组: