Skip to content
Prev 388825 / 398503 Next

Find "undirected" duplicates in a tibble

Eric,
ah, very nice.  i have trouble remembering, e.g., unique().

fwiw, (hopefully) here's a baser version.
----
  x = data.frame(Source=rep(1:3,4), Target=c(rep(1,3),rep(2,3),rep(3,3),rep(4,3)))

  y <- apply(x, 1, function(y) return (c(A=min(y), B=max(y))))
  unique(t(y))
----

cheers, Greg
Message-ID: <770351.1629468786@apollo2.minshall.org>
In-Reply-To: Your message of "Fri, 20 Aug 2021 16:38:19 +0300." <CAGgJW77TZAE7c4SkNBpmW_GDPJ2FAAd9BRxaMHqkRQqbNeG6zQ@mail.gmail.com>