R/vsetequal.R

Defines functions vsetequal

Documented in vsetequal

vsetequal <-
function (x, y, multiple=TRUE) {
    x <- as.vector(x)
    y <- as.vector(y)
	if(!multiple) {
		all(c(match(x, y, 0L) > 0L, match(y, x, 0L) > 0L))
	} else {
	# Can get away with this 'cause set theory doesn't "allow" floats
		length(x) == length(y) && identical(sort(x), sort(y))
	}
}

Try the vecsets package in your browser

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

vecsets documentation built on Jan. 20, 2018, 9:05 a.m.