<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>strings on Credibly Curious</title>
    <link>https://www.njtierney.com/categories/strings/</link>
    <description>Recent content in strings on Credibly Curious</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 07 Jul 2019 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.njtierney.com/categories/strings/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Glue magic Part I</title>
      <link>https://www.njtierney.com/post/2019/07/07/glue-magic-p1/</link>
      <pubDate>Sun, 07 Jul 2019 00:00:00 +0000</pubDate>
      <guid>https://www.njtierney.com/post/2019/07/07/glue-magic-p1/</guid>
      <description>&lt;p&gt;Lately I&amp;rsquo;ve found myself using &lt;a href=&#34;https://glue.tidyverse.org/&#34;&gt;Jim Hester&amp;rsquo;s &lt;code&gt;glue&lt;/code&gt; package&lt;/a&gt; instead of &lt;code&gt;paste0&lt;/code&gt; or &lt;code&gt;sprintf&lt;/code&gt;. This post marks the start of an ongoing series of little magic spells using the &lt;code&gt;glue&lt;/code&gt; package.&lt;/p&gt;
&lt;h1 id=&#34;the-back-story&#34;&gt;The back story&lt;/h1&gt;
&lt;p&gt;I&amp;rsquo;ve been through a few stages of discovery for combining strings of text together.&lt;/p&gt;
&lt;p&gt;First, it was just the very &lt;em&gt;idea&lt;/em&gt; that this was possible - was AMAZING.&lt;/p&gt;
&lt;h2 id=&#34;paste&#34;&gt;&lt;code&gt;paste&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;When I learnt about the &lt;code&gt;paste&lt;/code&gt; function, it meant I could do things like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;nf&#34;&gt;paste&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;path/to/file_&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;.csv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sep&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## [1] &amp;quot;path/to/file_1.csv&amp;quot; &amp;quot;path/to/file_2.csv&amp;quot; &amp;quot;path/to/file_3.csv&amp;quot;
## [4] &amp;quot;path/to/file_4.csv&amp;quot; &amp;quot;path/to/file_5.csv&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here, this reads as, roughly, &amp;ldquo;take this string, insert the numbers 1:5 in the middle of it, and &lt;strong&gt;sep&lt;/strong&gt;arate those strings with no space &lt;code&gt;&amp;quot;&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://media.giphy.com/media/3o8dFn5CXJlCV9ZEsg/giphy.gif&#34; width=&#34;50%&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;h2 id=&#34;paste0&#34;&gt;&lt;code&gt;paste0&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;And then there was &lt;code&gt;paste0&lt;/code&gt;, which meant that I didn&amp;rsquo;t have to write &lt;code&gt;sep = &amp;quot;&amp;quot;&lt;/code&gt; all the time.&lt;/p&gt;
&lt;p&gt;So, now I could write:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;nf&#34;&gt;paste0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;path/to/file_&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;.csv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## [1] &amp;quot;path/to/file_1.csv&amp;quot; &amp;quot;path/to/file_2.csv&amp;quot; &amp;quot;path/to/file_3.csv&amp;quot;
## [4] &amp;quot;path/to/file_4.csv&amp;quot; &amp;quot;path/to/file_5.csv&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src=&#34;https://media.giphy.com/media/npCDi7hWyL52zReYSG/giphy.gif&#34; width=&#34;50%&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;h2 id=&#34;sprintf&#34;&gt;&lt;code&gt;sprintf&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;And then the &lt;code&gt;sprintf&lt;/code&gt; function, which means you can do this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;nf&#34;&gt;sprintf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;path/to/file_%s.csv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## [1] &amp;quot;path/to/file_1.csv&amp;quot; &amp;quot;path/to/file_2.csv&amp;quot; &amp;quot;path/to/file_3.csv&amp;quot;
## [4] &amp;quot;path/to/file_4.csv&amp;quot; &amp;quot;path/to/file_5.csv&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here, &lt;code&gt;%s&lt;/code&gt; is substituted in for the R code you write afterwards. This is nice because it also means you are able to drop the R code into the middle of the string without having to open and close it again. I feel like I can better express what I want to say, and don&amp;rsquo;t have to spend time remembering other book keeping things.&lt;/p&gt;
&lt;h2 id=&#34;and-now-for-glue-magic&#34;&gt;And now for glue magic&lt;/h2&gt;
&lt;p&gt;I am now always turning to glue, because it makes the intent of what I want to do clearer. For example, we can take our &lt;code&gt;sprintf&lt;/code&gt; use earlier and instead do the following with &lt;code&gt;glue&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;nf&#34;&gt;library&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;glue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;glue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;path/to/file_{1:5}.csv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## path/to/file_1.csv
## path/to/file_2.csv
## path/to/file_3.csv
## path/to/file_4.csv
## path/to/file_5.csv
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;What is going on here? You are now able to refer to R objects &lt;em&gt;inside the string&lt;/em&gt;, which are captured in the &lt;code&gt;{}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://media.giphy.com/media/8vGJv6FmhETjW/giphy.gif&#34; width=&#34;50%&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;I really like this, because it means that I don&amp;rsquo;t need to worry about ending the string, inserting the R object, and handling the other bits and pieces. My intent here feels super clear: &amp;ldquo;Insert the R code in the bit with {}&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t want to use &lt;code&gt;{}&lt;/code&gt;? That&amp;rsquo;s also fine, you can control that with &lt;code&gt;.open&lt;/code&gt; and &lt;code&gt;.close&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;nf&#34;&gt;glue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;path/to/file_[1:5].csv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.open&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;[&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.close&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;]&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## path/to/file_1.csv
## path/to/file_2.csv
## path/to/file_3.csv
## path/to/file_4.csv
## path/to/file_5.csv
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;combining-many-strings&#34;&gt;Combining many strings&lt;/h2&gt;
&lt;p&gt;Or if you want to collapse, or smush together many strings, you use &lt;code&gt;glue_collapse&lt;/code&gt;, because you want to &lt;code&gt;collapse&lt;/code&gt; together many pieces.&lt;/p&gt;
&lt;p&gt;Say, for example, that you want to write out a sentence where you state all of the variables in a dataset, like the &lt;code&gt;french_fries&lt;/code&gt; dataset from &lt;code&gt;reshape2&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# get the french fries data&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;library&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reshape2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;knitr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;kable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;french_fries&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&#34;left&#34;&gt;&lt;/th&gt;
&lt;th align=&#34;left&#34;&gt;time&lt;/th&gt;
&lt;th align=&#34;left&#34;&gt;treatment&lt;/th&gt;
&lt;th align=&#34;left&#34;&gt;subject&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;rep&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;potato&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;buttery&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;grassy&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;rancid&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;painty&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;61&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;3&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.9&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;5.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;25&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;3&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;14.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;62&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;10&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;11.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;6.4&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;26&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;10&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;9.9&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;5.9&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.9&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;63&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;15&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;0.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.1&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;5.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;left&#34;&gt;27&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;1&lt;/td&gt;
&lt;td align=&#34;left&#34;&gt;15&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;8.8&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;3.0&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;3.6&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.5&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2.3&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Here, we tell it what we want our &lt;strong&gt;sep&lt;/strong&gt;arations be - in this case, since we have a list, we want everything to be separate by a comma and a space.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;n&#34;&gt;fries_names&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;names&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;french_fries&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;fries_inline&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;glue&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;glue_collapse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fries_names&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
                                    &lt;span class=&#34;n&#34;&gt;sep&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;, &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;fries_inline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## time, treatment, subject, rep, potato, buttery, grassy, rancid, painty
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And now you can include this in your rmarkdown text, so now I can dynamically generate the sentence:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;The variables in our dataset are `r fries_inline`
&lt;/code&gt;&lt;/pre&gt;&lt;blockquote&gt;
&lt;p&gt;The variables in our dataset are time, treatment, subject, rep, potato, buttery, grassy, rancid, painty.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(PS, You can include a verbatim inline expression with &lt;code&gt;knitr::inline_expr()&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;But, what if you want to add an &amp;ldquo;and&amp;rdquo; at the end of the sentence?&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;last&lt;/code&gt; argument:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-r&#34; data-lang=&#34;r&#34;&gt;&lt;span class=&#34;n&#34;&gt;fries_inline&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;glue&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;glue_collapse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fries_names&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
                                    &lt;span class=&#34;n&#34;&gt;sep&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;, &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
                                    &lt;span class=&#34;n&#34;&gt;last&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;, and &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;The variables in our dataset are `r fries_inline`
&lt;/code&gt;&lt;/pre&gt;&lt;blockquote&gt;
&lt;p&gt;The variables in our dataset are time, treatment, subject, rep, potato, buttery, grassy, rancid, and painty.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id=&#34;end&#34;&gt;End&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;paste&lt;/code&gt;, &lt;code&gt;paste0&lt;/code&gt;, and &lt;code&gt;sprintf&lt;/code&gt; are awesome, but I use &lt;code&gt;glue&lt;/code&gt; because I find it means I can write code that more clearly captures my intent, and means I don&amp;rsquo;t need to worry about other book keeping. I also get really nice features, like being able to construct sentences, and modify them to do things at the end.&lt;/p&gt;
&lt;p&gt;Massive praise to &lt;a href=&#34;https://www.jimhester.com/&#34;&gt;Jim Hester&lt;/a&gt; for his work on glue - you should check out his great talk at UseR!2018 below. Jim has also been putting out some &lt;a href=&#34;https://www.youtube.com/channel/UC3mcThQVORlwCY4k1vB0FmQ&#34;&gt;really great videos on #rstats on youtube that are well worth yout time&lt;/a&gt;&lt;/p&gt;
&lt;!--html_preserve--&gt;
&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
  &lt;iframe src=&#34;https://www.youtube-nocookie.com/embed/XQmBcpQl8K8&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; allowfullscreen title=&#34;YouTube Video&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;!--/html_preserve--&gt;
</description>
    </item>
  </channel>
</rss>
