Searched for help but I'm stumped on this one. I would like to remove the second instance where the names from Name1 and Name2 match regardless of order and the values in column ga are the same. I have included two examples below, one tibble with what I have and one tibble with what I want.
library(tidyverse)
# tibble of data current
have <- tibble(
Name1 = c("Allan", "Allan", "Hanzel", "Prokop",
"Prokop", "Mynio", "Mynio", "Korchinski"),
Name2 = c("Hanzel", "Korchinski", "Allan", "Mynio",
"Korchinski", "Prokop", "Hanzel", "Prokop"),
ga = c(10, 1, 10, 1, 6, 1, 1, 6)
)
# tibble of data after removing second instance where names from
# Name1 and Name2 match regardless of order and values in ga are equal
want <- tibble(
Name1 = c("Allan", "Allan", "Prokop", "Prokop", "Mynio"),
Name2 = c("Hanzel", "Korchinski", "Mynio", "Korchinski", "Hanzel"),
ga = c(10, 1, 1, 6, 1)
)