First, you should load recharts
:
library(recharts)
Venn has very limited functionalities in Echarts.
The keys are:
x
and numeric y
series
is not applicableechartr(data, x, y, <t>, <type>)
Arg | Requirement |
---|---|
data |
source data in the form of data.frame |
x |
character independent variable. Only the first one is accepted if multiple variables are provided. |
y |
numeric dependent variable. Only the first four ones are accepted. |
t |
timeline variable which will be coerced to factors. Only the first one is accepted if multiple variables are provided. |
type |
‘venn’ |
Here is a fictious dataset.
data = data.frame(x=c('Collection 1', 'Collection 2', 'Intersection'),
y=c(40,50,20))
knitr::kable(data)
x | y |
---|---|
Collection 1 | 40 |
Collection 2 | 50 |
Intersection | 20 |
echartr(data, x, y, type='venn') %>%
setTitle('Venn', 'Fictious Data')
Then you can configure the widgets, add markLines and/or markPoints, fortify the chart.
You can refer to related functions to play around on your own.