getVennRegion: Gets a list of the elements in a region of the diagram

View source: R/RcppExports.R

getVennRegionR Documentation

Gets a list of the elements in a region of the diagram

Description

Gets a list of the elements in a region of the diagram

Usage

getVennRegion(nVennObj, n)

Arguments

nVennObj

nVennR2 object generated with nVennDiagram().

n

Region, either as an integer or as a vector of set names. See Details

Details

An integer expresses a region by considering its binary representation in reverse. A 1 in a position means "belongs to" and a 0 or empty position means "does not belong to". Thus, the binary representation of 19 (10011), read from right to left, means "region that belongs to sets 1, 2 and 5 and does not belong to any other set".

A vector of set names expresses a region by giving the sets the region belongs to. It is understood that the region does not belong to any other set.

Value

List of set names.

Examples

myv <- nVennDiagram(list(Set1=c("a", "b", "c"), Set2=c("a", "c", "d")), verbose=FALSE)
#Both commands are equivalent:
getVennRegion(myv, 3)
getVennRegion(myv, c("Set1", "Set2"))

nVennR2 documentation built on July 14, 2026, 1:09 a.m.