• Register
0 votes
130 views

Problem :

I want to use the TraMineR's (version 1.8.4) seqdef-funciton to define the sequence object, however I always face the following error message which is completely senseless to me:

Error in row.names<-.data.frame(*tmp*, value = value) : invalid 'row.names' length

My code input is as follows:

sample.sts <- seqdef(sample, var=d("jan2005", "feb2005", "mar2005", "apr2005", "may2005", 
"jun2005", "jul2005", "aug2005", "sep2005", "oct2005", "nov2005", "dec2005"),  
alphabet=d("Employee (full-time)", "Employee (part-time)", 
"Self-employed (full-time)", "Self-employed (part-time)", "unemployed", "Retired", 
"Student", "Other inactive", "Compulsory military service"), 
states=d("EF", "EP", "SF", "SP", "UE", "RE", "ST", "IA", "MS"), id="pidc")

 

The whole output says:

[>] 3266 sequences in the data set
[>] min/max sequence length: 12/12
Fehler in row.names<-.data.frame(*tmp*, value = value) :
invalid 'row.names' length

I again tried running it after re-labeling the states without "-", but it does not affect the error. Does someone knows what causes this error?

6 5 3
7,540 points

1 Answer

0 votes

Solution :

The "id" argument of seqdef should be the vector containing only one entry per sequences (e.g. The length of id vector should be equal to the number of sequences). You should try using id=as.character(sample$pid) Or you can also try id=sample$pid but without as.character

I can see that there are some mismatch between the states in the data and the alphabet argument since the "-" was replaced by ".". Now you should probably try to change the alphabet argument

9 7 4
38,600 points

Related questions

0 votes
1 answer 55 views
55 views
Problem : Getting following error related to r error in `row.names<-.data.frame`(`*tmp*`, value = value) : duplicate 'row.names' are not allowed
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
2 answers 832 views
832 views
Problem : I am facing below error and I am unable to understand the meaning of the error. All my variable names are correct and there are no typing errors. Does anybody faced this issue before any solution on it? My erroneous code : datNewagg <- aggregate (dataNew, by = ... mean) It gives following error : Error in aggregate.data.frame(datNew, by = list("x", "y", : arguments must have same length
asked Dec 6, 2019 alecxe 7.5k points
0 votes
1 answer 1.3K views
1.3K views
Problem : I have been facing below error message and traceback: Error in FUN(X[[i]], ...) : only defined on the data frame with all numeric variables 5 stop("only defined on the data frame with all numeric variables") 4 FUN(X[[i]], ...) 3 lapply(args, ... .numeric(data[good,]) But now I get the different error message back as below : "Error: (list) object cannot be coerced to type 'double'"
asked Dec 16, 2019 alecxe 7.5k points
0 votes
1 answer 923 views
923 views
Problem : When ever i use the predict glmnet function i get the below mentioned error error in cbind2(1, newx) %*% nbeta : not-yet-implemented method for <data.frame> %*% <dgcmatrix>
asked Nov 12, 2019 peterlaw 6.9k points
0 votes
2 answers 769 views
769 views
Problem : I am looking for the function with the parameters such as data name as (mydata), factor as (myfactor) and variable names such as (myvar) to dynamically generate the histograms as I have to use them in lattice. I tried to do as mentioned above but error appears ... of type 'character'. I think the program doesn't know where to look for this myf` string. How should I fix this issue?
asked Dec 23, 2019 alecxe 7.5k points