你是对的,trep
参数是 TraMineRseqrep
函数的一个参数,它寻找至少覆盖trep
所有序列百分比的代表性序列。
如果您特别想要最频繁的序列模式,使其累积百分比频率为 50%,那么您必须自己计算选择过滤器。以下是使用 biofam 数据的方法。
library(TraMineR)
data(biofam)
bf.seq <- seqdef(biofam[,10:25])
## first retrieve the "Percent" column of the frequency table provided
## as the "freq" attribute of the object returned by the seqtab function.
bf.freq <- seqtab(bf.seq, tlim=nrow(bf.seq))
bf.tab <- attr(bf.freq,"freq")
bf.perct <- bf.tab[,"Percent"]
## Compute the cumulated percentages
bf.cumsum <- cumsum(bf.perct)
## Now we can use the cumulated percentage to select
## the wanted patterns
bf.freq50 <- bf.freq[bf.cumsum <= 50,]
## And to plot the frequent patterns
(nfreq <- length(bf.cumsum[bf.cumsum <= 50]))
seqfplot(bf.seq, tlim=1:nfreq)
希望这可以帮助。