I have a data frame with payments data. I have the e-mail and the ip of the user who is making a transaction. I want to analyze the users who are trying to pay multiple times with the same e-mail but different IPs the two columns that I need from the main report are this:
| IP | shopper_email |
|-----------------|---------------------|
| 61.184.172.226 | test@gmail.com |
| 61.184.172.226 | test@gmail.com |
| 61.184.172.226 | test@gmail.com |
| 204.171.147.183 | test@gmail.com |
| 7.53.60.110 | shopper@shopper.com |
| 184.64.255.108 | hello@cloud.com |
I would like to make a new column with a value that I could use as key to extrapolate the users that changed ips with something like this
| IP | shopper_email | change_ip |
|-----------------|---------------------|-----------|
| 61.184.172.226 | test@gmail.com | yes |
| 61.184.172.226 | test@gmail.com | yes |
| 61.184.172.226 | test@gmail.com | yes |
| 204.171.147.183 | test@gmail.com | yes |
| 7.53.60.110 | shopper@shopper.com | no |
| 184.64.255.108 | hello@cloud.com | no |
I was thinking about a loop but maybe there's a simpler way to do this any suggestion?
like a combination with paste and match
dataf <- dataf %>% unite("change_ip", ip:shopper_mail)