• Register
0 votes
76 views

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

Please log in or register to answer this question.

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 333 views
333 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
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 14k points
0 votes
1 answer 43 views
43 views
problem Missing values are not allowed in subscripted assignments of data frames.
asked Feb 9 charles mathews 5.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 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
1 answer 2.6K views
2.6K 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 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
0 votes
1 answer 2 views
2 views
Problem: How to remove rows with all or some NAs (missing values) in data frame. PLease help me. I am stuck.
asked Apr 3 Sana8989 8.9k points
0 votes
1 answer 5 views
5 views
Problem: I have a data.frame whose class column is Factor. I'd like to convert it to numeric so that I can use a correlation matrix. How can I convert a Factor column to a numeric column?
asked Mar 30 ummesalma 25.2k points
1 vote
1 answer 5 views
5 views
Problem: I&rsquo;m new in data frame. I am doing a relatively simple piece of analysis which I have put into a function, on all the files in a particular folder. I was wondering whether anyone had any tips to help me automate the process on a number of different folders. Firstly, I was wondering whether there ... <- data.frame(A = c(4,2,6,8,1,0),B = (c(3,1,9,11,2,16))) Please help me to fix this.
asked Mar 10 Shovo210 14k points