I have a field that I need to run multiple conidtional statements (if/else) based on a group_by function with SERIAL being the group by. I want to create a new field that is added to df with the mutate() function.
Summary of data:
SERIAL INSTALLSITE_CONTRACT_PARTY_NUM INSTALLSITEDUNS_CONTRACT_POD INSTALLSITEPOD_CONTRACT_POD percent_dist
1: ZKZYKBAI MATCH MISMATCH MATCH 0
2: ZLLEJUWA MATCH MISMATCH MATCH 0
3: ZICZVXYG MATCH MATCH MATCH 0
4: ZXQPVFHB MATCH MATCH MATCH 0
5: ZLIUJARF MATCH MATCH MATCH 0
6: ZCUXHMIE MATCH MATCH MATCH 0
I need to write if the matches are equal or not - IF 'INSTALLSITE_CONTRACT_PARTY_NUM' = 'MATCH' & 'INSTALLSITEDUNS_CONTRACT_POD' = 'MATCH' & INSTALLSITEPOD_CONTRACT_POD = 'MATCH' & percent_dist <= 0 THEN 'ACCURATE'...
There are multiple conditions that looks like above but I wanted to get an idea of how I can use this approach in R.