<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/weird-al-yankovise-a-2-chainz-lyric/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://feedproxy.google.com/~r/RstatsMikeJackTzen/~3/3GMbKsnZAHE/"> rstats – MikeJackTzen</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>I have a character string snipped from a lyric by <a rel="nofollow" href="https://en.wikipedia.org/wiki/2_Chainz" target="_blank">Daniel Son the Necklace Don</a>.</p>
<div><iframe allowfullscreen="true" src="https://www.youtube.com/embed/ZBx-M2oRBLg?version=3&rel=1&%23038;fs=1&%23038;autohide=2&%23038;showsearch=0&%23038;showinfo=1&%23038;iv_load_policy=1&%23038;wmode=transparent" width="450" type="text/html"></iframe></div>
<p>Let’s get all Weird Al Yankovic with it.</p>
<p>I’ll revise some words with the <a rel="nofollow" href="https://github.com/mikejacktzen/datzen" target="_blank">datzen</a><code>::yankovise()</code> function. You can swap out words using a dictionary of name-value pairs.</p>
<pre>
paste0(snip &lt;- &quot;Suede sun roof, hanging out the big top We leave the dealership, head to the rim shop&quot;, &quot; - @2chainz aka the Hair Weave Killer&quot;) 
#> [1] &quot;Suede sun roof, hanging out the big top We leave the dealership, head to the rim shop - @2chainz aka the Hair Weave Killer&quot;
</pre>
<p>Above, we have a bar from 2 Chainz aka the Hair Weave Killer.</p>
<p>Below, we have the yankovised bar from <a rel="nofollow" href="https://twitter.com/2Chainz_PhD?lang=en" target="_blank">@2Chainz_PhD</a> aka the CPU Core Killer aka ProbaBittyBoi aka Daniel Son the Data Don aka El <a rel="nofollow" href="http://statweb.stanford.edu/~ckirby/brad/" target="_blank">Efron</a> Jr.</p>
<pre>
# user supplied dictionary
dict_outin = c(
datzen::dictate_outin('dealership','SERVER ROOM'),
datzen::dictate_outin('big','LAP'),
datzen::dictate_outin('rim','RAM')
)

yankovise(snip,suffix=&quot;- @2Chainz_PhD&quot;,dict_outin = dict_outin)
#> [1] &quot;suede sun roof hanging out da LAP top we leave da SERVER ROOM head 2 da RAM shop - @2Chainz_PhD&quot;
</pre>
<p>You might ask, isn’t this just a wrapper to <code>gsub()</code> or <code>stringr::str_replace_all()</code> with some added flavor? I might say, yes, yes it is… only with a narrower scope and whose output is streamlined as tweet-ready text.</p>
<div>
<blockquote data-width="450" class="twitter-tweet">
<p lang="en" dir="ltr">suede sun roof, hanging out da LAPTOP. <br>we leave da SERVER ROOM,<br>head 2 da RAM shop – <a rel="nofollow" href="https://twitter.com/2chainz?ref_src=twsrc%5Etfw" target="_blank">@2Chainz</a></p>
<p>— ProbaBittyBoi (@2Chainz_PhD) <a rel="nofollow" href="https://twitter.com/2Chainz_PhD/status/915744934476443648?ref_src=twsrc%5Etfw" target="_blank">October 5, 2017</a></p>
</blockquote>
<p></div>
<p><a rel="nofollow" href="https://mikejacktzen.files.wordpress.com/2017/10/44ofambs_400x400.jpg" target="_blank"><img data-orig-file="https://mikejacktzen.files.wordpress.com/2017/10/44ofambs_400x400.jpg?w=456" data-orig-size="400,400" data-medium-file="https://mikejacktzen.files.wordpress.com/2017/10/44ofambs_400x400.jpg?w=456?w=300" data-attachment-id="868" data-image-meta="{" data-image-description="" src="https://mikejacktzen.files.wordpress.com/2017/10/44ofambs_400x400.jpg?w=456" data-permalink="https://mikejacktzen.wordpress.com/2017/10/10/yankovise-2chainz-phd/44ofambs_400x400/" data-large-file="https://mikejacktzen.files.wordpress.com/2017/10/44ofambs_400x400.jpg?w=456?w=400" alt="" data-image-title="44ofAmbS_400x400" sizes="(max-width: 400px) 100vw, 400px" data-comments-opened="1" class="wp-image-868" data-recalc-dims="1"></a></p>
<p> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikejacktzen.wordpress.com/857/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/comments/mikejacktzen.wordpress.com/857/"></a> <img border="0" alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" data-recalc-dims="1"><img alt="" width="1" src="http://feeds.feedburner.com/~r/RstatsMikeJackTzen/~4/3GMbKsnZAHE" height="1"></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="http://feedproxy.google.com/~r/RstatsMikeJackTzen/~3/3GMbKsnZAHE/"> rstats – MikeJackTzen</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 alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/nSspsF7qy4M" height="1"></a></div>