451 lines
63 KiB
HTML
Raw Normal View History

2025-01-12 00:52:51 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Steffen Möller" />
<meta name="date" content="2024-10-05" />
<title>Venn Diagrams with gplots</title>
<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
// be compatible with the behavior of Pandoc < 2.8).
document.addEventListener('DOMContentLoaded', function(e) {
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
var i, h, a;
for (i = 0; i < hs.length; i++) {
h = hs[i];
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
a = h.attributes;
while (a.length > 0) h.removeAttribute(a[0].name);
}
});
</script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; }
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.at { color: #7d9029; }
code span.bn { color: #40a070; }
code span.bu { color: #008000; }
code span.cf { color: #007020; font-weight: bold; }
code span.ch { color: #4070a0; }
code span.cn { color: #880000; }
code span.co { color: #60a0b0; font-style: italic; }
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.do { color: #ba2121; font-style: italic; }
code span.dt { color: #902000; }
code span.dv { color: #40a070; }
code span.er { color: #ff0000; font-weight: bold; }
code span.ex { }
code span.fl { color: #40a070; }
code span.fu { color: #06287e; }
code span.im { color: #008000; font-weight: bold; }
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; }
code span.kw { color: #007020; font-weight: bold; }
code span.op { color: #666666; }
code span.ot { color: #007020; }
code span.pp { color: #bc7a00; }
code span.sc { color: #4070a0; }
code span.ss { color: #bb6688; }
code span.st { color: #4070a0; }
code span.va { color: #19177c; }
code span.vs { color: #4070a0; }
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; }
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap;
}
pre {
border-radius: 3px;
margin: 5px 0px 10px 0px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border: 1px solid #DDDDDD;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }
code > span.kw { color: #555; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #d14; }
code > span.fl { color: #d14; }
code > span.ch { color: #d14; }
code > span.st { color: #d14; }
code > span.co { color: #888888; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #900; font-weight: bold; }
code > span.er { color: #a61717; background-color: #e3d2d2; }
</style>
</head>
<body>
<h1 class="title toc-ignore">Venn Diagrams with <code>gplots</code></h1>
<h4 class="author">Steffen Möller</h4>
<h4 class="date">2024-10-05</h4>
<!--
%\VignetteEngine{knitr::rmarkdown}
%\VignetteIndexEntry{Venn Diagrams with `gplots`}
%\VignetteEncoding{UTF-8}
-->
<p>Venn diagrams <a href="https://en.wikipedia.org/wiki/Venn_diagram">Wikipedia</a> allow
for a quick overview on the number of elements that multiple sets share.
When those elements represent traits of real objects, like observations
in biomedical sciences, marketing, etc., this may direct researchers to
further investigations or decisions.</p>
<p>The <code>gplots</code> package provides Venn diagrams for up to five
sets. The R code to produce the diagrams is straightforward. The plot
function behaves the same, depending only on the number of overlapping
circles to draw. Its input is a table that is produced by another
function. The <code>venn()</code> function calls one after the other and
is the only one to be seen by the user. The values shown are returned
invisibly.</p>
<p>The <code>venn()</code> function accepts either a list of sets as an
argument, or it takes a binary matrix—one column per set—indicating for
every element, one per row, the membership with every set.</p>
<p>The common form with overlapping circles works with up to three sets,
as seen here:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="fu">suppressMessages</span>(<span class="fu">library</span>(gplots))</span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="fu">venn</span>( <span class="fu">list</span>(<span class="at">A=</span><span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>,<span class="at">B=</span><span class="dv">4</span><span class="sc">:</span><span class="dv">6</span>,<span class="at">C=</span><span class="fu">c</span>(<span class="dv">4</span>,<span class="dv">8</span><span class="sc">:</span><span class="dv">10</span>)) )</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojL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gBQLk8OEJXHXVVWG77bYLt956azj66KPDddddF0499dRw2223uSj98Y9/HP7kHDkRBJaJViaipTRyqgj8+Mc/Dptvvnl4yEMeEj796U+HO9zh9r+FehXbaKONwh577BHOOOOMqbpuLmYugeXmfuQTBPIQkOj8+c9/DmefffYc8ZH1+9///mHx4sXhP//5T57GYKUYAQSoGPrZNnzNNdeEe93rXi42KRI777xzqpq6KSNwe793yi6MyxlvAhKg9dZbb7wbSetGTgABGjliDKQIrLjiij74nNpG3ewQQIBm57seqyvVAPR3v/vdrm36y1/+Ev72t7913c6G6SCAAE3H9zhxVyEB0iD09773vWTbDzjggLDqqquGX//618ntVE4HAabhp+N7HPurUG/nm9/8pgvOD3/4w3DjjTeGpUuXhmWWWSbc8Y53dEfEX/ziF/77ne50p/CnP/0p3PnOdw5PecpTwjrrrBMe+MAHhk033TQ8+MEPDnp9o0wHAQRoOr7HsboKCc1FF10ULr/88iBnw6pIUDbZZJOw7rrrhrXWWst7QCeeeKL7Az3pSU/yui9+8YvhiiuucAHab7/9fCr+Zz/7WfjOd77jolWdS4KkY7bffvvw1Kc+NUi0KBNIQI6IFAgshMBf//rX+O53vzta70ROrf5jQhMPPvjgeOmll0Ybz+l6+vPPPz/utNNO8e53v3vrWAvFiBaK0fWYr3/96/H444+PJj6tY6xXFBctWhRvuOGGrsexYfwIhPFrEi2aFAKnn356vO997+siYDFc8cADD4wWTjFU8//9739HGw+KNi408PE65rTTTotbbLFFS5Be9KIXxV/+8pcDn4sD8hJAgPLynnhrv/3tb6OFSLQe9Fe/+tXx97///Vhd14c//OG48cYbexvvfe97x09+8pNj1T4aczsBZsEm8LW5RJM1QPzoRz86rLHGGh40qgFku43CW97ylnCPe9yjRJO62nzmM58Zrr/++qBg1h133DE87WlP88Huc889t+sxbChDAAEqw31irMoXRw+wvWr5gLCCSPVwb7nllmN/DXe9613DySef7EL5xje+Mey5554uRBJPyngQQIDG43sYy1bYwLJPeX/hC19wp0Hl6FGg6CiKelOjLIcddliwcaaw//77h8c85jHh2c9+Np7YowRe89wIUE1Qs7SbHATlf/PSl740vPe97/Up8VHFbckn6JWvfGW43/3uF+55z3uGvffe2+2NgrdSfrznPe8JNjgdbCwrrLzyyuHiiy8ehSnOWZMAAlQT1KzspjQZenWRg6DCIfbZZ5+RXvrznve8oB6WzWKFU045JXz1
<p>The names of columns or the list elements are the set names. To
squeeze extra circles in, those circles need to become ellipses. This
works for four sets:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a>v.table <span class="ot">&lt;-</span> <span class="fu">venn</span>( <span class="fu">list</span>(<span class="at">A=</span><span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>,<span class="at">B=</span><span class="dv">4</span><span class="sc">:</span><span class="dv">6</span>,<span class="at">C=</span><span class="fu">c</span>(<span class="dv">4</span>,<span class="dv">8</span><span class="sc">:</span><span class="dv">10</span>),<span class="at">D=</span><span class="fu">c</span>(<span class="dv">4</span><span class="sc">:</span><span class="dv">12</span>)) )</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W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3BERAvUGvgoWAEBABaQwIASHQGwIioN6gV8FCQAiIgDQGhIAQ6A0BEVBv0KtgISAEREAaA0JACPSGgAioN+hVsBAQAiIgjQEhIAR6Q0AE1Bv0KlgICAERkMaAEBACvSEgAuoNehUsBITAcoJACOQR+MEPfhD+/Oc/5y/5+2WXXTasscYa4U53utO872b9wve+971w7bXXhp/85Cfhzne+c7j//e8fNtpoo3DHO95x1qu+8OuXSYRADoHHP/7xmY36yr/VV189e9KTnpTZA527azbfnn/++dkjH/nI0rbc9a53zY466qjsL3/5y2xWfimp1TK0c+HTrFrYFIEnPOEJ4bOf/WywBzTc4x73GNz2j3/8I/zpT38Kv/71r/3aXe5yl3DuuecG0s+a/Pvf/w6LFi0K73jHO7xqq666athyyy3DmmuuGf7whz+Er371q+HrX/+6f0f9L7zwwnC7291u1pqxdNRnKSFaNbMhAnEGdMghh5Te8cMf/nAwq7jvfe9bmqbvi6997WsHs54jjzwy+/vf/z6vSuedd15mpOPp9txzz3nf68J0EJASeun4nemslcwizj77bM8PncpVV13VWd5dZPTNb34z2NLKs3r2s58dXvOa14Tll19+XtY77LBDWLx4sV8/88wzA7ovyfQREAFNH/PkS1xttdXCPe95T2/HTTfdNFPtOfnkkwNLsPvd737hlFNOqa3b8573PE/3sIc9LNxwww21afXlZBCQFWwyuC7oXG+88cbwq1/9Ktz2trcNj3vc42amrf/617/COeec4/V57nOf6xavusott9xyAQsZFj5JPwgI+X5wT7JUFNGf+9znwlOe8hSv/8EHHzxTZvmbb745/Pa3v/W6PfjBD26EscinEUwTS6QZ0MSgbZ4xPir/+c9/3Op0n/vcp/mNE0x53HHHheOPP35QAvUzZe7g89vf/vbwspe9bPB5Ft787Gc/G1TjIQ95yOD9LL2BxMuWe8sss4zrqvBNYgwsLcQoAup5dF555ZUBHQSy6aabhssvv7znGv23eJYz/FXJGWec4abt9ddfvyrJ1K/jJhDl7ne/e3w7U68//vGPwwYbbFBbp9vf/vZh9913D2aJdB1VbeLEvxQB9dyB733ve70GK664ovumXHHFFQNC6rNq++yzT3ja054WUDLj+/Pzn/88/OIXvwi///3v/Recem644YZh880391c8pFdaaaVwr3vdy//wmsZiRrsmIWYk9rr96Ec/Csx8qNt11103KGrXXXd1HRAzN6xgd7jDHQK+S9SRGQaK9LXWWiuss846AV1QH4KiHD0aQnv++te/ht/97nfuif7ud787nHrqqeFNb3pTOPDAA/uo3lTKlCPiVGAuL+Rvf/ubPwxMy1/5ylcG818JPPgMvmkJA/+L
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a><span class="fu">print</span>(v.table)</span></code></pre></div>
<pre><code>## num A B C D
## 0000 0 0 0 0 0
## 0001 3 0 0 0 1
## 0010 0 0 0 1 0
## 0011 3 0 0 1 1
## 0100 0 0 1 0 0
## 0101 1 0 1 0 1
## 0110 0 0 1 1 0
## 0111 0 0 1 1 1
## 1000 3 1 0 0 0
## 1001 0 1 0 0 1
## 1010 0 1 0 1 0
## 1011 0 1 0 1 1
## 1100 0 1 1 0 0
## 1101 1 1 1 0 1
## 1110 0 1 1 1 0
## 1111 1 1 1 1 1
## attr(,&quot;intersections&quot;)
## attr(,&quot;intersections&quot;)$A
## [1] &quot;1&quot; &quot;2&quot; &quot;3&quot;
##
## attr(,&quot;intersections&quot;)$D
## [1] &quot;7&quot; &quot;11&quot; &quot;12&quot;
##
## attr(,&quot;intersections&quot;)$`B:D`
## [1] &quot;6&quot;
##
## attr(,&quot;intersections&quot;)$`C:D`
## [1] &quot;8&quot; &quot;9&quot; &quot;10&quot;
##
## attr(,&quot;intersections&quot;)$`A:B:D`
## [1] &quot;5&quot;
##
## attr(,&quot;intersections&quot;)$`A:B:C:D`
## [1] &quot;4&quot;
##
## attr(,&quot;class&quot;)
## [1] &quot;venn&quot;</code></pre>
<p>And maybe even more impressively for five:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a><span class="fu">venn</span>( <span class="fu">list</span>(<span class="at">A=</span><span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>,<span class="at">B=</span><span class="dv">4</span><span class="sc">:</span><span class="dv">6</span>,<span class="at">C=</span><span class="fu">c</span>(<span class="dv">4</span>,<span class="dv">8</span><span class="sc">:</span><span class="dv">10</span>),<span class="at">D=</span><span class="fu">c</span>(<span class="dv">4</span><span class="sc">:</span><span class="dv">12</span>),<span class="at">E=</span><span class="fu">c</span>(<span class="dv">2</span>,<span class="dv">4</span>,<span class="dv">6</span><span class="sc">:</span><span class="dv">9</span>)) )</span></code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7E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z1VCHFkotlBQOk4ZudeFRtpv3Qc6UDQvXz6058Oz372s8Nb3vKW9FDP39/5
<p>The man page of venn() lists options to change the appearance of the
plots, e.g., the names of the sets may be omitted, and sizes changed.
However, there is ample opportunity to extend the functionality of this
package, such as:</p>
<ul>
<li>More dimensions</li>
<li>Colors</li>
<li>Variation of size of circles with the number of members in the
set</li>
<li>Density plot rather than numbers, identification of individual
entries</li>
</ul>
<p>The prime personal interest is in the increase of dimensions. Please
send patches for features you are most interested in.</p>
<!-- code folding -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>