[Traminer-users] change order of states in seqdplot but keep colors assigned to each state the same

Karina Videgain karvidegain at hotmail.com
Wed Jul 27 22:21:24 CEST 2016


Hi,


 you can use this function:


Example

Names of sequence object: EL.seq


cpal(EL.seq) <- c("grey67","violetred4", "violetred3", "darkmagenta", "palevioletred1", "rosybrown1")


The list of colour has to be in the same order of the states.


I am always sending a pdf with the colours in R and their names.


I hope it will be usefull for you


Kar


________________________________
De: traminer-users-bounces at lists.r-forge.r-project.org <traminer-users-bounces at lists.r-forge.r-project.org> en nombre de Jeremy Reynolds <jeremyr at uga.edu>
Enviado: miércoles, 20 de julio de 2016 11:30 a. m.
Para: traminer-users at lists.r-forge.r-project.org
Asunto: [Traminer-users] change order of states in seqdplot but keep colors assigned to each state the same

Hi All,

I have created a plot using seqdplot using the default color scheme called "Accent."

I would like to change the order in which the states are plotted but keep the colors assigned to each state the same.

In the example below, for instance, how could I have "employment" stay green but have it plotted at the top of the graph and have "further education" remain purple  but have it plotted between the red and blue states.

data(mvad)
mvad.labels <- c("employment", "further education", "higher education", "joblessness", "school", "training")
mvad.seq <- seqdef(mvad, 15:86, labels = mvad.labels, xtstep = 6)
seqdplot(mvad.seq, border = NA)

I know that changing the order of the states in the variables used to make the sequence object will change the order in which they are plotted, so that is a good start, but I am not sure how to keep the color associated with each state the same after the re-ordering.  Perhaps the solution is to create a custom color palette with the same colors as the "Accent" color palette, but I cannot seem to figure out the names of the colors used in that palette.

Any tips would be appreciated.

Thanks,

Jeremy






--
********************
Dr. Jeremy Reynolds
Professor
Department of Sociology
116 Baldwin Hall
University of Georgia
Athens, GA 30602-1611
Phone: (706) 583-8072
Web: http://uga.edu/soc/people/faculty/reynolds_jeremy.php
Fax: (706) 542-4320
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20160727/804d1ed2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: colores en R.pdf
Type: application/pdf
Size: 41486 bytes
Desc: colores en R.pdf
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20160727/804d1ed2/attachment-0001.pdf>


More information about the Traminer-users mailing list