Icon

R Graphics - The Data Scientist Venn Gramm

"The Data Scientist Venn Gramm" - an example with KNIME and R

URL: THE DATA SCIENCE VENN DIAGRAM by Drew Conway http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram
URL: original discussion https://forum.knime.com/t/venn-euler-diagrams/13670/6?u=mlauber71
URL: Stephan Kolassa - Data Science Venn Diagram https://datascience.stackexchange.com/a/2406
URL: Representations of paths by operating system and shell https://en.wikipedia.org/wiki/Path_%28computing%29#Representations_of_paths_by_operating_system_and_shell
URL: Hub: more R Graphics with KNIME https://hub.knime.com/search?type=Workflow&tag=r,graphic&sort=best
URL: R installation on KNIME https://kni.me/w/tj5tS_6gYvqOSPlk
URL: Medium Blog: KNIME and R — installation across operating systems — some remarks https://medium.com/p/6494a2a498cc
URL: Medium Blog: Exploring the Power of R Graphics with KNIME: A Collection of Examples https://medium.com/p/9241e033e4ac


# https://stackoverflow.com/questions/13110076/function-to-concatenate-paths

my_separator <- .Platform$file.sep

my_path <- paste0(knime.flow.in[["context.workflow.absolute-path"]],my_separator, "Venn.png")

# https://datascience.stackexchange.com/questions/2403/data-science-without-knowledge-of-a-specific-topic-is-it-worth-pursuing-as-a-ca

draw.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,...)

# png(my_path,width=1024,height=768, bg = "transparent")

plot.new

opar <- 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 (Stephan Kolassa)",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)


library(Rserve)
Rserve(args = "--vanilla")


# https://stackoverflow.com/questions/26225066/how-can-i-shut-down-rserve-gracefully

library(Rserve)
library(RSclient)

Rserve(port = 6311, debug = FALSE, args = "--vanilla")

rsc <- RSconnect(port = 6311)

# if you are finished shut down the server
RSshutdown(rsc)


"The Data Scientist Venn Gramm" - an example with KNIME and R

KNIME and R — installation across operating systems — some remarks
https://medium.com/p/6494a2a498cc

Exploring the Power of R Graphics with KNIME: A Collection of Examples

https://medium.com/p/9241e033e4ac

locate and create /data/ folder with absolute paths
Collect Local Metadata
venn_path
String to Path (Variable)
read image from disc
Read Images
venn_path
Table Row to Variable
Table to Image
venn_path
String to URI
Image to Table
Table to Image
Renderer to Image
Renderer to Image
Table to Image
Image to Table
R Source (Workspace)
Venn0
R View (Workspace)
/data/Venn0.png
Image Writer (Port)
/data/Venn1.png
Image Writer (Port)
Renderer to Image
initiate Ryou have to startRServe from R
R Source
write Venn3 diagram to disk
R to Table
/data/Venn2.png
Image Writer (Port)
Image to Table
Venn1
R Plot
Table to Image
Venn2
R Plot
initiate R
R Source (Table)

Nodes

Extensions

Links