I know how to do this in excel, but am trying to translate into R and create a new column. In R I have a data frame called CleanData. I want to see how many times the value in each row of column A shows up in all of column B. In excel it would read like this:
=COUNTIF(B:B,A2)>0,C="Purple")
The second portion would be a next if / and statement. It would look like this in excel:
=IF(AND(COUNTIF(B:B,A2)>0,C="Purple"),"Yes", "No")
Anyone know where to start?
I have tried mutating and also this:
sum(CleanData$colA == CleanData$colB)
and am getting no values