• Register
1 vote
1.7k views

Problem :

I am very new to R programming. Currently I am learning R programming.

I have below two tables I have asembled them via cbind().

My first Table table_alpha is as below:

  x1                 col1_x1       col2_x1      
A "1999 12 01 00:00" "        0.4" "          0"
B "1999 12 02 00:00" "       -0.5" "          0"
C "1999 12 03 00:00" "       -0.2" "          0"
D "1999 12 04 00:00" "         -1" "        0.1"
E "1999 12 05 00:00" "       -0.9" "          0"
F "1999 12 06 00:00" "        3.7" "        4.1"

My second Table table_num is as below

     x2                 col1_x2       col2_x2      
[1,] "1999 12 01 00:00" "        0.4" "          0"
[2,] "1999 12 03 00:00" "       -0.2" "          0"
[3,] "1999 12 04 00:00" "         -1" "        0.1"
[4,] "1999 12 05 00:00" "       -0.9" "          0"
[5,] "1999 12 06 00:00" "        3.7" "        4.1"
[6,] "1999 12 07 00:00" "          7" "        5.8"

Please find below my merge command:

exporttab <- merge(x=table_alpha,y= table_num,by.x= table_alpha[,1],by.y= table_num[,1], fill=-9999)

Please find below the error:

“Error in fix.by(by.x, x) : 'by' must specify uniquely valid columns”.
8 5 2
3,230 points

Please log in or register to answer this question.

1 Answer

1 vote

Solution :

I had also faced the same error with my below code:
m1 <- merge(x=itcompanies, y=itrounds2, by.x=itcompanies$permalink, by.y=itrounds2$company_permalink, all.y=TRUE)
The same error as below:
# Error in fix.by(by.x, x) : 'by' must specify uniquely valid columns
But now I have the solution which really worked for me is the right outer join
m1 <- merge(x=itcompanies, y=itrounds2, by.x=c("permalink"), by.y=c("company_permalink"), all.y=TRUE)

Hope it will work for you too.

8 4
5,680 points
Si se solucionó, no se me habría ocurrido, gracias

Related questions

0 votes
1 answer 868 views
868 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
0 votes
2 answers 160 views
160 views
Problem : I am stuck because of following weired error error in sort.list(y) : 'x' must be atomic for 'sort.list' have you called 'sort' on a list?
asked Nov 15, 2019 peterlaw 6.9k points
0 votes
1 answer 138 views
0 votes
1 answer 115 views
0 votes
2 answers 510 views
510 views
Problem : I am trying to do data manipulation using R. I am trying to import the file which is having headings and also numbers in the multiple columns. I am trying to divide my values in the one column by the other column and then trying to determine the highest values. But ... below error &ldquo;Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) : 'x' must be atomic&rdquo;.
asked Feb 17, 2020 mphil 2.3k points
0 votes
2 answers 1.5K views
1.5K 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
2 answers 3.2K views
3.2K views
Problem : On the branch I had some files in the .gitignore On the different branch those files are not. I am trying to merge the different branch into my branch, and I don't bother if those files are no longer overlooked or not. Unfortunately I get below ... by merge&rdquo; How should I modify the pull command to overwrite those files, without needing to find, move or delete those files by myself?
asked Jan 6, 2020 alecxe 7.5k points
1 vote
2 answers 1.9K views
1.9K views
Problem : On the branch which I had some of my files in .gitignore On the different branch those files are not present. So I want to merge the different branch into my branch and I really do not care about those files if they are no longer ignored or not. But ... by merge How can I modify the pull command to overwrite the files, without me needing to find, move or delete the files by myself?
asked Dec 27, 2019 alecxe 7.5k points
0 votes
1 answer 2.3K views
2.3K views
Problem : Please have a look at the below date related error : $ R --vanilla > as.Date("09 Jan 2019") Error in charToDate(x) : character string is not in a standard unambiguous format But that date is clearly in the correct standard unambiguous format. So why am I facing ... and without any warning or error and then read very incorrectly! As shown below: > as.Date("01/01/2000") [1] "0001-01-20"
asked Dec 21, 2019 alecxe 7.5k points
0 votes
1 answer 2.1K views
2.1K 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