• Register
0 votes
325 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

Please log in or register to answer this question.

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 73 views
73 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
1 answer 4 views
4 views
Problem: Any solution for this error: Error in aggregate.data.frame(as.data.frame(x), ...) : arguments must have same length
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
2 answers 1.8K views
1.8K 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
1 vote
1 answer 5 views
5 views
Problem: Recently, I&rsquo;m working on Data Frame. I have created a data frame named z. a = c(1,1,1); b = c(2,2,2); c = c(3,3,3); d = c(4,4,4); z = data.frame(a,b,c,d); I want to remove column c and d from data frame z. I tried this code p = subset(z ... result a b c d 1 2 3 4 1 2 3 4 What changes should i make in this command to remove column c and d from z. Please help me to fix this. Thanks.
asked Mar 10 Shovo210 13.2k points
0 votes
1 answer 2.5K views
2.5K 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 1.6K views
1.6K 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
1 answer 3 views
3 views
Problem: i don&rsquo;t understand this problem. please help me? names' attribute [2] must be the same length as the vector [1]
asked 1 day ago Rohit kr 15k points
1 vote
1 answer 1.2K views
1.2K views
Problem: I have limited knowledge of R and ggplot. I have recently written a function and trying to run the function as shown below: ggplot(datfr, aes(x = dat1[1:951,], y = dat2[1:951,])) + geom_point() After executing above function I am facing below error: Don't ... and when I try to use nrow on my two datasets it again returns the same number of rows. How can I fix above ggplot related error.
asked May 26, 2020 Martin K 6.6k points
0 votes
1 answer 4 views
4 views
Problem: Please help me &hellip; how can I solve it? error in .call.graphics(c_palette, value) : invalid graphics state
asked Mar 31 Ifra 24.4k points
0 votes
1 answer 16 views
16 views
Problem: How should I fix this issue: Error in eval(predvars, data, env) : invalid 'envir' argument of type 'character'.
asked Mar 14 Wafa Abu Yousef 6.1k points