[Traminer-users] error splitting sts Object

Hadrien Commenges hc at parisgeo.cnrs.fr
Thu Mar 15 18:53:31 CET 2012


Sorry, I've changed the name after copying the code and I made a mistake. But CLUSTER is, as you say, a variable of a separate dataframe, and I know there's no problem with this variable because I can use it with the "group=" function. So the error lies in elsewhere. 

----- Mail original -----

De: "Alexis Gabadinho" <Alexis.Gabadinho at unige.ch> 
À: traminer-users at r-forge.wu-wien.ac.at 
Envoyé: Jeudi 15 Mars 2012 18:44:27 
Objet: Re: [Traminer-users] error splitting sts Object 

Hi Adrien, 

I see stsNWObject[ stsNWObject $CLUSTER==1, ] 
in your code, while stsNWObject 
is the name of your sequence object. What have you done to add a variable containing group membership to your sequence object? I am pretty sure that the error lies in this step. The vector containing group membership information should be a standalone vector and should by no way be added as a further column to your sequence object. 

All the best, 
Alexis. 

Le 15. 03. 12 18:10, Hadrien Commenges a écrit : 


Hi, 

I've created a sts object with the seqdef function and I'd like to split this object by a factor (cluster). I canuse some functions with the "group=" option, but I need to work with smaller objects and I really want to split the big sts object into several ones. When I split this object I get an error and I can't compute or plot anything with the splitted object. 

Here is the summary of the big sts object: 

> summary(stsNWObject) [>] sequence object created with TraMineR version 1.8-1 
 [>] 22064 sequences in the data set, 19745 unique 
 [>] min/max sequence length: 288/288
 [>] alphabet (state labels):  
     1=Hout (Home outside)
     2=Ad (Adjacent)
     3=Ne (Near)
     4=Fa (Far)
     5=Hoho (Home home)
     6=Tr (Trip)
 [>] dimensionality of the sequence space: 1440 
 [>] colors: 1=#A1D99B 2=#41AB5D 3=#006D2C 4=#00441B 5=#E5F5E0 6=#000000 
 [>] symbol for missing state: * And here is how I create the splitted object and the error I get: > stsNWObject1 <- stsNWObject[ stsNWObject $CLUSTER==1, ] > summary(stsNWObject1) [>] sequence object created with TraMineR version 1.8-1 
 [>] 7862 sequences in the data set, 6438 unique 
 [>] min/max sequence length: 288/288
 [>] alphabet (state labels):  
     1=Hout (Home outside)
     2=Ad (Adjacent)
     3=Ne (Near)
     4=Fa (Far)
     5=Hoho (Home home)
     6=Tr (Trip)
 [>] dimensionality of the sequence space: 1440 
 [>] colors: 1=#A1D99B 2=#41AB5D 3=#006D2C 4=#00441B 5=#E5F5E0 6=#000000 Error in if (any(object == nr)) { : missing value where TRUE/FALSE needed Could anyone help me to understand and resolve this error.

Thanks, 

Hadrien _______________________________________________
Traminer-users mailing list Traminer-users at lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users 



_______________________________________________ 
Traminer-users mailing list 
Traminer-users at lists.r-forge.r-project.org 
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20120315/5e220fbb/attachment-0001.html>


More information about the Traminer-users mailing list