• Register
0 votes

Problem :

Getting following error related to r
error in `row.names<-.data.frame`(`*tmp*`, value = value) : duplicate 'row.names' are not allowed
6 5 3
6,930 points

1 Answer

0 votes

Solution :

You can probably use make.names(..., unique = TRUE) to get your unique row names

rownames(diasyhoras2) <- make.names(diasyhoras[,1], unique = TRUE)

Following is the quick example of what will happen to the names ...

rep(month.abb[1:2], 3)
# [1] "Jan" "Feb" "Jan" "Feb" "Jan" "Feb"
make.names(rep(month.abb[1:2], 3), unique = TRUE)
# [1] "Jan"   "Feb"   "Jan.1" "Feb.1" "Jan.2" "Feb.2"
If you follow above approch your issue will be resolved.
9 7 4
38,600 points

Related questions

0 votes
1 answer 138 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. ... tried running it after re-labeling the states without "-", but it does not affect the error. Does someone knows what causes this error?
asked Dec 6, 2019 alecxe 7.5k points
0 votes
1 answer 964 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 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
2 answers 862 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 444 views
Problem : I am trying to merge data in R but facing following error error in fix.by(by.x, x) : 'by' must specify one or more columns as numbers, names or logical
asked Nov 15, 2019 peterlaw 6.9k points