Title: | Interactive Venn Diagrams |
Version: | 1.0.0 |
Description: | Creates interactive Venn diagrams using the 'amCharts5' library for 'JavaScript'. They can be used directly from the R console, from 'RStudio', in 'shiny' applications, and in 'rmarkdown' documents. |
License: | GPL-3 |
URL: | https://github.com/stla/amVennDiagram5 |
BugReports: | https://github.com/stla/amVennDiagram5/issues |
Imports: | htmlwidgets, partitions, venn, utils |
Suggests: | shiny |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.1 |
NeedsCompilation: | no |
Packaged: | 2024-07-29 17:31:07 UTC; User |
Author: | Stéphane Laurent [aut, cre], amCharts team [cph] |
Maintainer: | Stéphane Laurent <laurent_step@outlook.fr> |
Repository: | CRAN |
Date/Publication: | 2024-07-31 10:41:07 UTC |
Enumeration of Venn diagrams
Description
Given the cardinalities of some sets, returns all possible Venn diagrams of these sets.
Usage
allVennDiagrams(cardinalities, output = "dataframes")
Arguments
cardinalities |
vector of positive integers |
output |
either |
Value
List of Venn diagrams.
Venn diagram widget
Description
Creates an amVennDiagram
widget.
Usage
amVennDiagram(
data,
theme = "default",
legendPosition = "right",
elementId = NULL
)
Arguments
data |
a list such as one returned by |
theme |
the theme: |
legendPosition |
legend position: |
elementId |
a HTML id (usually useless) |
Value
An amVennDiagram
widget.
Examples
sets <- list(A = 1:20, B = 10:30, C = 15:35)
dat <- makeVennData(sets)
amVennDiagram(dat, theme = "kelly")
Shiny bindings for 'amVennDiagram'
Description
Output and render functions for using amVennDiagram
within Shiny applications and interactive Rmd documents.
Usage
amVennDiagramOutput(outputId, width = "100%", height = "400px")
renderAmVennDiagram(expr, env = parent.frame(), quoted = FALSE)
Arguments
outputId |
output variable to read from |
width , height |
a valid CSS dimension (like |
expr |
an expression that generates an |
env |
the environment in which to evaluate |
quoted |
logical, whether |
Value
amVennDiagramOutput
returns an output element that can be
included in a Shiny UI definition, and renderAmVennDiagram
returns a
shiny.render.function
object that can be included in a Shiny server
definition.
Examples
if(require("shiny") && interactive()) {
library(amVennDiagram5)
library(shiny)
sets <- list(A = 1:20, B = 15:38, C = c(0:5, 20, 30:40))
diagram <- makeVennData(sets)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
radioButtons(
"theme", label = "Theme",
choices = c(
"default",
"dark",
"dataviz",
"frozen",
"kelly",
"material",
"moonrise",
"spirited"
)
)
),
mainPanel(
amVennDiagramOutput("diagram", height = "95vh")
)
)
)
server <- function(input, output, session) {
output[["diagram"]] <- renderAmVennDiagram({
amVennDiagram(
diagram, theme = input[["theme"]]
)
})
}
shinyApp(ui, server)
}
Venn diagram data from a list of sets
Description
Make data for usage in amVennDiagram
.
Usage
makeVennData(sets)
Arguments
sets |
a named list of vectors representing some sets |
Value
A list suitable for usage in amVennDiagram
.
Examples
sets <- list(A = 1:20, B = 10:30, C = 15:35)
dat <- makeVennData(sets)
amVennDiagram(dat, theme = "spirited")