Re: [R] Merging two data files based on common dates

2016-01-05 Thread William Dunlap via R-help
You did not show the structure of your datasets (with, e.g., dump(c("datafile1","datafile2"),file=stdout())) nor what your call to merge() was. However, it may be that you did not use the by.x and by.y arguments to merge() to specify which columns to match. txt1 <- "date1 xva

Re: [R] Merging two data files based on common dates

2016-01-05 Thread Sarah Goslee
Since the date columns have different names, you need to specify the by.x and by.y arguments to merge(). Other than that, it should work. If you need more help, please use dput() to provide some of your data, and include both the code you used and the error message or incorrect result you got (th

[R] Merging two data files based on common dates

2016-01-05 Thread Santosh.Aryal
Hello there Pardon my ignorance but, I have two data files with different series of dates and x and y values. There are common dates in both files. For example >datafile1 date1 xval 31/12/1982 20 1/01/198330 2/01/198340 3/01/198350 4/