序列和seqiplot之间不一致 [英] Inconsistency between sequences and seqiplot

查看:209
本文介绍了序列和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.

希望这会有所帮助.

这篇关于序列和seqiplot之间不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆