From arnaud_trolle at yahoo.fr Fri Jul 8 11:24:03 2016 From: arnaud_trolle at yahoo.fr (=?UTF-8?Q?Arnaud_Troll=C3=A9?=) Date: Fri, 8 Jul 2016 09:24:03 +0000 (UTC) Subject: [Traminer-users] Error when using "seqfplot" with a grouping variable References: <1531481641.6463151.1467969843425.JavaMail.yahoo.ref@mail.yahoo.com> Message-ID: <1531481641.6463151.1467969843425.JavaMail.yahoo@mail.yahoo.com> Hi, I'm facing an error message when using the "seqfplot" function with the parameter "group" : "Error in if (any(x == nr)) { : missing value where TRUE/FALSE needed". My grouping variable comes from a cluster analysis I previously carried out (using "agnes").I could see a previous discussion (in 2012) where possible causes for this error were mentioned :http://lists.r-forge.r-project.org/pipermail/traminer-users/2012-March/000101.html Unfortunately, I checked everything, i.e. I do not have any NA and the length of my grouping variable is the same as the number of rows in my sequence object, but I still have this error message. Here is a part of my code :?contrat.om <- seqdist(contrat.seq, method = "OM", indel = 1, sm ="TRATE")contrat.ward <- agnes(contrat.om, diss = TRUE, method = "ward") contrat.cl4 <- cutree(contrat.ward, k = 4)cl4.contrat.lab <- factor(contrat.cl4, labels = paste("Cluster",1:4))any(is.na(cl4.contrat.lab))x11() seqfplot(contrat.seq, group = cl4.contrat.lab, border = NA, cex.legend = 0.6, xtlab = c("2013","2016")) I do not see the reason why I get this error. Thank you in advance for your help. Kind regards,Arnaud. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremyr at uga.edu Wed Jul 20 18:30:56 2016 From: jeremyr at uga.edu (Jeremy Reynolds) Date: Wed, 20 Jul 2016 12:30:56 -0400 Subject: [Traminer-users] change order of states in seqdplot but keep colors assigned to each state the same Message-ID: 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: From karvidegain at hotmail.com Wed Jul 27 22:21:24 2016 From: karvidegain at hotmail.com (Karina Videgain) Date: Wed, 27 Jul 2016 20:21:24 +0000 Subject: [Traminer-users] change order of states in seqdplot but keep colors assigned to each state the same In-Reply-To: References: Message-ID: 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 en nombre de Jeremy Reynolds 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: -------------- 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: