I am trying to merge two datasets
se_lif_1
with columnsSE_NO
andTOT_CV_LIF
ext_merchant_account
with the 76 columns that include:"SE_NO","SEIMS_INDUS_DS_CD","CUR_MER_STA_CD","CLNT_MAN_CHAN_CD","MER_SETUP_DT"
By using below code:
se_lif_2 <- merge(se_lif_1,
ext_merchant_account[(ext_merchant_account$CUR_MER_STA_CD %in%
c("A","R")) & (ext_merchant_account$CLNT_MAN_CHAN_CD %in%
c("I","X", " ")) & (ext_merchant_account$MER_SETUP_DT <
S_date),"SEIMS_INDUS_DS_CD"],by = "SE_NO" )
But was getting below error:
"Error in fix.by(by.y, y) : 'by' must specify a uniquely valid column"
Also S_date
is a object with class "Date" containing a single record which I am using in one of the logical condition to subset the data from ext_merchant_account
data frame.
I also checked the class of the variable in "by", which is same for both the dataset (i.e an integer).
I also tried using by.x
& by.y
but was getting the same error again.Could any one point out the error that I am doing in this code.
Thanks for your help in advance.
Cheers,
Amit