[Traminer-users] Error message with SPELL, R hangs with TSE

Camillia Matuk camillia.matuk at gmail.com
Sat Apr 7 21:24:56 CEST 2012


Hello,

I'm having problems getting started with my data, and am very new to both R
and to TraMineR. I hope someone can help.

Relevant columns in my csv file are WorkgroupID (e.g., 65472), Start and
Stop times (e.g., 11/28/11 9:37 AM), and StepNumber (e.g., "4.5").

After reading in my data, this is what I did:

> WorkgroupID_factor <- factor(d$WorkgroupID)
> StepNumber_factor <- factor(d$StepNumber)
> d <- data.frame(d, WorkgroupID_factor, StepNumber_factor)

I figured I should treat this as SPELL formatted data, so I did this:

> d.labels <- seqstatl(d$StepNumber_factor)
> d.states <- 1:length(d.labels)

But I get error messages when I do this:
> d.seq <- seqdef(d, var = c("WorkgroupID_factor", "StartTime", "StopTime",
"StepNumber_factor"), informat = "SPELL", states = d.states, labels =
d.labels, process = FALSE)

Error in Summary.factor(c(NA_integer_, NA_integer_, NA_integer_,
NA_integer_,  :
  min not meaningful for factors
In addition: Warning messages:
1: In Ops.factor(begincolumn, 1) : < not meaningful for factors
2: In Ops.factor(endcolumn, begincolumn) : - not meaningful for factors
3: In Ops.factor(begincolumn, 0) : > not meaningful for factors

Abandoning that, I then tried treating my data as though it were in TSE
format. I'm not sure if that's proper thing to do...
d.seqe <- seqecreate(id = d$WorkgroupID_factor, timestamp = d$StartTime,
event = d$StepNumber_factor)

This works, although I'm still unsure about how to read it:
> print(d.seqe[2]) #Displays the sequence of events
[1]
67.00-(1.1)-2.00-(1.2)-3.00-(1.3)-3.00-(1.4)-2.00-(1.5)-2.00-(1.4)-3.00-(1.5,1.5,1.6)-198.00-(1.6)-1.00-(1.5,1.5,1.6)-1.00-(1.4,1.4,1.5)-2.00-(2.1,2.3)-4.00-(2.3,2.3)-1.00-(2.3,2.3,2.3,2.4)-1.00-(2.3,2.3,2.4)-3.00-(2.3,2.3)-3.00-(2.3)-7.00-(2.3,2.4)-9.00-(2.3,2.4,2.4)-167.00-(2.4,2.4,2.5,2.6)-(...)

But when I run this command, R hangs and I have to force quit and restart:
d.fsubseq <- seqefsub(d.seqe, minSupport = 50)


I hope someone can point out what I'm doing wrong. Thanks for any
assistance!

-- 
Camillia

http://sites.google.com/site/cfmatuk/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20120407/4abed0d0/attachment.html>


More information about the Traminer-users mailing list