我想知道是否可以在ytlab中的seqIplot中旋转TraMineR。当我尝试使用序列的row.names时,也会收到警告消息。
数据:
mc = structure(c(1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 0, 0, 0,
0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 0, 0, 0, 0,
0, 0, 1, 1, 1, 2, 1, 1, 0, 0, 0, 0), .Dim = c(10L, 5L), .Dimnames = list(
c("d Travel/Commute", "j Care for others", "r Religious",
"u Others", "e Cooking", "f Housework", "h Eating", "l Leisure",
"t TV/Radio", "o Telephone/Online Communication"), c("V1",
"V2", "V3", "V4", "V5")))序列
sq = seqdef(mc, cpal = heat.colors(3))The Iplot
seqIplot(sq, border = NA, ytlab = attributes(sq)$row.names, las = 2)las = 2的论点显然行不通。
发布于 2015-07-06 20:29:48
您必须使用axis()来指定在哪个轴上应用las。
此外,您还需要指定想要滴答标记的点。seqIplot使用0-1标度,并在开始时作了一些调整.此外,要旋转标签,您必须腾出一些地方使用par(mar=...)。
下面是如何为您的示例获得旋转标签:
step = nrow(mc)+3
par(mar=c(5,20,2,2))
seqIplot(sq, border = NA, ylab=NA, ytlab=FALSE)
axis(2, at=2.15/step + 1:10*(1/step), labels=rownames(sq), las = 2)希望这能有所帮助。
https://stackoverflow.com/questions/31242988
复制相似问题