R/symdiff.R

Defines functions symdiff

Documented in symdiff

#' Calculates symmetric set difference between two sets.
#'
#' @param x [\code{vector}]\cr
#'   Set 1.
#' @param y [\code{vector}]\cr
#'   Set 2.
#' @return [\code{vector}].
#' @export
symdiff = function(x, y) {
  setdiff(union(x, y), intersect(x, y))
}

Try the BBmisc package in your browser

Any scripts or data that you put into this service are public.

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.