序列和seqiplot之间不一致
我正在使用seqiplot函数创建序列索引图.问题是我在绘图上显示的内容和序列数据之间出现了一些不一致之处.例如,我在周期t和t + 1中具有相同的序列状态;但是,序列索引图在每个周期显示不同的颜色.它们是否应该具有相同的颜色?
I am using the function seqiplot to create a sequence index plot. The problem is that I get some inconsistencies between what is shown on the plot and my sequence data. For example, I have the same sequence state in period t and t+1; however, the sequence index plot shows different colours for each period. Should not they have the same colour?
我怀疑这与我的数据集中的可能状态数有关.有60个不同的州.因此,当我尝试设置配色方案时,会收到以下消息: 在brewer.pal(60,"Accent")中: n太大,允许调色板Accent的最大值为8 用多种颜色返回您要的调色板
I suspect that it has to do with the number of posible states in my data set. There are 60 different states. So when I try to set the colour scheme I get this message: In brewer.pal(60, "Accent") : n too large, allowed maximum for palette Accent is 8 Returning the palette you asked for with that many colors
表明Accent最多有8种颜色(不是吗?).
which indicates that Accent has a maximum of 8 colours (isn't it?).
有人有类似的问题吗?我该如何解决?
Has anyone had a similar problem? How can I fix it?
此致
Francisco.
Francisco.
TraMineR
使用的默认调色板最多可以获取12种不同的颜色,这显然不足以满足您的要求.因此,您必须使用seqdef
中的cpal
参数指定调色板. colorspace
软件包提供了获取12种以上颜色的功能.
The default color palette used by TraMineR
can get a maximum of 12 different colors, which is clearly insufficient in your case. Hence, you have to specify the color palette using the cpal
argument in seqdef
. The colorspace
package provides functions to get more than 12 colors.
要使用图形界面选择60种颜色,请执行以下操作:
To choose your 60 colors using a graphical interface:
library(colorspace)
pal <- choose_palette()
seqdef(..., cpal=pal)
或者要自动获取颜色列表,请尝试
Or to automatically get a list of colors, try
library(colorspace)
pal <- diverge_hcl(60)
seqdef(..., cpal=pal)
有关更多选项,请参见?diverge_hcl
.
See ?diverge_hcl
for more options.
希望这会有所帮助.