[Traminer-users] subsetting a sequence object

Gilbert Ritschard Gilbert.Ritschard at unige.ch
Mon Jun 12 08:44:01 CEST 2017


Hi Jeremy,

Seems that you try to group according to a variable with a single value ("2611"). Did you try to drop the group argument from you seqIplot command?

Best.
gilbert

From: traminer-users-bounces at lists.r-forge.r-project.org [mailto:traminer-users-bounces at lists.r-forge.r-project.org] On Behalf Of Reynolds, Jeremy E
Sent: dimanche 28 mai 2017 18:25
To: Users questions <traminer-users at lists.r-forge.r-project.org>
Subject: [Traminer-users] subsetting a sequence object

Dear Traminer Users,

I am trying to create a sequence index plot for a subset of the cases in a sequence object.  I followed the example at the link below, but I get an error message about missing values.  I can try to make an example with the mvad data if needed, but I am hoping the output below might be enough for someone to give me a tip.

Thanks,

Jeremy

https://stackoverflow.com/questions/13922750/how-to-create-sequence-index-plots-of-a-subset-of-groups-in-a-sequence-object

txt> subset <- bhps.m$lcs6c_m %in% c("2611")
txt> table(subset)
subset
FALSE  TRUE
61031 23119

txt>library(summarytools)

txt> freq(men.match$lcs6c_m)



Frequencies



Dataframe name: men.match

 Variable name: lcs6c_m



                N   %Valid   %Cum.Valid   %Total   %Cum.Total

----------- ----- -------- ------------ -------- ------------

       1024     0        0            0        0            0

       2296     0        0            0        0            0

       2611 23119      100          100      100          100

       2849     0        0          100        0          100

       3876     0        0          100        0          100

       5479     0        0          100        0          100

       <NA>     0       NA           NA        0          100

      Total 23119      100          100      100          100


txt> seqIplot(seq.m[subset, ], group=bhps.m$lcs6c_m[subset])
Error in if (any(x == nr)) { : missing value where TRUE/FALSE needed

____________________________________
Dr. Jeremy Reynolds
Professor
309 Stone Hall
Department of Sociology
700 W. State Street
Purdue University
West Lafayette, IN 47907
Phone: (765) 496-3348<tel:%28765%29%20496-3348> https://www.cla.purdue.edu/sociology/directory/index.aspx?p=Jeremy_Reynolds

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20170612/89d4786d/attachment.html>


More information about the Traminer-users mailing list