<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/an-ode-to-diagrammer/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.mango-solutions.com/blog/an-ode-to-diagrammer"> RBlog – Mango Solutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>When our Chief Data Scientist, Rich Pugh, offered to write a blogpost about the DiagrammeR package, he asked what format we'd like it in.Â  &quot;A poem?â€� we retorted.</p>
<p>He didn't disappointâ€¦.</p>
<p> </p>
<p>Gather ye and listen to my tale of daring do,</p>
<p>Of heroes, villains, diagrams - and a chunk of R code too,</p>
<p>Wherefore my tale involves the noble Knight, Sir DiagrammeR,</p>
<p>Who brought the power of Knights of old - our own true Excalibur!</p>
<p> </p>
<p>My tale begins in the office towers of a client in the city,</p>
<p>Where the coffee's really strong, and the banter's rather witty,</p>
<p>A place where we've delivered lots of data-driven gold,</p>
<p>With the fighting led by Mango Knights, heroic, brave and bold,</p>
<p> </p>
<p>Whence our discussions quickly led to Data Science skill,</p>
<p>And the time required to cross-train a group of Analysts, who will</p>
<p>Become good Sirs and Ladies of a new Data Science team,</p>
<p>But how to design and communicate, this audacious training scheme?</p>
<p> </p>
<p>Up went the cry, &quot;A diagram is really what we need,</p>
<p>To explain the likely investment and time needed to lead</p>
<p>These Analysts who wish to learn to wield an Analytic sword,</p>
<p>A diagram would help us communicate this to the board.â€�</p>
<p> </p>
<p>In burst the good Sir Powerpoint, upon his paper-clip-shaped mount,</p>
<p>&quot;Did someone want a diagram?â€� this Gentleman did shout,</p>
<p>&quot;For I have pre-built charts and things that really look quite neat,</p>
<p>And as a creator of diagrams I really can't be beat!â€�</p>
<p> </p>
<p>&quot;Huzzah!â€� they said &quot;that surely is the answer to our plightâ€�,</p>
<p>But the skillful Mango Knights demurred, &quot;this course may not be right,</p>
<p>Sir Powerpoint may have armour and a flashy, prancing steed,</p>
<p>But he certainly won't provide us with the capabilities we needâ€�</p>
<p> </p>
<p>&quot;We really want to simulate this cross-train exercise,</p>
<p>With a presentation of results to verily delight the eyes,</p>
<p>So members of the board will clearly understand the way,</p>
<p>To build a team with DS skills so they can win the day!â€�</p>
<p> </p>
<p>All agreed Sir Powerpoint was really not the answer,</p>
<p>So with a nod we all dismissed this brave and brilliant lancer,</p>
<p>Instead those expert Mango Knights immediately did clamour,</p>
<p>To summon that brave hero, the good Sir DiagrammeR!</p>
<p> </p>
<p>In walked the gent, who truly was the answer to our prayers,</p>
<p>He helped us build a diagram of lines and text and squares,</p>
<p>And since it was produced in R (that really is quite swell),</p>
<p>We could proceed to populate it with simulated scenarios as well,</p>
<p> </p>
<p>A create_node_df call meant we could define the nodes,</p>
<p>We also used this function to set attributes (of which there are loads),</p>
<p>Such as labels, colour and shape - oh, the things we could control!</p>
<p>We could even define a bespoke layout to help achieve our goal.</p>
<p> </p>
<p>Next we used create_edge_df to define the transition,</p>
<p>Of the skills of their DS team throughout their training mission,</p>
<p>We also annotated edges with some labels to convey,</p>
<p>The estimated time to upskill folks to B from A,</p>
<p> </p>
<p>A simple call to create_graph then allowed us to combine,</p>
<p>Both edge and node dfs into an object we did assign,</p>
<p>Then render_graph created the spectacular show,</p>
<p>With options for the layout (we just chose &quot;neatoâ€�),</p>
<p> </p>
<p>It really was quite easy to produce the final chart,</p>
<p>With fine control the diagram looked like a work of art,</p>
<p>The use of simple data frames meant creation was a breeze,</p>
<p>And decent online docs meant we could build the thing with ease,</p>
<p> </p>
<p>The output was fantastic - and thus the day was won,</p>
<p>The finished docs and examples confirmed our work was done,</p>
<p>In such a timely manner too – we'd worked at such great speed,</p>
<p>We retired early to the tavern to celebrate with ales and mead.</p>
<p> </p>
<p>And thus our tale is ended, and the hero of the hour,</p>
<p>Was certainly Sir DiagrammeR and his chart-creation power,</p>
<p>It really is a top package with well-written documentation,</p>
<p>We heartily recommend it for diagram creation!</p>
<p> </p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://www.mango-solutions.com/blog/an-ode-to-diagrammer"> RBlog – Mango Solutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/MrYUXI00Ccs" height="1"></a></div>