Say I have a dataframe ARAP with columns called CoCd and VendorNo. I want to subset into another dataframe called EMIU_EMIJ all lines for combinations of:
CoCd="EMIJ" & VendorNo = "100010" or CoCd="EMIU" & VendorNo = "2000001" or CoCd="EMIU" & VendorNo = "2000006". How do I combine & and | to select the lines where both combinations are met ? I.e. it needs to pair the CoCd and VendorNo combinations together.
I tried
EMIU_EMIJ<-subset(ARAP,CoCd=="EMIJ"&VendorNo=="100010"| CoCd=="EMIU"&VendorNo=="2000001"| CoCd=="EMIU"&VendorNo=="2000006") I also tried brackets
EMIU_EMIJ<-subset(ARAP, (CoCd=="EMIJ"&VendorNo=="100010")|(CoCd=="EMIU"&VendorNo=="2000001")|(CoCd=="EMIU"&VendorNo=="2000006")) But this created an error:"Error: unexpected symbol in:"EMIU_EMIJ"
How do I subset for 1 of the 3 combinations mentioned above ?
dput)extractof thebasepackage: see the Warning from thesubsetdocumentation.