Icon

kn_​example_​venn_​gram

examples of Venn gramms

Create several Venn Gramms in KNIME with the help of R



library(Cairo)# https://stackoverflow.com/questions/13110076/function-to-concatenate-pathsmy_separator <- .Platform$file.sepmy_path <- paste0(knime.flow.in[["context.workflow.absolute-path"]], my_separator, "data", my_separator, "Venn3.png")# https://datascience.stackexchange.com/questions/2403/data-science-without-knowledge-of-a-specific-topic-is-it-worth-pursuing-as-a-cadraw.ellipse <- function(center,angle,semimajor,semiminor,radius,h,s,v,...) { shape <- rbind(c(cos(angle),-sin(angle)),c(sin(angle),cos(angle))) %*% diag(c(semimajor,semiminor)) tt <- seq(0,2*pi,length.out=1000) foo <- matrix(center,nrow=2,ncol=length(tt),byrow=FALSE) + shape%*%(radius*rbind(cos(tt),sin(tt))) polygon(foo[1,],foo[2,],col=hsv(h,s,v,alpha=0.5),border="black",...)}name <- function(x,y,label,cex=1.2,...) text(x,y,label,cex=cex,...)# https://stackoverflow.com/questions/24999983/r-unable-to-start-device-png-capabilities-has-true-for-pngpng(my_path,width=1024,height=768, bg = "transparent", type="cairo")plot.newopar <- par(mai=c(0,0,0,0),lwd=3,font=2) plot(c(0,100),c(0,90),type="n",bty="n",xaxt="n",yaxt="n",xlab="",ylab="") draw.ellipse(center=c(30,30),angle=0.75*pi,semimajor=2,semiminor=1,radius=20,h=60/360,s=.068,v=.976) draw.ellipse(center=c(70,30),angle=0.25*pi,semimajor=2,semiminor=1,radius=20,h=83/360,s=.482,v=.894) draw.ellipse(center=c(48,40),angle=0.7*pi,semimajor=2,semiminor=1,radius=20,h=174/360,s=.397,v=.8) draw.ellipse(center=c(52,40),angle=0.3*pi,semimajor=2,semiminor=1,radius=20,h=200/360,s=.774,v=.745) name(50,90,"The Data Scientist Venn Diagram",pos=1,cex=2) name(8,62,"Communi-\ncation",cex=1.5,pos=3) name(30,78,"Statistics",cex=1.5) name(70,78,"Programming",cex=1.5) name(92,62,"Business",cex=1.5,pos=3) name(10,45,"Hot\nAir") name(90,45,"The\nAccountant") name(33,65,"The\nData\nNerd") name(67,65,"The\nHacker") name(27,50,"The\nStats\nProf") name(73,50,"The\nIT\nGuy") name(50,55,"R\nCore\nTeam") name(38,38,"The\nGood\nConsultant") name(62,38,"Drew\nConway's\nData\nScientist") name(50,24,"The\nperfect\nData\nScientist!") name(31,18,"Comp\nSci\nProf") name(69,18,"The\nNumber\nCruncher") name(42,11,"Head\nof IT") name(58,11,"Ana-\nlyst") name(50,5,"The\nSalesperson") par(opar)dev.off()knime.out <- data.frame("venn_path" = toString(my_path)) library(Rserve)Rserve(args = "--vanilla")# https://stackoverflow.com/questions/26225066/how-can-i-shut-down-rserve-gracefullylibrary(Rserve)library(RSclient)Rserve(port = 6311, debug = FALSE, args = "--vanilla")rsc <- RSconnect(port = 6311)# if you are finished shut down the serverRSshutdown(rsc) https://forum.knime.com/t/venn-euler-diagrams/13670/3 https://datascience.stackexchange.com/questions/2403/data-science-without-knowledge-of-a-specific-topic-is-it-worth-pursuing-as-a-ca/2406#2406Stephan Kolassahttps://datascience.stackexchange.com/users/2853/stephan-kolassa a few examples of Venn Gramms with KNIME KNIME and R — installation across operating systems — some remarkshttps://medium.com/p/6494a2a498cc locate and create/data/ folderwith absolute pathsinitiate Ryou have to startRServe from RVenn2Venn1initiate RVenn0/ data/Venn0.png/data/Venn1.png/data/Venn2.pngwrite Venn3 diagram to diskvenn_pathvenn_pathread image from discvenn_pathCollect LocalMetadata R Source R Plot R Plot R Source (Table) Image To Table Renderer to Image Table To Image Table To Image Renderer to Image Image To Table R View (Workspace) R Source(Workspace) Renderer to Image Image To Table Table To Image Image Writer (Port) Image Writer (Port) Image Writer (Port) R to Table Table Rowto Variable String to Path(Variable) Read Images String to URI Table To Image library(Cairo)# https://stackoverflow.com/questions/13110076/function-to-concatenate-pathsmy_separator <- .Platform$file.sepmy_path <- paste0(knime.flow.in[["context.workflow.absolute-path"]], my_separator, "data", my_separator, "Venn3.png")# https://datascience.stackexchange.com/questions/2403/data-science-without-knowledge-of-a-specific-topic-is-it-worth-pursuing-as-a-cadraw.ellipse <- function(center,angle,semimajor,semiminor,radius,h,s,v,...) { shape <- rbind(c(cos(angle),-sin(angle)),c(sin(angle),cos(angle))) %*% diag(c(semimajor,semiminor)) tt <- seq(0,2*pi,length.out=1000) foo <- matrix(center,nrow=2,ncol=length(tt),byrow=FALSE) + shape%*%(radius*rbind(cos(tt),sin(tt))) polygon(foo[1,],foo[2,],col=hsv(h,s,v,alpha=0.5),border="black",...)}name <- function(x,y,label,cex=1.2,...) text(x,y,label,cex=cex,...)# https://stackoverflow.com/questions/24999983/r-unable-to-start-device-png-capabilities-has-true-for-pngpng(my_path,width=1024,height=768, bg = "transparent", type="cairo")plot.newopar <- par(mai=c(0,0,0,0),lwd=3,font=2) plot(c(0,100),c(0,90),type="n",bty="n",xaxt="n",yaxt="n",xlab="",ylab="") draw.ellipse(center=c(30,30),angle=0.75*pi,semimajor=2,semiminor=1,radius=20,h=60/360,s=.068,v=.976) draw.ellipse(center=c(70,30),angle=0.25*pi,semimajor=2,semiminor=1,radius=20,h=83/360,s=.482,v=.894) draw.ellipse(center=c(48,40),angle=0.7*pi,semimajor=2,semiminor=1,radius=20,h=174/360,s=.397,v=.8) draw.ellipse(center=c(52,40),angle=0.3*pi,semimajor=2,semiminor=1,radius=20,h=200/360,s=.774,v=.745) name(50,90,"The Data Scientist Venn Diagram",pos=1,cex=2) name(8,62,"Communi-\ncation",cex=1.5,pos=3) name(30,78,"Statistics",cex=1.5) name(70,78,"Programming",cex=1.5) name(92,62,"Business",cex=1.5,pos=3) name(10,45,"Hot\nAir") name(90,45,"The\nAccountant") name(33,65,"The\nData\nNerd") name(67,65,"The\nHacker") name(27,50,"The\nStats\nProf") name(73,50,"The\nIT\nGuy") name(50,55,"R\nCore\nTeam") name(38,38,"The\nGood\nConsultant") name(62,38,"Drew\nConway's\nData\nScientist") name(50,24,"The\nperfect\nData\nScientist!") name(31,18,"Comp\nSci\nProf") name(69,18,"The\nNumber\nCruncher") name(42,11,"Head\nof IT") name(58,11,"Ana-\nlyst") name(50,5,"The\nSalesperson") par(opar)dev.off()knime.out <- data.frame("venn_path" = toString(my_path)) library(Rserve)Rserve(args = "--vanilla")# https://stackoverflow.com/questions/26225066/how-can-i-shut-down-rserve-gracefullylibrary(Rserve)library(RSclient)Rserve(port = 6311, debug = FALSE, args = "--vanilla")rsc <- RSconnect(port = 6311)# if you are finished shut down the serverRSshutdown(rsc) https://forum.knime.com/t/venn-euler-diagrams/13670/3 https://datascience.stackexchange.com/questions/2403/data-science-without-knowledge-of-a-specific-topic-is-it-worth-pursuing-as-a-ca/2406#2406Stephan Kolassahttps://datascience.stackexchange.com/users/2853/stephan-kolassa a few examples of Venn Gramms with KNIME KNIME and R — installation across operating systems — some remarkshttps://medium.com/p/6494a2a498cc locate and create/data/ folderwith absolute pathsinitiate Ryou have to startRServe from RVenn2Venn1initiate RVenn0/data/Venn0.png/data/Venn1.png/data/Venn2.pngwrite Venn3 diagram to diskvenn_pathvenn_pathread image from discvenn_pathCollect LocalMetadata R Source R Plot R Plot R Source (Table) Image To Table Renderer to Image Table To Image Table To Image Renderer to Image Image To Table R View (Workspace) R Source(Workspace) Renderer to Image Image To Table Table To Image Image Writer (Port) Image Writer (Port) Image Writer (Port) R to Table Table Rowto Variable String to Path(Variable) Read Images String to URI Table To Image

Nodes

Extensions

Links