This R package is intended to compute specific elements in intersections of Venn diagram instead of plot.
- Custom reader of files to create list of character arrays (such requiered for this package and VennDiagram).
- Compute specific elements in intersections of Venn diagram in memory or write to files.
- Plot with VennDiagram.
You can install from GitHub as:
devtools::install_github("cosmoscalibur/venn.compute")
If an error about TAR executable is showed (common in Linux with Anaconda), you need to setup your TAR path.
Sys.setenv(TAR = "/bin/tar")
First, load the package.
library(venn.compute)
This is a custom reader to include multiple files and associate its custom names, returned a named list of character arrays (each element is an element line of the file).
sets <- read.lists_from_files(c(file.path("tests", "primes.txt"),
file.path("tests", "even.txt"),
file.path("tests", "fibo.txt")),
c("primes", "even", "fibo"))
Now you can compute specific elements of Venn diagram intersections.
venn.compute_specific(sets)
If you need to write sets in files, add an output path. Files are written using convention of join sets name with underscore.
venn.compute_specific(sets, output_dir = file.path("tests", "output"))
Finally, if you want to save plot, invoke this function with the same arguments as before.
venn.compute_plot(sets, output_dir = file.path("tests", "output"))