<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Hadrien,<br>
<br>
- Are you sure that the length of the variable CLUSTER is the same
as the number of rows in you complete sequence object ?<br>
<br>
> length(my.data$CLUSTER)<br>
> nrow(<span class="GD40030CCR ace_keyword" style="color: blue;">stsNWObject</span><span
class="Apple-style-span" style="border-collapse: separate; color:
rgb(0, 0, 0); font-family: Arial; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
font-size: medium;"><span class="Apple-style-span"
style="font-family: Monospace; font-size: 13px; line-height:
17px; white-space: pre-wrap;"></span></span><span
class="Apple-style-span" style="border-collapse: separate; color:
rgb(0, 0, 0); font-family: Arial; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
font-size: medium;"><span class="Apple-style-span"
style="font-family: Monospace; font-size: 13px; line-height:
17px; white-space: pre-wrap;"></span></span>)<br>
<br>
- Do you have a NA for some row in the CLUSTER variable ?<br>
<br>
> any(is.na(my.data$CLUSTER))<br>
<br>
Alexis<br>
<br>
Le 15. 03. 12 18:53, Hadrien Commenges a écrit :
<blockquote cite="mid:b76e0518-bc49-4831-977a-e694e5a656dd@clara"
type="cite">
<style type="text/css">p { margin: 0; }</style>
<div style="font-family: Arial, Helvetica, sans-serif; font-size:
12pt; color: #000000">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.<br>
<br>
<hr id="zwchr">
<div
style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De:
</b>"Alexis Gabadinho" <a class="moz-txt-link-rfc2396E" href="mailto:Alexis.Gabadinho@unige.ch"><Alexis.Gabadinho@unige.ch></a><br>
<b>À: </b><a class="moz-txt-link-abbreviated" href="mailto:traminer-users@r-forge.wu-wien.ac.at">traminer-users@r-forge.wu-wien.ac.at</a><br>
<b>Envoyé: </b>Jeudi 15 Mars 2012 18:44:27<br>
<b>Objet: </b>Re: [Traminer-users] error splitting sts Object<br>
<br>
Hi Adrien,<br>
<br>
I see <span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: Arial;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
font-size: medium;"><span class="Apple-style-span"
style="font-family: Monospace; font-size: 13px;
line-height: 17px; white-space: pre-wrap;">
<pre class="GD40030CLR" style="font-family: Monospace; font-size: 10pt ! important; outline-style: none; border-style: none; white-space: pre-wrap ! important; margin: 0px; line-height: 1.3;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: Monospace; font-size: 13px; line-height: 17px; white-space: pre-wrap;"><pre class="GD40030CLR" style="font-family: Monospace; font-size: 10pt ! important; outline-style: none; border-style: none; white-space: pre-wrap ! important; margin: 0px; line-height: 1.3;"><span class="GD40030CCR ace_keyword" style="color: blue;">stsNWObject[</span><span class="GD40030CCR ace_keyword" style="color: blue;
">stsNWObject</span><span class="GD40030CCR ace_keyword" style="color: blue;">$CLUSTER==1, ]</span><span class="GD40030CCR ace_keyword" style="color: blue;"></span>
</pre></span></span></pre>
</span></span><br>
in your code, while <span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: Arial; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="font-family: Monospace;
font-size: 13px; line-height: 17px; white-space:
pre-wrap;">
<pre class="GD40030CLR" style="font-family: Monospace; font-size: 10pt ! important; outline-style: none; border-style: none; white-space: pre-wrap ! important; margin: 0px; line-height: 1.3;"><span class="GD40030CCR ace_keyword" style="color: blue;">stsNWObject</span></pre>
</span></span><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: Arial; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="font-family: Monospace;
font-size: 13px; line-height: 17px; white-space:
pre-wrap;"></span></span><br>
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.<br>
<br>
All the best,<br>
Alexis.<br>
<br>
Le 15. 03. 12 18:10, Hadrien Commenges a écrit :
<blockquote
cite="mid:e0fc2141-a3de-45a9-b07c-1adf251d95d8@clara">
<style>p { margin: 0; }</style>
<div style="font-family: Arial,Helvetica,sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">Hi,<br>
<br>
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.<br>
<br>
Here is the summary of the big sts object:<br>
<br>
<span class="Apple-style-span" style="border-collapse:
separate; color: rgb(0, 0, 0); font-family: Arial;
font-style: normal; font-variant: normal; font-weight:
normal; letter-spacing: normal; line-height: normal;
orphans: 2; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
font-size: medium;"><span class="Apple-style-span"
style="font-family: Monospace; font-size: 13px;
line-height: 17px; white-space: pre-wrap;">
<pre class="GD40030CLR" style="font-family: Monospace; font-size: 10pt ! important; outline-style: none; border-style: none; white-space: pre-wrap ! important; margin: 0px; line-height: 1.3;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: Monospace; font-size: 13px; line-height: 17px; white-space: pre-wrap;"><pre class="GD40030CLR" style="font-family: Monospace; font-size: 10pt ! important; outline-style: none; border-style: none; white-space: pre-wrap ! important; margin: 0px; line-height: 1.3;"><span class="GD40030COR ace_keyword" style="white-space: pre; color: blue;">> </span><span class="GD40030C
CR ace_keyword" style="color: blue;">summary(stsNWObject)
</span> [>] 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: * </pre></span></span>
And here is how I create the splitted object and the error I get:
</pre>
</span></span><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: Arial; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="font-family:
Monospace; font-size: 13px; line-height: 17px;
white-space: pre-wrap;">
<pre class="GD40030CLR" style="font-family: Monospace; font-size: 10pt ! important; outline-style: none; border-style: none; white-space: pre-wrap ! important; margin: 0px; line-height: 1.3;"><span class="GD40030COR ace_keyword" style="white-space: pre; color: blue;">> </span><span class="GD40030CCR ace_keyword" style="color: blue;">stsNWObject1 <- stsNWObject[</span><span class="GD40030CCR ace_keyword" style="color: blue;">stsNWObject</span><span class="GD40030CCR ace_keyword" style="color: blue;">$CLUSTER==1, ]
</span><span class="GD40030COR ace_keyword" style="white-space: pre; color: blue;">> </span><span class="GD40030CCR ace_keyword" style="color: blue;">summary(stsNWObject1)
</span> [>] 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
<span class="GD40030CGR">Error in if (any(object == nr)) { : missing value where TRUE/FALSE needed
</span>Could anyone help me to understand and resolve this error.
Thanks,
Hadrien<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: Monospace; font-size: 13px; line-height: 17px; white-space: pre-wrap;"></span></span></pre>
</span></span></div>
<pre><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Traminer-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Traminer-users@lists.r-forge.r-project.org" target="_blank">Traminer-users@lists.r-forge.r-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a>
</pre>
</blockquote>
<br>
<br>
_______________________________________________<br>
Traminer-users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a><br>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a></div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Traminer-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a>
</pre>
</blockquote>
<br>
</body>
</html>