Venn Diagram
Hi Anonymous,
One more tip. You should add more columns to your R visual , so that each row is unique. Otherwise PBI visual (any visual) will remove duplicates and your diagramm will be wrong. Another option is to use ID column. And make sure you do not aggregate fields.
"Do not summarize" for all input fields.
HI Again Boefraty,
I did everything you asked, but now I'm getting a count of one per category. There is a unique id for each observation, but Power Bi is still deleting "duplicates".
Here's the code and output, as well as a screenshot showing the unique ids.
Many, many, many thanks,
Juniper
#set working directory i.e. the folder you are working out of
setwd("H:/Eliel JBBS Sent")
#set default library path - where to look for packages, which are also called libraries
.libPaths("H:/R/win-library/3.4")
#load Venn Diagram package
library(VennDiagram)
library("RColorBrewer")
library(grid)
library(futile.logger)
#Venn <- read.xlsx("Venn.xlsx", sheetName = "Venn", header = TRUE, stringsAsFactors = FALSE)
Venn = dataset
draw.triple.venn(margin = 0.1, area1 = nrow(subset(Venn, Felony == "Yes")), area2 = nrow(subset(Venn, Misdemeanor == "Yes")), area3 = nrow(subset(Venn, Ordinance == "Yes")),
n12 = nrow(subset(Venn, Felony == "Yes" & Misdemeanor == "Yes")), n23 = nrow(subset(Venn, Misdemeanor == "Yes" & Ordinance == "Yes")),
n13 = nrow(subset(Venn, Felony == "Yes" & Ordinance == "Yes")), n123 = nrow(subset(Venn, Felony == "Yes" & Misdemeanor == "Yes" & Ordinance == "Yes")),
category = c("Felony Offenders", "Misdemeanor Offenders", "Ordinance Offenders"), lty = "blank", fill = brewer.pal(n = 3, name = "Dark2"))