<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on Tidyverse</title>
    <link>https://www.tidyverse.org/blog/</link>
    <description>Recent content in Posts on Tidyverse</description>
    <generator>Hugo -- gohugo.io</generator>
    <copyright>en-us</copyright>
    
        <atom:link href="https://www.tidyverse.org/blog/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>hardhat 0.1.0</title>
      <link>https://www.tidyverse.org/blog/2019/12/hardhat-0-1-0/</link>
      <pubDate>Mon, 16 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/12/hardhat-0-1-0/</guid>
      <description>We&amp;rsquo;re excited to announce that the first version of hardhat is now on CRAN. hardhat is a developer-focused package with the goal of making it easier to create new modeling packages, while simultaneously promoting good R modeling package standards. To accomplish this, hardhat provides tooling around preprocessing, predicting, and validating user input, along with a way to set up the structure of a new modeling package with a single function call.</description>
      <content>&lt;p&gt;We&amp;rsquo;re excited to announce that the first version of &lt;a href=&#34;https://tidymodels.github.io/hardhat/&#34;&gt;hardhat&lt;/a&gt; is now on CRAN. hardhat is a developer-focused package with the goal of making it easier to create new modeling packages, while simultaneously promoting good R modeling package standards. To accomplish this, hardhat provides tooling around preprocessing, predicting, and validating user input, along with a way to set up the structure of a new modeling package with a single function call.&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;modeldata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;hardhat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;recipes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;biomass&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;biomass&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;biomass&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;setup&#34;&gt;Setup
  &lt;a href=&#34;#setup&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;One exciting feature included with hardhat is &lt;code&gt;create_modeling_package()&lt;/code&gt;. Built on top of &lt;code&gt;usethis::create_package()&lt;/code&gt;, this allows you to quickly set up a new modeling package with pre-generated infrastructure in place for an S3 generic to go with your user-facing modeling function. It also includes a &lt;code&gt;predict()&lt;/code&gt; method and other best practices outlined further in &lt;a href=&#34;https://tidymodels.github.io/model-implementation-principles/&#34;&gt;Conventions for R Modeling Packages&lt;/a&gt;. If you&amp;rsquo;ve never created a modeling package before, this is a great place to start so you can focus more on the implementation rather than the details around package setup.&lt;/p&gt;




&lt;h2 id=&#34;preprocessing&#34;&gt;Preprocessing
  &lt;a href=&#34;#preprocessing&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;When building a model, there are often preprocessing steps that you perform on the training set before fitting. Take this &lt;code&gt;biomass&lt;/code&gt; dataset for example. The goal is to predict the &lt;code&gt;HHV&lt;/code&gt; for each sample, an acronym for the Higher Heating Value, defined as the amount of heat released by an object during combustion. To do this, you might use the numeric columns containing the amounts of different atomic elements that make up each sample.&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;training&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;biomass[biomass&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dataset&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Training&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;testing&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;biomass[biomass&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dataset&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Testing&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;training&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 456 x 8&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    sample                 dataset  carbon hydrogen oxygen nitrogen sulfur   HHV&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;chr&amp;gt;                  &amp;lt;chr&amp;gt;     &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;  &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;  &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 Akhrot Shell           Training   49.8     5.64   42.9     0.41   0     20.0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 Alabama Oak Wood Waste Training   49.5     5.7    41.3     0.2    0     19.2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 Alder                  Training   47.8     5.8    46.2     0.11   0.02  18.3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 Alfalfa                Training   45.1     4.97   35.6     3.3    0.16  18.2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 Alfalfa Seed Straw     Training   46.8     5.4    40.7     1      0.02  18.4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 Alfalfa Stalks         Training   45.4     5.75   40.2     2.04   0.1   18.5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 Alfalfa Stems          Training   47.2     5.99   38.2     2.68   0.2   18.7&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 Alfalfa Straw          Training   45.7     5.7    39.7     1.7    0.2   18.3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 Almond                 Training   48.8     5.5    40.9     0.8    0     18.6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 Almond Hull            Training   47.1     5.9    40       1.2    0.1   18.9&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 446 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Depending on the model you choose, you might need to center and scale your data before passing it along to the fitting function. There are two main ways you might do this: a formula, or a recipe. As a modeling package developer, ideally you&amp;rsquo;d support both in your user-facing modeling function, like so:&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;my_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;UseMethod&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;my_model&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;my_model.formula&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;formula&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;my_model.recipe&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Unfortunately, each have their own nuances and tricks to be aware of, which you probably don&amp;rsquo;t want to spend too much time thinking about. Ideally, you&amp;rsquo;d be able to focus on your package&amp;rsquo;s implementation, and easily be able to support a number of different user input methods. This is where hardhat can help. &lt;code&gt;hardhat::mold()&lt;/code&gt; is a preprocessing function that knows how to preprocess formulas, prep recipes, and deal with the more basic XY input (two data frames, one holding predictors and one holding outcomes). The best part is that the output from &lt;code&gt;mold()&lt;/code&gt; is standardized across all 3 preprocessing methods, so you always know what data structures you&amp;rsquo;ll be getting back.&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;rec&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;recipe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;HHV&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;carbon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;training&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;step_normalize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;carbon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;processed_formula&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;HHV&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;scale&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;carbon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;training&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;processed_recipe&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;training&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;processed_formula&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] &amp;#34;predictors&amp;#34; &amp;#34;outcomes&amp;#34;   &amp;#34;blueprint&amp;#34;  &amp;#34;extras&amp;#34;&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;processed_recipe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] &amp;#34;predictors&amp;#34; &amp;#34;outcomes&amp;#34;   &amp;#34;blueprint&amp;#34;  &amp;#34;extras&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;predictors&lt;/code&gt; is a data frame of the preprocessed predictors.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;outcomes&lt;/code&gt; is a data frame of the preprocessed outcomes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;blueprint&lt;/code&gt; is the best part of hardhat. It records the preprocessing activities, so that it can replay them on top of new data that needs to be preprocessed at prediction time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;extras&lt;/code&gt; is a data frame of any &amp;ldquo;extra&amp;rdquo; columns in your data set that aren&amp;rsquo;t considered predictors or outcomes. These might be offsets in a formula, or extra roles from a recipe.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&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;processed_recipe&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;predictors&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 456 x 1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     carbon&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;      &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1  0.140 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2  0.110 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 -0.0513&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 -0.313 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 -0.153 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 -0.284 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 -0.114 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 -0.255 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9  0.0428&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 -0.120 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 446 more rows&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;processed_recipe&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;outcomes&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 456 x 1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;      HHV&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1  20.0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2  19.2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3  18.3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4  18.2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5  18.4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6  18.5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7  18.7&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8  18.3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9  18.6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10  18.9&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 446 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Generally you won&amp;rsquo;t call &lt;code&gt;mold()&lt;/code&gt; interactively, but will, instead, call it from your top-level modeling function as the first step to standardize and validate a user&amp;rsquo;s input.&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;my_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;UseMethod&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;my_model&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;my_model.formula&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;formula&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;processed&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hardhat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;mold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;formula&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# ... pass on to implementation&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;my_model.recipe&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;processed&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hardhat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;mold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# ... pass on to implementation&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;predicting&#34;&gt;Predicting
  &lt;a href=&#34;#predicting&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Once you&amp;rsquo;ve used the preprocessed data to fit your model, you&amp;rsquo;ll probably want to make predictions on a test set. To do this, you&amp;rsquo;ll need to reapply any preprocessing that you did on the training set to the test set as well. hardhat makes this easy with &lt;code&gt;hardhat::forge()&lt;/code&gt;. &lt;code&gt;forge()&lt;/code&gt; takes a data frame of new predictors, as well as a &lt;code&gt;blueprint&lt;/code&gt; that was created in the call to &lt;code&gt;mold()&lt;/code&gt;, and reapplies the correct preprocessing for you. Again, no matter what the original preprocessing method was, the output is consistent and predictable.&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;forged_formula&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;forge&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;testing&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;processed_formula&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blueprint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;forged_recipe&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;forge&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;testing&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;processed_recipe&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blueprint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;forged_formula&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] &amp;#34;predictors&amp;#34; &amp;#34;outcomes&amp;#34;   &amp;#34;extras&amp;#34;&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;forged_recipe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] &amp;#34;predictors&amp;#34; &amp;#34;outcomes&amp;#34;   &amp;#34;extras&amp;#34;&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;forged_recipe&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;predictors&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 80 x 1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     carbon&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;      &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 -0.193 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 -0.490 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 -0.543 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 -0.188 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5  0.0390&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 -0.390 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 -0.904 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 -0.601 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 -1.84  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 -1.97  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 70 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Like &lt;code&gt;mold()&lt;/code&gt;, &lt;code&gt;forge()&lt;/code&gt; is not intended for interactive use. Instead, you&amp;rsquo;ll call it from your &lt;code&gt;predict()&lt;/code&gt; method.&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;predict.my_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;processed&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hardhat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;forge&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;new_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blueprint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# ... pass on to predict() implementation&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;object&lt;/code&gt; here is a model fit of class &lt;code&gt;&amp;quot;my_model&amp;quot;&lt;/code&gt; that should be the result of a user calling your high level &lt;code&gt;my_model()&lt;/code&gt; function. To enable &lt;code&gt;forge()&lt;/code&gt; to work as shown here, you&amp;rsquo;ll need to attach and return the &lt;code&gt;blueprint&lt;/code&gt; that is created from &lt;code&gt;mold()&lt;/code&gt; to this model &lt;code&gt;object&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;forge()&lt;/code&gt; has powerful data type validation built in. It checks for a number of things including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Missing predictors&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Predictors with the correct name, but wrong data type&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Factor predictors with &amp;ldquo;novel levels&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Factor predictors with missing levels, which can be recovered automatically&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;learning-more&#34;&gt;Learning more
  &lt;a href=&#34;#learning-more&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;There are 3 key vignettes for hardhat.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://tidymodels.github.io/hardhat/articles/package.html&#34;&gt;Creating Modeling Packages With hardhat&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://tidymodels.github.io/hardhat/articles/mold.html&#34;&gt;Molding data for modeling&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://tidymodels.github.io/hardhat/articles/forge.html&#34;&gt;Forging data for predictions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is also a video of Max Kuhn speaking about hardhat at the &lt;a href=&#34;https://canal.uned.es/video/5dd25b9f5578f275e407dd88&#34;&gt;XI Jornadas de Usuarios de R conference&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>odbc 1.2.0</title>
      <link>https://www.tidyverse.org/blog/2019/12/odbc-1-2-0/</link>
      <pubDate>Mon, 02 Dec 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/12/odbc-1-2-0/</guid>
      <description>odbc 1.2.0 is now on CRAN! The odbc package provides a DataBase Interface (DBI) to Open DataBase Connectivity (ODBC) drivers. ODBC drivers exist for nearly all widely used databases, including SQL Server, Oracle, MySQL, PostgreSQL, SQLite and others. RStudio also provides a set of Professional ODBC Drivers free of charge for customers who have RStudio Server Pro, RStudio Connect, or Shiny Server Pro. In addition, db.rstudio.com has extensive resources on connecting to and working with databases from R.</description>
      <content>&lt;p&gt;odbc 1.2.0 is now on CRAN! The odbc package provides a &lt;a href=&#34;https://dbi.r-dbi.org/&#34;&gt;DataBase Interface (DBI)&lt;/a&gt; to &lt;a href=&#34;https://en.wikipedia.org/wiki/Open_Database_Connectivity&#34;&gt;Open DataBase Connectivity (ODBC)&lt;/a&gt; drivers.
ODBC drivers exist for nearly all widely used databases, including &lt;a href=&#34;https://www.microsoft.com/en-us/sql-server/&#34;&gt;SQL Server&lt;/a&gt;, &lt;a href=&#34;https://www.oracle.com/database&#34;&gt;Oracle&lt;/a&gt;, &lt;a href=&#34;https://www.mysql.com/&#34;&gt;MySQL&lt;/a&gt;, &lt;a href=&#34;https://www.postgresql.org/&#34;&gt;PostgreSQL&lt;/a&gt;, &lt;a href=&#34;https://sqlite.org/&#34;&gt;SQLite&lt;/a&gt; and others.
RStudio also provides a set of &lt;a href=&#34;https://db.rstudio.com/rstudio/pro-drivers/&#34;&gt;Professional ODBC Drivers&lt;/a&gt; free of charge for customers who have RStudio Server Pro, RStudio Connect, or Shiny Server Pro.
In addition, &lt;a href=&#34;https://db.rstudio.com/&#34;&gt;db.rstudio.com&lt;/a&gt; has extensive resources on connecting to and working with databases from R.
The odbc package allows you to query these databases from within R.
Get the latest version with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;odbc&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;p&gt;Generally you will &lt;em&gt;not&lt;/em&gt; need to load the odbc package with &lt;code&gt;library()&lt;/code&gt;, instead you can load the &lt;code&gt;DBI&lt;/code&gt; package and use &lt;code&gt;odbc::odbc()&lt;/code&gt; to reference the driver when connecting. e.g.&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;DBI&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;con&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;dbConnect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;odbc&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;odbc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;MicrosoftSQLServer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UID&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;SA&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PWD&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Password12&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;p&gt;The biggest improvements in this release are related to querying within schemas, an API for immediate execution, and a new &lt;code&gt;timezone_out&lt;/code&gt; parameter to control the displayed time of timezones returned by the query.
See the &lt;a href=&#34;https://cloud.r-project.org/web/packages/odbc/news/news.html&#34;&gt;change log&lt;/a&gt; for the full set of changes for this release.&lt;/p&gt;




&lt;h2 id=&#34;querying-schemas&#34;&gt;Querying schemas
  &lt;a href=&#34;#querying-schemas&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Use &lt;code&gt;DBI::Id()&lt;/code&gt; reference a table within a schema.
This will allow odbc to handle any quoting necessary for your particular database. e.g. you can write to a table named &lt;code&gt;my.iris&lt;/code&gt; even if there is a schema named &lt;code&gt;my&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-{r,&#34; data-lang=&#34;{r,&#34;&gt;library(DBI)

con &amp;lt;- dbConnect(odbc::odbc(), &amp;quot;MicrosoftSQLServer&amp;quot;, UID = &amp;quot;SA&amp;quot;, PWD = &amp;quot;Password12&amp;quot;)

my_tbl &amp;lt;- Id(schema = &amp;quot;my&amp;quot;, table = &amp;quot;my.iris&amp;quot;)
dbWriteTable(con, my_tbl, iris)

tbl &amp;lt;- dbReadTable(con, my_tbl)
# The quoting for &amp;quot;my&amp;quot;.&amp;quot;my.iris&amp;quot; is done automatically when 
# using DBI::Id()
tbl2 &amp;lt;- dbGetQuery(con, &#39;SELECT * FROM &amp;quot;my&amp;quot;.&amp;quot;my.iris&amp;quot;&#39;)
all.equal(tbl, tbl2)
#&amp;gt; TRUE
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This feature has actually existed for a number of odbc releases, but due to driver inconsistencies was not working properly on SQL Server, which is now fixed.&lt;/p&gt;




&lt;h2 id=&#34;immediatedirect-execution&#34;&gt;Immediate/direct execution
  &lt;a href=&#34;#immediatedirect-execution&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The odbc package uses &lt;a href=&#34;https://en.wikipedia.org/wiki/Prepared_statement&#34;&gt;Prepared Statements&lt;/a&gt; to compile the query once and reuse it, allowing large or repeated queries to be more efficient.
However, prepared statements can actually perform worse in some cases, such as many different small queries that are all only executed once.
Because of this the odbc package now also supports direct queries by specifying &lt;code&gt;immediate = TRUE&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;# This will use a prepared statement&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;dbGetQuery&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;SELECT * from iris&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# This will execute the statement directly&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;dbGetQuery&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;SELECT * from iris&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;immediate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;timezone-display&#34;&gt;Timezone display
  &lt;a href=&#34;#timezone-display&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The odbc package has historically imported date times with a &lt;code&gt;UTC&lt;/code&gt; timezone.
This ensures that the same code will produce the same output regardless of the local time.
However this can confuse users, particularly if the server timezones are stored or displayed in a non-UTC timezone.
Because of this, the odbc package now supports a &lt;code&gt;timezone_out&lt;/code&gt; parameter, which allows users to set the timezone the times should be displayed in.
Setting this to your local timezone, or the timezone of the database may reduce this confusion.&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;DBI&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;# Create a new connection, specifying a timezone_out of UTC (this is the default)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;con_utc&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;dbConnect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;odbc&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;odbc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;MicrosoftSQLServer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UID&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;SA&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PWD&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Password12&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;timezone_out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;UTC&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Create a table with the current timestamp as a value&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;dbExecute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;con_utc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;SELECT CURRENT_TIMESTAMP AS x INTO now&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] 1&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Read that table, the time is displayed in UTC&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;res_utc&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;dbReadTable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;con_utc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;now&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;res_utc&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;                     x&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 2019-11-29 15:03:59&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Create another connection, this time with the timezone in United States eastern time&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;con_est&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;dbConnect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;odbc&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;odbc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;MicrosoftSQLServer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UID&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;SA&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;PWD&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Password12&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;timezone_out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;US/Eastern&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Read the same table again, this time the time is displayed in EST&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;res_est&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;dbReadTable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;con_est&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;now&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;res_est&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;                     x&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 2019-11-29 10:03:59&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# These two times equal the same time point, the only difference is the display&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;res_utc&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;res_est&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Warning in check_tzones(e1, e2): &amp;#39;tzone&amp;#39; attributes are inconsistent&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;         x&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1,] TRUE&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# You can convert res_utc to res_est by changing the `tzone` attribute&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;attr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;res_utc&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;tzone&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;US/Eastern&amp;#34;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;res_utc&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;                     x&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 2019-11-29 10:03:59&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There were a number of additional features and bug fixes in this version, see the &lt;a href=&#34;https://cloud.r-project.org/web/packages/odbc/news/news.html&#34;&gt;change log&lt;/a&gt; for details.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to Xianying Tan, James Blair and Kirill Müller who all submitted multiple pull requests with improvements, and to all the 114 GitHub contributors who have opened issues or submitted code improvements to help make this release happen!&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/ajholguin&#34;&gt;@ajholguin&lt;/a&gt;, &lt;a href=&#34;https://github.com/ammarelsh&#34;&gt;@ammarelsh&lt;/a&gt;, &lt;a href=&#34;https://github.com/anchal02&#34;&gt;@anchal02&lt;/a&gt;, &lt;a href=&#34;https://github.com/andreaspano&#34;&gt;@andreaspano&lt;/a&gt;, &lt;a href=&#34;https://github.com/andrewsali&#34;&gt;@andrewsali&lt;/a&gt;, &lt;a href=&#34;https://github.com/arestrom&#34;&gt;@arestrom&lt;/a&gt;, &lt;a href=&#34;https://github.com/aryoda&#34;&gt;@aryoda&lt;/a&gt;, &lt;a href=&#34;https://github.com/berkorbay&#34;&gt;@berkorbay&lt;/a&gt;, &lt;a href=&#34;https://github.com/blairj09&#34;&gt;@blairj09&lt;/a&gt;, &lt;a href=&#34;https://github.com/blmayer&#34;&gt;@blmayer&lt;/a&gt;, &lt;a href=&#34;https://github.com/cboettig&#34;&gt;@cboettig&lt;/a&gt;, &lt;a href=&#34;https://github.com/cdumoulin-usgs&#34;&gt;@cdumoulin-usgs&lt;/a&gt;, &lt;a href=&#34;https://github.com/CerebralMastication&#34;&gt;@CerebralMastication&lt;/a&gt;, &lt;a href=&#34;https://github.com/cfisher5&#34;&gt;@cfisher5&lt;/a&gt;, &lt;a href=&#34;https://github.com/chrishaug&#34;&gt;@chrishaug&lt;/a&gt;, &lt;a href=&#34;https://github.com/ChristianAlvaradoAP&#34;&gt;@ChristianAlvaradoAP&lt;/a&gt;, &lt;a href=&#34;https://github.com/cnolanminich&#34;&gt;@cnolanminich&lt;/a&gt;, &lt;a href=&#34;https://github.com/colearendt&#34;&gt;@colearendt&lt;/a&gt;, &lt;a href=&#34;https://github.com/copernican&#34;&gt;@copernican&lt;/a&gt;, &lt;a href=&#34;https://github.com/crossxwill&#34;&gt;@crossxwill&lt;/a&gt;, &lt;a href=&#34;https://github.com/david-cortes&#34;&gt;@david-cortes&lt;/a&gt;, &lt;a href=&#34;https://github.com/davidchall&#34;&gt;@davidchall&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/detule&#34;&gt;@detule&lt;/a&gt;, &lt;a href=&#34;https://github.com/dhaycraft&#34;&gt;@dhaycraft&lt;/a&gt;, &lt;a href=&#34;https://github.com/dirkschumacher&#34;&gt;@dirkschumacher&lt;/a&gt;, &lt;a href=&#34;https://github.com/dpprdan&#34;&gt;@dpprdan&lt;/a&gt;, &lt;a href=&#34;https://github.com/duncanrellis&#34;&gt;@duncanrellis&lt;/a&gt;, &lt;a href=&#34;https://github.com/edgararuiz&#34;&gt;@edgararuiz&lt;/a&gt;, &lt;a href=&#34;https://github.com/elbamos&#34;&gt;@elbamos&lt;/a&gt;, &lt;a href=&#34;https://github.com/elben10&#34;&gt;@elben10&lt;/a&gt;, &lt;a href=&#34;https://github.com/etienne-s&#34;&gt;@etienne-s&lt;/a&gt;, &lt;a href=&#34;https://github.com/etiennebr&#34;&gt;@etiennebr&lt;/a&gt;, &lt;a href=&#34;https://github.com/felipegerard&#34;&gt;@felipegerard&lt;/a&gt;, &lt;a href=&#34;https://github.com/foundinblank&#34;&gt;@foundinblank&lt;/a&gt;, &lt;a href=&#34;https://github.com/Freekers&#34;&gt;@Freekers&lt;/a&gt;, &lt;a href=&#34;https://github.com/ghost&#34;&gt;@ghost&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/halpo&#34;&gt;@halpo&lt;/a&gt;, &lt;a href=&#34;https://github.com/happyshows&#34;&gt;@happyshows&lt;/a&gt;, &lt;a href=&#34;https://github.com/harrismcgehee&#34;&gt;@harrismcgehee&lt;/a&gt;, &lt;a href=&#34;https://github.com/hiltonmbr&#34;&gt;@hiltonmbr&lt;/a&gt;, &lt;a href=&#34;https://github.com/hoxo-m&#34;&gt;@hoxo-m&lt;/a&gt;, &lt;a href=&#34;https://github.com/iamsaini87&#34;&gt;@iamsaini87&lt;/a&gt;, &lt;a href=&#34;https://github.com/its-gazza&#34;&gt;@its-gazza&lt;/a&gt;, &lt;a href=&#34;https://github.com/JarkoDubbeldam&#34;&gt;@JarkoDubbeldam&lt;/a&gt;, &lt;a href=&#34;https://github.com/jasperDD&#34;&gt;@jasperDD&lt;/a&gt;, &lt;a href=&#34;https://github.com/javierluraschi&#34;&gt;@javierluraschi&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeroenhabets&#34;&gt;@jeroenhabets&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrisi256&#34;&gt;@jrisi256&lt;/a&gt;, &lt;a href=&#34;https://github.com/jsonbecker&#34;&gt;@jsonbecker&lt;/a&gt;, &lt;a href=&#34;https://github.com/jtelleria&#34;&gt;@jtelleria&lt;/a&gt;, &lt;a href=&#34;https://github.com/jtelleriar&#34;&gt;@jtelleriar&lt;/a&gt;, &lt;a href=&#34;https://github.com/juliasilge&#34;&gt;@juliasilge&lt;/a&gt;, &lt;a href=&#34;https://github.com/kbzsl&#34;&gt;@kbzsl&lt;/a&gt;, &lt;a href=&#34;https://github.com/kerry-ja&#34;&gt;@kerry-ja&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinushey&#34;&gt;@kevinushey&lt;/a&gt;, &lt;a href=&#34;https://github.com/khotilov&#34;&gt;@khotilov&lt;/a&gt;, &lt;a href=&#34;https://github.com/KimmoMW&#34;&gt;@KimmoMW&lt;/a&gt;, &lt;a href=&#34;https://github.com/kjaanson&#34;&gt;@kjaanson&lt;/a&gt;, &lt;a href=&#34;https://github.com/kohleth&#34;&gt;@kohleth&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/lee170&#34;&gt;@lee170&lt;/a&gt;, &lt;a href=&#34;https://github.com/leungi&#34;&gt;@leungi&lt;/a&gt;, &lt;a href=&#34;https://github.com/madlogos&#34;&gt;@madlogos&lt;/a&gt;, &lt;a href=&#34;https://github.com/martindut&#34;&gt;@martindut&lt;/a&gt;, &lt;a href=&#34;https://github.com/mateusz1981&#34;&gt;@mateusz1981&lt;/a&gt;, &lt;a href=&#34;https://github.com/matthijsvanderloos&#34;&gt;@matthijsvanderloos&lt;/a&gt;, &lt;a href=&#34;https://github.com/maverix13&#34;&gt;@maverix13&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxPunck&#34;&gt;@maxPunck&lt;/a&gt;, &lt;a href=&#34;https://github.com/mbfsdatascience&#34;&gt;@mbfsdatascience&lt;/a&gt;, &lt;a href=&#34;https://github.com/md0u80c9&#34;&gt;@md0u80c9&lt;/a&gt;, &lt;a href=&#34;https://github.com/meztez&#34;&gt;@meztez&lt;/a&gt;, &lt;a href=&#34;https://github.com/mhsilvav&#34;&gt;@mhsilvav&lt;/a&gt;, &lt;a href=&#34;https://github.com/mingwandroid&#34;&gt;@mingwandroid&lt;/a&gt;, &lt;a href=&#34;https://github.com/mlaviolet&#34;&gt;@mlaviolet&lt;/a&gt;, &lt;a href=&#34;https://github.com/mmastand&#34;&gt;@mmastand&lt;/a&gt;, &lt;a href=&#34;https://github.com/move%5Bbot%5D&#34;&gt;@move[bot]&lt;/a&gt;, &lt;a href=&#34;https://github.com/muranyia&#34;&gt;@muranyia&lt;/a&gt;, &lt;a href=&#34;https://github.com/nwstephens&#34;&gt;@nwstephens&lt;/a&gt;, &lt;a href=&#34;https://github.com/nzbart&#34;&gt;@nzbart&lt;/a&gt;, &lt;a href=&#34;https://github.com/patperu&#34;&gt;@patperu&lt;/a&gt;, &lt;a href=&#34;https://github.com/PatWilson&#34;&gt;@PatWilson&lt;/a&gt;, &lt;a href=&#34;https://github.com/pchiacchiari-coatue&#34;&gt;@pchiacchiari-coatue&lt;/a&gt;, &lt;a href=&#34;https://github.com/pgensler&#34;&gt;@pgensler&lt;/a&gt;, &lt;a href=&#34;https://github.com/pythiantech&#34;&gt;@pythiantech&lt;/a&gt;, &lt;a href=&#34;https://github.com/quartin&#34;&gt;@quartin&lt;/a&gt;, &lt;a href=&#34;https://github.com/r2evans&#34;&gt;@r2evans&lt;/a&gt;, &lt;a href=&#34;https://github.com/ralsouza&#34;&gt;@ralsouza&lt;/a&gt;, &lt;a href=&#34;https://github.com/renkun-ken&#34;&gt;@renkun-ken&lt;/a&gt;, &lt;a href=&#34;https://github.com/revodavid&#34;&gt;@revodavid&lt;/a&gt;, &lt;a href=&#34;https://github.com/ronblum&#34;&gt;@ronblum&lt;/a&gt;, &lt;a href=&#34;https://github.com/rtgdk&#34;&gt;@rtgdk&lt;/a&gt;, &lt;a href=&#34;https://github.com/s-fleck&#34;&gt;@s-fleck&lt;/a&gt;, &lt;a href=&#34;https://github.com/satvenkat&#34;&gt;@satvenkat&lt;/a&gt;, &lt;a href=&#34;https://github.com/scmck17&#34;&gt;@scmck17&lt;/a&gt;, &lt;a href=&#34;https://github.com/sebschub&#34;&gt;@sebschub&lt;/a&gt;, &lt;a href=&#34;https://github.com/shapenaji&#34;&gt;@shapenaji&lt;/a&gt;, &lt;a href=&#34;https://github.com/shizidushu&#34;&gt;@shizidushu&lt;/a&gt;, &lt;a href=&#34;https://github.com/shrektan&#34;&gt;@shrektan&lt;/a&gt;, &lt;a href=&#34;https://github.com/smingerson&#34;&gt;@smingerson&lt;/a&gt;, &lt;a href=&#34;https://github.com/stlouiso&#34;&gt;@stlouiso&lt;/a&gt;, &lt;a href=&#34;https://github.com/timabe&#34;&gt;@timabe&lt;/a&gt;, &lt;a href=&#34;https://github.com/totalgit74&#34;&gt;@totalgit74&lt;/a&gt;, &lt;a href=&#34;https://github.com/TTudino&#34;&gt;@TTudino&lt;/a&gt;, &lt;a href=&#34;https://github.com/UpsideDownRide&#34;&gt;@UpsideDownRide&lt;/a&gt;, &lt;a href=&#34;https://github.com/versipellis&#34;&gt;@versipellis&lt;/a&gt;, &lt;a href=&#34;https://github.com/vh-d&#34;&gt;@vh-d&lt;/a&gt;, &lt;a href=&#34;https://github.com/vpanfilov&#34;&gt;@vpanfilov&lt;/a&gt;, &lt;a href=&#34;https://github.com/warnes&#34;&gt;@warnes&lt;/a&gt;, &lt;a href=&#34;https://github.com/washcycle&#34;&gt;@washcycle&lt;/a&gt;, &lt;a href=&#34;https://github.com/wibeasley&#34;&gt;@wibeasley&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>tidyverse 1.3.0</title>
      <link>https://www.tidyverse.org/blog/2019/11/tidyverse-1-3-0/</link>
      <pubDate>Fri, 22 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/tidyverse-1-3-0/</guid>
      <description>.footnote-ref { vertical-align: baseline; position: relative; top: -0.4em; font-size: smaller; }   We&amp;rsquo;re thrilled to announce that tidyverse 1.3.0 is now on CRAN. The tidyverse is a set of packages that work in harmony because they share common data representations and API design. The tidyverse package is a &amp;ldquo;meta&amp;rdquo; package designed to make it easy to install and load core packages from the tidyverse in a single command.</description>
      <content>&lt;html&gt;
&lt;style&gt;
.footnote-ref {
    vertical-align: baseline;
    position: relative;
    top: -0.4em;
    font-size: smaller;
}
&lt;/style&gt;
&lt;/html&gt;
&lt;p&gt;We&amp;rsquo;re thrilled to announce that &lt;a href=&#34;https://tidyverse.tidyverse.org/&#34;&gt;tidyverse&lt;/a&gt; 1.3.0 is now on CRAN.
The tidyverse is a set of packages that work in harmony because they share common data representations and API design.
The tidyverse package is a &amp;ldquo;meta&amp;rdquo; package designed to make it easy to install and load core packages from the tidyverse in a single command.
This is great for teaching and interactive use, but for package development purposes we recommend that authors import only the specific packages that
they use.
For a complete list of changes, please see the &lt;a href=&#34;https://tidyverse.tidyverse.org/news/index.html#tidyverse-1-3-0&#34;&gt;release notes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can install the latest version of tidyverse with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tidyverse&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;p&gt;And, as always, attach the package by running:&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;tidyverse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;citing-the-tidyverse&#34;&gt;Citing the tidyverse
  &lt;a href=&#34;#citing-the-tidyverse&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The most significant update in this version is a new vignette, &lt;a href=&#34;https://tidyverse.tidyverse.org/articles/paper.html&#34;&gt;&amp;ldquo;Welcome to the Tidyverse&amp;rdquo;&lt;/a&gt;, which is a mirror of the recently-released paper of the same name in the &lt;a href=&#34;https://joss.theoj.org/papers/10.21105/joss.01686&#34;&gt;Journal of Open Source Software&lt;/a&gt;.
The (long) list of authors includes all members of the tidyverse organisation and its component packages, and is now the canonical way to cite tidyverse packages.&lt;/p&gt;




&lt;h3 id=&#34;when-to-cite-the-tidyverse&#34;&gt;When to cite the tidyverse
  &lt;a href=&#34;#when-to-cite-the-tidyverse&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;If you&amp;rsquo;re in a position where you can easily cite every package that materially contributed to your analysis, you should totally do it.
But it is often hard because many packages don&amp;rsquo;t have accompanying papers, and many journals still haven&amp;rsquo;t got the memo that software is an important research artifact.
Alternatively, you may be publishing in a venue with very tight page constraints
and you simply don&amp;rsquo;t have the room to cite every package.
For a more comprehensive discussion of best practices regarding citing software, see &lt;a href=&#34;https://www.force11.org/software-citation-principles&#34;&gt;Software Citation Principles&lt;/a&gt; by Arfon Smith, Daniel Katz, Kyle Niemeyer, and The FORCE11 Software Citation Working Group.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;We generally recommend citing the tidyverse paper instead of citing individual packages.
This is less work, making it more likely that people will do it, and helps concentrate the citations across the whole tidyverse into a single place, which makes it easier to show the academic merit of our work.
Of course, you&amp;rsquo;re still free to cite individual tidyverse packages if you feel like they have been particularly important for your analysis, but you shouldn&amp;rsquo;t feel obliged.&lt;/p&gt;




&lt;h3 id=&#34;how-to-cite-the-tidyverse&#34;&gt;How to cite the tidyverse
  &lt;a href=&#34;#how-to-cite-the-tidyverse&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The R &lt;a href=&#34;https://stat.ethz.ch/R-manual/R-devel/library/utils/html/citation.html&#34;&gt;&lt;code&gt;citation()&lt;/code&gt;&lt;/a&gt; function makes it easy to cite R and R packages in publications.
The latest version of the tidyverse package has the citation built in:&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;citation&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tidyverse&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   Wickham et al., (2019). Welcome to the tidyverse. Journal of Open&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; A BibTeX entry for LaTeX users is&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   @Article{,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     title = {Welcome to the {tidyverse}},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D&amp;#39;Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     year = {2019},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     journal = {Journal of Open Source Software},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     volume = {4},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     number = {43},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     pages = {1686},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     doi = {10.21105/joss.01686},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since the tidyverse wouldn&amp;rsquo;t be possible without R, we strongly recommend that you also cite R:&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;citation&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; To cite R in publications use:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   R Core Team (2019). R: A language and environment for statistical&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   computing. R Foundation for Statistical Computing, Vienna, Austria.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   URL https://www.R-project.org/.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; A BibTeX entry for LaTeX users is&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   @Manual{,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     title = {R: A Language and Environment for Statistical Computing},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     author = {{R Core Team}},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     organization = {R Foundation for Statistical Computing},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     address = {Vienna, Austria},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     year = {2019},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     url = {https://www.R-project.org/},&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   }&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; We have invested a lot of time and effort in creating R, please cite it&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; when using it for data analysis. See also &amp;#39;citation(&amp;#34;pkgname&amp;#34;)&amp;#39; for&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; citing R packages.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;acknowledgments&#34;&gt;Acknowledgments
  &lt;a href=&#34;#acknowledgments&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A huge thank you to the paper&amp;rsquo;s reviewers, &lt;a href=&#34;https://github.com/ldecicco-USGS&#34;&gt;Laura DeCicco&lt;/a&gt; and &lt;a href=&#34;https://github.com/jeffreyhanson&#34;&gt;Jeff Hanson&lt;/a&gt;, and journal editor, &lt;a href=&#34;https://github.com/karthik&#34;&gt;Karthik Ram&lt;/a&gt;, who improved the quality of the paper immensely.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;re also grateful to the 89 people who contributed to this release: &lt;a href=&#34;https://github.com/andrewheiss&#34;&gt;@andrewheiss&lt;/a&gt;, &lt;a href=&#34;https://github.com/arcole&#34;&gt;@arcole&lt;/a&gt;, &lt;a href=&#34;https://github.com/arfon&#34;&gt;@arfon&lt;/a&gt;, &lt;a href=&#34;https://github.com/Armos05&#34;&gt;@Armos05&lt;/a&gt;, &lt;a href=&#34;https://github.com/arne1921KF&#34;&gt;@arne1921KF&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/BenoitLondon&#34;&gt;@BenoitLondon&lt;/a&gt;, &lt;a href=&#34;https://github.com/bschneidr&#34;&gt;@bschneidr&lt;/a&gt;, &lt;a href=&#34;https://github.com/cawoodjm&#34;&gt;@cawoodjm&lt;/a&gt;, &lt;a href=&#34;https://github.com/christa88&#34;&gt;@christa88&lt;/a&gt;, &lt;a href=&#34;https://github.com/coatless&#34;&gt;@coatless&lt;/a&gt;, &lt;a href=&#34;https://github.com/cryptic0&#34;&gt;@cryptic0&lt;/a&gt;, &lt;a href=&#34;https://github.com/cwickham&#34;&gt;@cwickham&lt;/a&gt;, &lt;a href=&#34;https://github.com/d8aninja&#34;&gt;@d8aninja&lt;/a&gt;, &lt;a href=&#34;https://github.com/daltonhance&#34;&gt;@daltonhance&lt;/a&gt;, &lt;a href=&#34;https://github.com/dan-reznik&#34;&gt;@dan-reznik&lt;/a&gt;, &lt;a href=&#34;https://github.com/danhalligan&#34;&gt;@danhalligan&lt;/a&gt;, &lt;a href=&#34;https://github.com/DataXujing&#34;&gt;@DataXujing&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavoOZ&#34;&gt;@DavoOZ&lt;/a&gt;, &lt;a href=&#34;https://github.com/dchiu911&#34;&gt;@dchiu911&lt;/a&gt;, &lt;a href=&#34;https://github.com/dhslone&#34;&gt;@dhslone&lt;/a&gt;, &lt;a href=&#34;https://github.com/Fredo-XVII&#34;&gt;@Fredo-XVII&lt;/a&gt;, &lt;a href=&#34;https://github.com/gaborcsardi&#34;&gt;@gaborcsardi&lt;/a&gt;, &lt;a href=&#34;https://github.com/genewch&#34;&gt;@genewch&lt;/a&gt;, &lt;a href=&#34;https://github.com/grayskripko&#34;&gt;@grayskripko&lt;/a&gt;, &lt;a href=&#34;https://github.com/gvwilson&#34;&gt;@gvwilson&lt;/a&gt;, &lt;a href=&#34;https://github.com/gwd999&#34;&gt;@gwd999&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hammer&#34;&gt;@hammer&lt;/a&gt;, &lt;a href=&#34;https://github.com/harrismcgehee&#34;&gt;@harrismcgehee&lt;/a&gt;, &lt;a href=&#34;https://github.com/ijlyttle&#34;&gt;@ijlyttle&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeroen&#34;&gt;@jeroen&lt;/a&gt;, &lt;a href=&#34;https://github.com/jflynn264&#34;&gt;@jflynn264&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jnolis&#34;&gt;@jnolis&lt;/a&gt;, &lt;a href=&#34;https://github.com/JoeFernando&#34;&gt;@JoeFernando&lt;/a&gt;, &lt;a href=&#34;https://github.com/JoFAM&#34;&gt;@JoFAM&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonocarroll&#34;&gt;@jonocarroll&lt;/a&gt;, &lt;a href=&#34;https://github.com/josegonzalez&#34;&gt;@josegonzalez&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrosen48&#34;&gt;@jrosen48&lt;/a&gt;, &lt;a href=&#34;https://github.com/jtelleria&#34;&gt;@jtelleria&lt;/a&gt;, &lt;a href=&#34;https://github.com/jzadra&#34;&gt;@jzadra&lt;/a&gt;, &lt;a href=&#34;https://github.com/karawoo&#34;&gt;@karawoo&lt;/a&gt;, &lt;a href=&#34;https://github.com/karthik&#34;&gt;@karthik&lt;/a&gt;, &lt;a href=&#34;https://github.com/kent37&#34;&gt;@kent37&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinushey&#34;&gt;@kevinushey&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinykuo&#34;&gt;@kevinykuo&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/ljmills&#34;&gt;@ljmills&lt;/a&gt;, &lt;a href=&#34;https://github.com/malcolmbarrett&#34;&gt;@malcolmbarrett&lt;/a&gt;, &lt;a href=&#34;https://github.com/maptracker&#34;&gt;@maptracker&lt;/a&gt;, &lt;a href=&#34;https://github.com/martinamorris&#34;&gt;@martinamorris&lt;/a&gt;, &lt;a href=&#34;https://github.com/martinjhnhadley&#34;&gt;@martinjhnhadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/MartinMSPedersen&#34;&gt;@MartinMSPedersen&lt;/a&gt;, &lt;a href=&#34;https://github.com/mattsgithub&#34;&gt;@mattsgithub&lt;/a&gt;, &lt;a href=&#34;https://github.com/maurolepore&#34;&gt;@maurolepore&lt;/a&gt;, &lt;a href=&#34;https://github.com/mfherman&#34;&gt;@mfherman&lt;/a&gt;, &lt;a href=&#34;https://github.com/mgsosna&#34;&gt;@mgsosna&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikeyEcology&#34;&gt;@mikeyEcology&lt;/a&gt;, &lt;a href=&#34;https://github.com/mloop&#34;&gt;@mloop&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/msberends&#34;&gt;@msberends&lt;/a&gt;, &lt;a href=&#34;https://github.com/njtierney&#34;&gt;@njtierney&lt;/a&gt;, &lt;a href=&#34;https://github.com/osmelmillan&#34;&gt;@osmelmillan&lt;/a&gt;, &lt;a href=&#34;https://github.com/pgensler&#34;&gt;@pgensler&lt;/a&gt;, &lt;a href=&#34;https://github.com/PoGibas&#34;&gt;@PoGibas&lt;/a&gt;, &lt;a href=&#34;https://github.com/psychelzh&#34;&gt;@psychelzh&lt;/a&gt;, &lt;a href=&#34;https://github.com/rkalescky&#34;&gt;@rkalescky&lt;/a&gt;, &lt;a href=&#34;https://github.com/rmcd1024&#34;&gt;@rmcd1024&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/rsheppar&#34;&gt;@rsheppar&lt;/a&gt;, &lt;a href=&#34;https://github.com/sampath2510&#34;&gt;@sampath2510&lt;/a&gt;, &lt;a href=&#34;https://github.com/Selvamjn&#34;&gt;@Selvamjn&lt;/a&gt;, &lt;a href=&#34;https://github.com/SinfantiHU&#34;&gt;@SinfantiHU&lt;/a&gt;, &lt;a href=&#34;https://github.com/steenharsted&#34;&gt;@steenharsted&lt;/a&gt;, &lt;a href=&#34;https://github.com/stefvanbuuren&#34;&gt;@stefvanbuuren&lt;/a&gt;, &lt;a href=&#34;https://github.com/steveharoz&#34;&gt;@steveharoz&lt;/a&gt;, &lt;a href=&#34;https://github.com/sulgik&#34;&gt;@sulgik&lt;/a&gt;, &lt;a href=&#34;https://github.com/talban14&#34;&gt;@talban14&lt;/a&gt;, &lt;a href=&#34;https://github.com/thanosgatos&#34;&gt;@thanosgatos&lt;/a&gt;, &lt;a href=&#34;https://github.com/tmalsburg&#34;&gt;@tmalsburg&lt;/a&gt;, &lt;a href=&#34;https://github.com/toouggy&#34;&gt;@toouggy&lt;/a&gt;, &lt;a href=&#34;https://github.com/topepo&#34;&gt;@topepo&lt;/a&gt;, &lt;a href=&#34;https://github.com/tsufz&#34;&gt;@tsufz&lt;/a&gt;, &lt;a href=&#34;https://github.com/willbowditch&#34;&gt;@willbowditch&lt;/a&gt;, &lt;a href=&#34;https://github.com/XiangyunHuang&#34;&gt;@XiangyunHuang&lt;/a&gt;, &lt;a href=&#34;https://github.com/yatharth&#34;&gt;@yatharth&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;.&lt;/p&gt;
&lt;section class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;Smith AM, Katz DS, Niemeyer KE, FORCE11 Software Citation Working Group. (2016) Software Citation Principles. &lt;em&gt;PeerJ Computer Science&lt;/em&gt; 2:e86. doi: &lt;a href=&#34;https://doi.org/10.7717/peerj-cs.86&#34;&gt;10.7717/peerj-cs.86&lt;/a&gt;. &lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
    </item>
    
    <item>
      <title>scales 1.1.0</title>
      <link>https://www.tidyverse.org/blog/2019/11/scales-1-1-0/</link>
      <pubDate>Mon, 18 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/scales-1-1-0/</guid>
      <description>We&amp;rsquo;re thrilled to announce the release of scales 1.1.0. The scales package provides much of the infrastructure that underlies ggplot2&amp;rsquo;s scales, and using it allow you to customize the transformations, breaks, and labels used by ggplot2. Get the latest version with:
install.packages(&amp;#34;scales&amp;#34;) The biggest improvements in this release are related to usability and documentation:
  Axis breaks and labels have a new naming scheme: functions that generate breaks from limits are called breaks_; functions that generate labels from breaks are called labels_.</description>
      <content>&lt;p&gt;We&amp;rsquo;re thrilled to announce the release of &lt;a href=&#34;https://scales.r-lib.org/&#34;&gt;scales&lt;/a&gt; 1.1.0.
The scales package provides much of the infrastructure that underlies ggplot2&amp;rsquo;s scales, and using it allow you to customize the transformations, breaks, and labels used by ggplot2. Get the latest version with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;scales&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;p&gt;The biggest improvements in this release are related to usability and documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Axis breaks and labels have a new naming scheme: functions that generate
breaks from limits are called &lt;code&gt;breaks_&lt;/code&gt;; functions that generate labels
from breaks are called &lt;code&gt;labels_&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;All the examples for breaks and labels have been overhauled to use new
&lt;code&gt;demo_continuous()&lt;/code&gt;, &lt;code&gt;demo_discrete()&lt;/code&gt;, and &lt;code&gt;demo_log10()&lt;/code&gt;. These make
it much easier to see how you&amp;rsquo;d use scales functions with ggplot2, so
when you&amp;rsquo;re &lt;a href=&#34;https://scales.r-lib.org/reference/index.html&#34;&gt;browsing the documentation&lt;/a&gt;,
you can immediately see how the functions work with ggplot2.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&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;scales&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There are also a few new breaks and labels functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;New &lt;a href=&#34;https://scales.r-lib.org/reference/breaks_width.html&#34;&gt;&lt;code&gt;breaks_width()&lt;/code&gt;&lt;/a&gt;
allows you to specify the distance between breaks rather than the number
of them.&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;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;breaks_width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(breaks = breaks_width(10))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-3-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://scales.r-lib.org/reference/label_number.html&#34;&gt;&lt;code&gt;label_number()&lt;/code&gt;&lt;/a&gt; and
&lt;a href=&#34;https://scales.r-lib.org/reference/label_percent.html&#34;&gt;&lt;code&gt;label_percent()&lt;/code&gt;&lt;/a&gt;
do a better job of picking the default &lt;code&gt;accuracy&lt;/code&gt;, which means that you
should generally get the correct number of decimal place by default.&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;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;labels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_number&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(labels = label_number())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&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;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;labels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_percent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(labels = label_percent())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-4-2.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;New &lt;a href=&#34;https://scales.r-lib.org/reference/label_bytes.html&#34;&gt;&lt;code&gt;label_bytes()&lt;/code&gt;&lt;/a&gt;
replaces &lt;code&gt;number_bytes_format()&lt;/code&gt; with a more convenient interface. It takes
a single &lt;code&gt;unit&lt;/code&gt; argument which can either be an SI unit (e.g. &amp;ldquo;kB&amp;rdquo;), a
binary unit (e.g. &amp;ldquo;kIB&amp;rdquo;), or an automatic unit (either &amp;ldquo;auto_si&amp;rdquo; or
&amp;ldquo;auto_binary&amp;rdquo;).&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;# default is &amp;#34;auto_si&amp;#34;&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1e6&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;label&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_bytes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(label = label_bytes())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-5-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&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;# supply a unit if you want all labels to use the same unit&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1e6&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;label&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_bytes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;kB&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(label = label_bytes(&amp;#34;kB&amp;#34;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-5-2.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;New &lt;a href=&#34;https://scales.r-lib.org/reference/label_number_auto.html&#34;&gt;&lt;code&gt;label_number_auto()&lt;/code&gt;&lt;/a&gt;
automatically picks between &lt;code&gt;label_number()&lt;/code&gt; and &lt;code&gt;label_scientific()&lt;/code&gt; based
on the range of the input. It should produce compact labels over a very wide
range of inputs. We are considering making this the default labeller for
a future version of ggplot2.&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;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1e5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;labels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_number_auto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(labels = label_number_auto())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-6-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&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;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1e10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;labels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_number_auto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(labels = label_number_auto())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-6-2.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;New &lt;a href=&#34;https://scales.r-lib.org/reference/label_number_si.html&#34;&gt;&lt;code&gt;label_number_si()&lt;/code&gt;&lt;/a&gt;
formats numeric vectors with SI units.&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;demo_continuous&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1e9&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;label&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_number_si&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_continuous(label = label_number_si())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-7-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&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;demo_log10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1e9&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;log_breaks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;labels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_number_si&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_log10(breaks = log_breaks(10), labels = label_number_si())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-7-2.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;New &lt;a href=&#34;https://scales.r-lib.org/reference/label_date.html&#34;&gt;&lt;code&gt;label_date_short()&lt;/code&gt;&lt;/a&gt;
creates labels for a date axis that only show the components of the date
that have changed since the previous label.&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;five_months&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;as.POSIXct&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;2019-11-01&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;2020-03-01&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;demo_datetime&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;five_months&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_datetime()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-8-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&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;demo_datetime&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;five_months&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;labels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;label_date_short&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; scale_x_datetime(labels = label_date_short())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;figs/unnamed-chunk-8-2.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the &lt;a href=&#34;https://scales.r-lib.org/news/index.html#scales-1-1-0&#34;&gt;change log&lt;/a&gt; for a full list of changes and bug fixes in this version.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A big thanks to all the GitHub contributors who helped make this release happen! &lt;a href=&#34;https://github.com/agila5&#34;&gt;@agila5&lt;/a&gt;, &lt;a href=&#34;https://github.com/Anirudhsekar96&#34;&gt;@Anirudhsekar96&lt;/a&gt;, &lt;a href=&#34;https://github.com/apsalverda&#34;&gt;@apsalverda&lt;/a&gt;, &lt;a href=&#34;https://github.com/b-lev&#34;&gt;@b-lev&lt;/a&gt;, &lt;a href=&#34;https://github.com/bhogan-mitre&#34;&gt;@bhogan-mitre&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/bjedwards&#34;&gt;@bjedwards&lt;/a&gt;, &lt;a href=&#34;https://github.com/bkkkk&#34;&gt;@bkkkk&lt;/a&gt;, &lt;a href=&#34;https://github.com/blairj09&#34;&gt;@blairj09&lt;/a&gt;, &lt;a href=&#34;https://github.com/clauswilke&#34;&gt;@clauswilke&lt;/a&gt;, &lt;a href=&#34;https://github.com/const-ae&#34;&gt;@const-ae&lt;/a&gt;, &lt;a href=&#34;https://github.com/davidmasp&#34;&gt;@davidmasp&lt;/a&gt;, &lt;a href=&#34;https://github.com/dpseidel&#34;&gt;@dpseidel&lt;/a&gt;, &lt;a href=&#34;https://github.com/eliocamp&#34;&gt;@eliocamp&lt;/a&gt;, &lt;a href=&#34;https://github.com/GegznaV&#34;&gt;@GegznaV&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/HenrikBengtsson&#34;&gt;@HenrikBengtsson&lt;/a&gt;, &lt;a href=&#34;https://github.com/hvaret&#34;&gt;@hvaret&lt;/a&gt;, &lt;a href=&#34;https://github.com/jcheng5&#34;&gt;@jcheng5&lt;/a&gt;, &lt;a href=&#34;https://github.com/kiernann&#34;&gt;@kiernann&lt;/a&gt;, &lt;a href=&#34;https://github.com/kuriwaki&#34;&gt;@kuriwaki&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikmart&#34;&gt;@mikmart&lt;/a&gt;, &lt;a href=&#34;https://github.com/njtierney&#34;&gt;@njtierney&lt;/a&gt;, &lt;a href=&#34;https://github.com/paleolimbot&#34;&gt;@paleolimbot&lt;/a&gt;, &lt;a href=&#34;https://github.com/sada1993&#34;&gt;@sada1993&lt;/a&gt;, &lt;a href=&#34;https://github.com/schloerke&#34;&gt;@schloerke&lt;/a&gt;, &lt;a href=&#34;https://github.com/sflippl&#34;&gt;@sflippl&lt;/a&gt;, &lt;a href=&#34;https://github.com/slowkow&#34;&gt;@slowkow&lt;/a&gt;, &lt;a href=&#34;https://github.com/sobrietie&#34;&gt;@sobrietie&lt;/a&gt;, &lt;a href=&#34;https://github.com/tdawry&#34;&gt;@tdawry&lt;/a&gt;, &lt;a href=&#34;https://github.com/teramonagi&#34;&gt;@teramonagi&lt;/a&gt;, &lt;a href=&#34;https://github.com/thomasp85&#34;&gt;@thomasp85&lt;/a&gt;, &lt;a href=&#34;https://github.com/topepo&#34;&gt;@topepo&lt;/a&gt;, &lt;a href=&#34;https://github.com/tungmilan&#34;&gt;@tungmilan&lt;/a&gt;, &lt;a href=&#34;https://github.com/turgeonmaxime&#34;&gt;@turgeonmaxime&lt;/a&gt;, &lt;a href=&#34;https://github.com/wibeasley&#34;&gt;@wibeasley&lt;/a&gt;, &lt;a href=&#34;https://github.com/woodwards&#34;&gt;@woodwards&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zamorarr&#34;&gt;@zamorarr&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>dtplyr 1.0.0</title>
      <link>https://www.tidyverse.org/blog/2019/11/dtplyr-1-0-0/</link>
      <pubDate>Tue, 12 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/dtplyr-1-0-0/</guid>
      <description>I&amp;rsquo;m very excited to announce that dtplyr 1.0.0 is now on CRAN. dtplyr provides a data.table backend for dplyr, allowing you to write dplyr code that is automatically translated to the equivalent data.table code.
dtplyr 1.0.0 gives you the speed of data.table with the syntax of dplyr, unlocking the value of data.table to every user of dplyr. Of course, if you know data.table, you can still write it directly, just as we expect SQL experts to continue to write SQL rather than having dbplyr generate it for them.</description>
      <content>&lt;p&gt;I&amp;rsquo;m very excited to announce that &lt;a href=&#34;https://dtplyr.tidyverse.org&#34;&gt;dtplyr&lt;/a&gt; 1.0.0 is now on CRAN. dtplyr provides a &lt;a href=&#34;http://r-datatable.com/&#34;&gt;data.table&lt;/a&gt; backend for dplyr, allowing you to write dplyr code that is automatically translated to the equivalent data.table code.&lt;/p&gt;
&lt;p&gt;dtplyr 1.0.0 gives you the speed of data.table with the syntax of dplyr, unlocking the value of data.table to every user of dplyr. Of course, if you know data.table, you can still write it directly, just as we expect SQL experts to continue to write SQL rather than having &lt;a href=&#34;http://dbplyr.tidyverse.org/&#34;&gt;dbplyr&lt;/a&gt; generate it for them. Understanding these foundational tools is particularly important if you want to eke out every last drop of performance.&lt;/p&gt;
&lt;p&gt;This version of dtplyr is a complete rewrite which allows it to generate significantly more performant translations. dtplyr now works like &lt;a href=&#34;https://dbplyr.tidyverse.org&#34;&gt;dbplyr&lt;/a&gt;, where computation only happens when requested by  &lt;code&gt;as.data.table()&lt;/code&gt;, &lt;code&gt;as.data.frame()&lt;/code&gt; or &lt;code&gt;as_tibble()&lt;/code&gt; (this idea can also be seen in the &lt;a href=&#34;https://github.com/asardaes/table.express&#34;&gt;table.express&lt;/a&gt; and &lt;a href=&#34;https://github.com/WinVector/rqdatatable/&#34;&gt;rqdatatable&lt;/a&gt; packages). Unfortunately, this rewrite breaks pretty much all existing uses of dtplyr. But frankly, the prior version of dtplyr was not very good and few people used it, so a major overhaul should break little code in the wild.&lt;/p&gt;
&lt;p&gt;In this article, I&amp;rsquo;ll introduce you to the basic usage of dtplyr, talk about some of the performance implications, and show off some of the translations that I&amp;rsquo;m most proud of.&lt;/p&gt;




&lt;h2 id=&#34;usage&#34;&gt;Usage
  &lt;a href=&#34;#usage&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;To use dtplyr, you must at least load dtplyr and dplyr. You might also want to load &lt;a href=&#34;http://r-datatable.com/&#34;&gt;data.table&lt;/a&gt; so you can access the other goodies that it provides:&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;data.table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;dtplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;dplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;warn.conflicts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then use &lt;code&gt;lazy_dt()&lt;/code&gt; to create a &amp;ldquo;lazy&amp;rdquo; data table that tracks the operations performed on it:&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;mtcars2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can use dplyr verbs with this object as if it was a data frame. But there&amp;rsquo;s a big difference behind the scenes: instead of immediately performing the operation, dtplyr just records what you&amp;rsquo;re doing so when needed it can generate a single, efficient, data.table statement. You can preview the transformation (including the generated data.table code) by printing the result:&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;mtcars2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;wt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&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;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;235.21&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mpg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;# liters / 100 km&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cyl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Source: local data table [?? x 2]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call:   `_DT1`[wt &amp;lt; 5][, `:=`(l100k = 235.21/mpg)][, .(l100k = mean(l100k)), &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     keyby = .(cyl)]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     cyl l100k&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1     4  9.05&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2     6 12.0 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3     8 14.9 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Use as.data.table()/as.data.frame()/as_tibble() to access results&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Generally, however, you should reserve this preview for exploration and debugging, and instead use &lt;code&gt;as.data.table()&lt;/code&gt;, &lt;code&gt;as.data.frame()&lt;/code&gt;, or &lt;code&gt;as_tibble()&lt;/code&gt; to indicate that you&amp;rsquo;re done writing the transformation and want to access the results:&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;mtcars2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;wt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&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;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;235.21&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mpg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;# liters / 100 km&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cyl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 3 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     cyl l100k&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1     4  9.05&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2     6 12.0 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3     8 14.9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;performance&#34;&gt;Performance
  &lt;a href=&#34;#performance&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;How fast is dtplyr? data.table is generally faster than dplyr, but dtplyr has to do some work to perform the translation, so it&amp;rsquo;s reasonable to ask if it&amp;rsquo;s worth it. Do the benefits of using data.table outweigh the cost of the automated translation? My experimentation suggests that it is: the cost of translation is low, and independent of the size of the data. In this section, I&amp;rsquo;ll explore the performance trade-off through three lenses: translation cost, copies, and interface mismatch.&lt;/p&gt;




&lt;h3 id=&#34;translation-cost&#34;&gt;Translation cost
  &lt;a href=&#34;#translation-cost&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;Each dplyr verb must do some work to convert dplyr syntax to data.table syntax. We can use the &lt;a href=&#34;http://bench.r-lib.org/&#34;&gt;bench&lt;/a&gt; package to time the cost of the four-step pipeline that I used above:&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;bench&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;mark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;translate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mtcars2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;wt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&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;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;235.21&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mpg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;# liters / 100 km&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cyl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l100k&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 1 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   expression      min   median `itr/sec` mem_alloc `gc/sec`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;bch:expr&amp;gt; &amp;lt;bch:tm&amp;gt; &amp;lt;bch:tm&amp;gt;     &amp;lt;dbl&amp;gt; &amp;lt;bch:byt&amp;gt;    &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 translate     787µs    969µs     1028.      280B     26.4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Because this pipeline does not use &lt;code&gt;as.data.table()&lt;/code&gt; or &lt;code&gt;print()&lt;/code&gt; it only generates the data.table code, it doesn&amp;rsquo;t run it, so we&amp;rsquo;re timing the translation cost. The translation cost scales with the complexity of the pipeline, not the size of the data, so these timings will apply regardless of the size of the underlying data.&lt;/p&gt;
&lt;p&gt;My intial experiments suggest that the translation cost is typically a few milliseconds. Since the computational cost increases with the size of the data, the translation cost becomes a smaller proportion of the total as the data size grows, suggesting the dtplyr does not impose a significant overhead on top of data.table.&lt;/p&gt;
&lt;p&gt;Take the following example, which uses the large nycflights13 dataset. This isn&amp;rsquo;t really big enough for data.table to really shine, but it&amp;rsquo;s about as big as you can get in an R package. Here I&amp;rsquo;m going to compute the average arrival delay by destination. It takes raw dplyr about 40ms to do the work. Again, the dtplyr translation is fast, around 1ms, and then computation using data.table only takes about 20ms, almost twice as fast as dplyr.&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;nycflights13&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;flights_dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;flights&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;delay_by_dest&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;is.na&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;arr_delay&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;delay&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;arr_delay&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;bench&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;mark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;flights&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;delay_by_dest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;flights_dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;delay_by_dest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;flights_dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;delay_by_dest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;check&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 3 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   expression                                         min  median `itr/sec`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;bch:expr&amp;gt;                                     &amp;lt;bch:t&amp;gt; &amp;lt;bch:t&amp;gt;     &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 flights %&amp;gt;% delay_by_dest()                     35.7ms    36ms      27.8&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 flights_dt %&amp;gt;% delay_by_dest()                 671.9µs 824.6µs    1230. &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 flights_dt %&amp;gt;% delay_by_dest() %&amp;gt;% as_tibble()  18.7ms  20.2ms      48.0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 2 more variables: mem_alloc &amp;lt;bch:byt&amp;gt;, `gc/sec` &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3 id=&#34;copies&#34;&gt;Copies
  &lt;a href=&#34;#copies&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;There is one place where dtplyr does have to add overhead: when translations would generate data.table code that modifies the input in place, like &lt;code&gt;mutate()&lt;/code&gt;. dtplyr matches dplyr semantics (which never modifies in place), so most expressions involving &lt;code&gt;mutate()&lt;/code&gt; must make a copy:&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;mtcars2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; copy(`_DT1`)[, `:=`(x = x * 2)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, dtplyr never generates more than one copy (no matter how many mutates you use), and it also recognises many situations where data.table creates an implicit copy:&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;mtcars2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; copy(`_DT1`)[, `:=`(y = x * 2)][, `:=`(z = y * 2)]&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;mtcars2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT1`[x == 1][, `:=`(x = x * 2)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;However, if you have very datasets, creating a deep copy can be expensive. dtplyr allows you to opt out by setting &lt;code&gt;immutable = FALSE&lt;/code&gt;. This ensures that dtplyr never makes a copy:&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;mtcars3&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;as.data.table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;immutable&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;mtcars3&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT3`[, `:=`(x2 = x * 2)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3 id=&#34;interface-mismatch&#34;&gt;Interface mismatch
  &lt;a href=&#34;#interface-mismatch&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The hardest overhead to measure is the cost of interface mismatch, i.e. where data.table has features that dplyr doesn&amp;rsquo;t. For example, there&amp;rsquo;s no way to express cross- or rolling-joins with dplyr, so there&amp;rsquo;s no way to generate efficient data.table code for these cases. It&amp;rsquo;s hard to estimate this cost, but it&amp;rsquo;s something that we think about when considering what features to add to dplyr next.&lt;/p&gt;




&lt;h2 id=&#34;translation&#34;&gt;Translation
  &lt;a href=&#34;#translation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;If you&amp;rsquo;re familiar with data.table, you might be interested to learn more about how the translation works. Here I&amp;rsquo;ll show a few things I think are particularly interesting, using &lt;code&gt;show_query()&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;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;data.frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#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;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#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;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#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;n&#34;&gt;d&lt;/span&gt; &lt;span class=&#34;o&#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;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Most uses of the basic dplyr verbs generate calls to &lt;code&gt;[.data.table&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;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;d&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[, .(a, b)]&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[, .(x = mean(x))]&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; copy(`_DT4`)[, `:=`(x = a + b)]&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[a == 1]&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;arrange&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;desc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[order(a, desc(b))]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As do simple left and right joins:&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;dt2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_dt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;data.frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;left_join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dt2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT5`[`_DT4`, on = .(a), allow.cartesian = TRUE]&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;right_join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dt2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[`_DT5`, on = .(a), allow.cartesian = TRUE]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Where possible, dtplyr will collapse multiple calls to &lt;code&gt;[&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;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[a == 1, .(b, c, d)]&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;left_join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dt2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT5`[`_DT4`, .(a, b, z), on = .(a), allow.cartesian = TRUE]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But note that the order is important, as a &lt;code&gt;select()&lt;/code&gt; followed by a &lt;code&gt;filter()&lt;/code&gt; has to generate two statements:&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;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[, .(a = b)][a == 1]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When you mix basic dplyr verbs with &lt;code&gt;group_by()&lt;/code&gt;, dtplyr adds the &lt;code&gt;keyby&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;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[, .(b = mean(b)), keyby = .(a)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And when filtering, this automatically uses &lt;code&gt;.SD&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;n&#34;&gt;dt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;show_query&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; `_DT4`[, .SD[b &amp;lt; mean(b)], keyby = .(a)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can learn more in &lt;a href=&#34;https://dtplyr.tidyverse.org/articles/translation.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;translation&amp;quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are a couple of limitations that I hope to address in the next version of dtplyr. Currently, you can&amp;rsquo;t translate &lt;a href=&#34;https://github.com/tidyverse/dtplyr/issues/109&#34;&gt;the &lt;code&gt;_if&lt;/code&gt; variants&lt;/a&gt;, and there is weak support for the &lt;a href=&#34;https://github.com/tidyverse/dtplyr/issues/108&#34;&gt;&lt;code&gt;group_&lt;/code&gt; functions&lt;/a&gt;. If you discover other functions that don&amp;rsquo;t work as you expect, &lt;a href=&#34;https://github.com/tidyverse/dtplyr/issues/new/choose&#34;&gt;please file an issue!&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Big thanks to the data.table community, particularly &lt;a href=&#34;https://github.com/MichaelChirico&#34;&gt;Michael Chirico&lt;/a&gt;, for their help educating me on the best way to translate dplyr code into performant, idiomatic, data.table code.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;d also like to thank everyone to helped make this release happen through their contributions on GitHub: &lt;a href=&#34;https://github.com/AlanFeder&#34;&gt;@AlanFeder&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/benjaminleroy&#34;&gt;@benjaminleroy&lt;/a&gt;, &lt;a href=&#34;https://github.com/clayphan&#34;&gt;@clayphan&lt;/a&gt;, &lt;a href=&#34;https://github.com/ColinFay&#34;&gt;@ColinFay&lt;/a&gt;, &lt;a href=&#34;https://github.com/daranzolin&#34;&gt;@daranzolin&lt;/a&gt;, &lt;a href=&#34;https://github.com/edgararuiz&#34;&gt;@edgararuiz&lt;/a&gt;, &lt;a href=&#34;https://github.com/franknarf1&#34;&gt;@franknarf1&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hlynurhallgrims&#34;&gt;@hlynurhallgrims&lt;/a&gt;, &lt;a href=&#34;https://github.com/hope-data-science&#34;&gt;@hope-data-science&lt;/a&gt;, &lt;a href=&#34;https://github.com/ianmcook&#34;&gt;@ianmcook&lt;/a&gt;, &lt;a href=&#34;https://github.com/jl5000&#34;&gt;@jl5000&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;@jonthegeek&lt;/a&gt;, &lt;a href=&#34;https://github.com/JoshuaSturm&#34;&gt;@JoshuaSturm&lt;/a&gt;, &lt;a href=&#34;https://github.com/lenay12&#34;&gt;@lenay12&lt;/a&gt;, &lt;a href=&#34;https://github.com/MichaelChirico&#34;&gt;@MichaelChirico&lt;/a&gt;, &lt;a href=&#34;https://github.com/nlbjan1&#34;&gt;@nlbjan1&lt;/a&gt;, &lt;a href=&#34;https://github.com/quantitative-technologies&#34;&gt;@quantitative-technologies&lt;/a&gt;, &lt;a href=&#34;https://github.com/richpauloo&#34;&gt;@richpauloo&lt;/a&gt;, &lt;a href=&#34;https://github.com/S-UP&#34;&gt;@S-UP&lt;/a&gt;, &lt;a href=&#34;https://github.com/tmastny&#34;&gt;@tmastny&lt;/a&gt;, &lt;a href=&#34;https://github.com/TobiRoby&#34;&gt;@TobiRoby&lt;/a&gt;, &lt;a href=&#34;https://github.com/tomazweiss&#34;&gt;@tomazweiss&lt;/a&gt;, &lt;a href=&#34;https://github.com/torema-ed&#34;&gt;@torema-ed&lt;/a&gt;, &lt;a href=&#34;https://github.com/Vidaringa&#34;&gt;@Vidaringa&lt;/a&gt;, &lt;a href=&#34;https://github.com/vlahm&#34;&gt;@vlahm&lt;/a&gt;, &lt;a href=&#34;https://github.com/vspinu&#34;&gt;@vspinu&lt;/a&gt;, &lt;a href=&#34;https://github.com/xiaodaigh&#34;&gt;@xiaodaigh&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yiqinfu&#34;&gt;@yiqinfu&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>roxygen2 7.0.0</title>
      <link>https://www.tidyverse.org/blog/2019/11/roxygen2-7-0-0/</link>
      <pubDate>Tue, 12 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/roxygen2-7-0-0/</guid>
      <description>We&amp;rsquo;re exceedingly happy to announce the release of roxygen2 7.0.0. roxygen2 allows you to write specially formatted R comments that generate R documentation files (man/*.Rd) and a NAMESPACE file. roxygen2 is used by over 8,000 CRAN packages.
Install the latest version of roxygen2 with:
install.packages(&amp;#34;roxygen2&amp;#34;) This a huge release containing many minor improvements and bug fixes. This blog post focusses on seven major improvements:
  roxygen2 is no longer (ironically!</description>
      <content>&lt;p&gt;We&amp;rsquo;re exceedingly happy to announce the release of &lt;a href=&#34;https://roxygen2.r-lib.org&#34;&gt;roxygen2 7.0.0&lt;/a&gt;. roxygen2 allows you to write specially formatted R comments that generate R documentation files (&lt;code&gt;man/*.Rd&lt;/code&gt;) and a &lt;code&gt;NAMESPACE&lt;/code&gt; file. roxygen2 is used by over 8,000 CRAN packages.&lt;/p&gt;
&lt;p&gt;Install the latest version of roxygen2 with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;roxygen2&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;p&gt;This a huge release containing &lt;a href=&#34;https://roxygen2.r-lib.org/news/index.html#roxygen2-7-0-0&#34;&gt;many minor improvements and bug fixes&lt;/a&gt;. This blog post focusses on seven major improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;roxygen2 is no longer (ironically!) the worst documented package. It has a
fresh new website, &lt;a href=&#34;https://roxygen2.r-lib.org&#34;&gt;https://roxygen2.r-lib.org&lt;/a&gt;, and the vignettes have
all been updated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We&amp;rsquo;ve made a number of tweaks to the rendering of &lt;code&gt;.Rd&lt;/code&gt;. Most importantly
you no longer needed to escape &lt;code&gt;%&lt;/code&gt; in markdown, and functions with many
arguments are displayed with one argument per line. We&amp;rsquo;ve also removed a
couple of old features that are no longer supported.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can create tables and headings from markdown.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can share text and code between your README/vignettes and your
documentation with the new &lt;code&gt;@includeRmd&lt;/code&gt; tag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can now document R6 classes!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A package can declare how roxygen2 should load its code, making it easier to
use roxygen2 in wider variety of workflows.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;roxygen2 has a documented extension mechanism so that it&amp;rsquo;s easy to implement
new tags and new roclets in other packages.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;improved-documentation&#34;&gt;Improved documentation
  &lt;a href=&#34;#improved-documentation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;roxygen2 finally (!!) has a &lt;a href=&#34;https://pkgdown.r-lib.org/&#34;&gt;pkgdown&lt;/a&gt; website!&lt;/p&gt;
&lt;p&gt;I used this as an opportunity to look at all the vignettes and make sure they are comprehensive and readable. These are now the best place to go if you want more details on any roxygen2 tag:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://roxygen2.r-lib.org/articles/rd.html&#34;&gt;Rd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://roxygen2.r-lib.org/articles/rd-formatting.html&#34;&gt;Inline Rd formatting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://roxygen2.r-lib.org/articles/namespace.html&#34;&gt;&lt;code&gt;NAMESPACE&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Of course, documentation can always be improved, so if you find something hard to follow, please &lt;a href=&#34;https://github.com/r-lib/roxygen2/issues/new&#34;&gt;file an issue&lt;/a&gt;!&lt;/p&gt;




&lt;h2 id=&#34;changes-to-rd-output&#34;&gt;Changes to &lt;code&gt;.Rd&lt;/code&gt; output
  &lt;a href=&#34;#changes-to-rd-output&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;When you run roxygen2 7.0.0 for the first time, you&amp;rsquo;ll notice a number of changes to the rendered &lt;code&gt;.Rd&lt;/code&gt;. The two most important are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;%&lt;/code&gt; (the Rd comment symbol) is now automatically escaped in markdown text. That means if you previously escaped it with &lt;code&gt;\%&lt;/code&gt;, you&amp;rsquo;ll need to remove the backslash and take it back to &lt;code&gt;%&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you forget to do this, you&amp;rsquo;ll see confusing &lt;code&gt;R CMD check&lt;/code&gt; notes like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;unknown macro &#39;\item&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unexpected section header &#39;\description&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unexpected END_OF_INPUT&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &amp;ldquo;Usage&amp;rdquo; section, you&amp;rsquo;ll notice the formatting of function calls has changed. Previously, function calls were wrapped to produce the smallest number of lines, e.g.:&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;parse_package&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;path&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;env&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;env_package&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;registry&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;default_tags&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;global_options&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now long function calls are wrapped so that each argument gets its own line:&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;parse_package&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;path&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;env&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;env_package&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;registry&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;default_tags&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;global_options&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you prefer the old behaviour you can put the following in your
&lt;code&gt;DESCRIPTION&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Roxygen: list(old_usage = TRUE)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;rsquo;ll also notice a number of small improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Markdown code is converted to to either &lt;code&gt;\code{}&lt;/code&gt; or &lt;code&gt;\verb{}&lt;/code&gt;, depending on
whether it not is valid R code. For example, &lt;code&gt;`foofy()`&lt;/code&gt; will become
&lt;code&gt;\code{foofy()}&lt;/code&gt; but &lt;code&gt;`1 +`&lt;/code&gt; will become &lt;code&gt;\verb{1 + }&lt;/code&gt;. This better
matches the intended usage of the &lt;code&gt;\code{}&lt;/code&gt; and &lt;code&gt;\verb{}&lt;/code&gt; macros, and should
make it easier to include arbitrary &amp;ldquo;code&amp;rdquo; snippets in documentation without
causing Rd failures.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;@family&lt;/code&gt; automatically adds &lt;code&gt;()&lt;/code&gt; when linking to functions,
and prints each link on its own line (to improve diffs).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&amp;rsquo;ve also removed a few features to simplify the code and/or clearly advertise that certain features are no longer supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;@S3method&lt;/code&gt; has been removed. It was deprecated in roxygen2 4.0.0
released 2014-05-02, over 5 years ago.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Using the &lt;code&gt;wrap&lt;/code&gt; option will now trigger a warning, as it hasn&amp;rsquo;t worked
for quite some time. Suppress the warning by remove the option from your
&lt;code&gt;DESCRIPTION&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;@docType package&lt;/code&gt; will no longer add &lt;code&gt;-name&lt;/code&gt; to the file name. If you relied
on this, either switch to the
&lt;a href=&#34;https://roxygen2.r-lib.org/articles/rd.html#packages&#34;&gt;new workflow&lt;/a&gt;, or
use &lt;code&gt;@name&lt;/code&gt; to manaully override the default file name.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;markdown-improvements&#34;&gt;Markdown improvements
  &lt;a href=&#34;#markdown-improvements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;There are two major improvements to roxygen2&amp;rsquo;s markdown support: you can now use markdown headers and tables.&lt;/p&gt;
&lt;p&gt;Markdown headings can be used in top-level tags like &lt;code&gt;@description&lt;/code&gt;, &lt;code&gt;@details&lt;/code&gt;, and &lt;code&gt;@returns&lt;/code&gt;. Level 1 headings create a new top-level &lt;code&gt;\section{}&lt;/code&gt; and Level 2 headings (and below) create nested &lt;code&gt;\subsection{}&lt;/code&gt;s:&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;#&amp;#39; @details&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; First sentence&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; ## Subheading&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; Second sentence&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; # New section&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; Third sentence&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;is translated to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;\details{
  First sentence

  \subsection{Subheading}{
    Second sentence
  }
}
\section{New section}{
  Third sentence
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Markdown tables use the &lt;a href=&#34;https://github.github.com/gfm/#tables-extension-&#34;&gt;GFM table syntax&lt;/a&gt; and are converted to &lt;code&gt;\tabular{}&lt;/code&gt; macros. For example,&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;#&amp;#39; | foo | bar |&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; | :-- | --: |&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; | baz | bim |&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;is translated to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;\tabular{lr}{
   foo \tab bar \cr
   baz \tab bim \cr
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Lastly, using unsupported markdown features (like blockquotes, inline HTML, and horizontal rules) will now produce an informative message.&lt;/p&gt;




&lt;h2 id=&#34;includermd&#34;&gt;&lt;code&gt;@includeRmd&lt;/code&gt;
  &lt;a href=&#34;#includermd&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;@includeRmd&lt;/code&gt; provides a new tool that allows you to share text and code amongst &lt;code&gt;.Rmd&lt;/code&gt;  and &lt;code&gt;.Rd&lt;/code&gt;. For example, if you have &lt;code&gt;vignettes/common.Rmd&lt;/code&gt;, you can include it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;In documentation, with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#&#39; @includeRmd vignettes/common.Rmd
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In other vignettes with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```{r child = &amp;quot;common.Rmd&amp;quot;}
```
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In &lt;code&gt;README.Rmd&lt;/code&gt;, with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```{r child = &amp;quot;vignettes/common.Rmd&amp;quot;}
```
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Learn more in
&lt;a href=&#34;https://roxygen2.r-lib.org/articles/rd.html#including-external--rmd-md-files&#34;&gt;&lt;code&gt;vignette(&amp;quot;rd&amp;quot;)&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2 id=&#34;r6-documentation&#34;&gt;R6 documentation
  &lt;a href=&#34;#r6-documentation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;You can now document R6 classes! The basic usage is straighforward and works similarly to documenting functions. The main difference is that methods require explicit &lt;code&gt;@description&lt;/code&gt; and &lt;code&gt;@detail&lt;/code&gt; tags.&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;#&amp;#39; R6 Class representing a person&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;#39; A person has a name and a hair color.&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;Person&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;R6&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;R6Class&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Person&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @field name First or full name of the person.&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;

    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @field hair Hair color of the person.&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;hair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;

    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @description&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; Create a new person object.&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @param name Name.&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @param hair Hair color.&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @return A new `Person` object.&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;initialize&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NA&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NA&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
      &lt;span class=&#34;n&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;
      &lt;span class=&#34;n&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hair&lt;/span&gt;
      &lt;span class=&#34;n&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;greet&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;

    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @description&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; Change hair color.&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @param val New hair color.&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @examples&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; P &amp;lt;- Person(&amp;#34;Ann&amp;#34;, &amp;#34;black&amp;#34;)&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; P$hair&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; P$set_hair(&amp;#34;red&amp;#34;)&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; P$hair&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;set_hair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;val&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
      &lt;span class=&#34;n&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;val&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;

    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; @description&lt;/span&gt;
    &lt;span class=&#34;c1&#34;&gt;#&amp;#39; Say hi.&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;greet&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
      &lt;span class=&#34;nf&#34;&gt;cat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&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;Hello, my name is &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;.\n&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Learn more in &lt;a href=&#34;https://roxygen2.r-lib.org/articles/rd.html#r6&#34;&gt;&lt;code&gt;vignette(&amp;quot;rd&amp;quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;R6 documentation is a work in progress, so please let us know if you find anything missing or confusing. If you document a package with many R6 classes, you will get many warnings about missing documentation. If you want to suppress those warnings, you can turn off R6 documetation with the &lt;code&gt;r6&lt;/code&gt; option, i.e. put &lt;code&gt;Roxygen: list(r6 = FALSE)&lt;/code&gt; in your &lt;code&gt;DESCRIPTION&lt;/code&gt;.&lt;/p&gt;




&lt;h2 id=&#34;code-loading&#34;&gt;Code loading
  &lt;a href=&#34;#code-loading&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;roxygen2 now provides three strategies for loading your code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;load_pkgload()&lt;/code&gt;, the default, uses &lt;a href=&#34;https://www.github.com/r-lib/pkgload&#34;&gt;pkgload&lt;/a&gt;.
Compared to the previous release, this now automatically recompiles your
package if needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;load_source()&lt;/code&gt; attaches required packages and &lt;code&gt;source()&lt;/code&gt;s all files in &lt;code&gt;R/&lt;/code&gt;.
This is a cruder simulation of package loading than pkgload (and e.g. is
unreliable if you use S4 extensively), but it does not require that the
package be compiled. Try it if the default strategy (used in roxygen2 6.1.0
and above) causes you grief.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;load_installed()&lt;/code&gt; assumes you have installed the package. This is best
used as part of a bigger automated workflow.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can override the default either by calling (e.g.) &lt;code&gt;roxygenise(load_code = &amp;quot;source&amp;quot;)&lt;/code&gt; or by setting the &lt;code&gt;load&lt;/code&gt; option in your DESCRIPTION: &lt;code&gt;Roxygen: list(load = &amp;quot;source&amp;quot;)&lt;/code&gt;.&lt;/p&gt;




&lt;h2 id=&#34;extending-roxygen2&#34;&gt;Extending roxygen2
  &lt;a href=&#34;#extending-roxygen2&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The process for extending roxygen2 with new tags and new roclets has been completely overhauled, and is now documented in &lt;a href=&#34;https://roxygen2.r-lib.org/articles/extending.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;extending&amp;quot;)&lt;/code&gt;&lt;/a&gt;. A big thanks goes to &lt;a href=&#34;https://github.com/mikldk&#34;&gt;Mikkel Meyer Andersen&lt;/a&gt; for starting on the vignette and motivating me to make the extension process much more pleasant.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re one of the few people who have written a roxygen2 extension, sorry for breaking your code! But I genuinely believe that the improvements to the documentation, object structure, and print methods make it worth it. If you have previously made a new roclet, see the major changes in the &lt;a href=&#34;https://github.com/r-lib/roxygen2/blob/master/NEWS.md#extending-roxygen2&#34;&gt;news&lt;/a&gt;. Since this interface is now documented, it will not change again without warning and a deprecation cycle.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A big thanks to all 69 contributors who helped make this giant release possible!  &lt;a href=&#34;https://github.com/achubaty&#34;&gt;@achubaty&lt;/a&gt;, &lt;a href=&#34;https://github.com/adam52&#34;&gt;@adam52&lt;/a&gt;, &lt;a href=&#34;https://github.com/alaagalal&#34;&gt;@alaagalal&lt;/a&gt;, &lt;a href=&#34;https://github.com/andrewmarx&#34;&gt;@andrewmarx&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/Bisaloo&#34;&gt;@Bisaloo&lt;/a&gt;, &lt;a href=&#34;https://github.com/coolbutuseless&#34;&gt;@coolbutuseless&lt;/a&gt;, &lt;a href=&#34;https://github.com/DominiqueMakowski&#34;&gt;@DominiqueMakowski&lt;/a&gt;, &lt;a href=&#34;https://github.com/drjxf&#34;&gt;@drjxf&lt;/a&gt;, &lt;a href=&#34;https://github.com/EmilBode&#34;&gt;@EmilBode&lt;/a&gt;, &lt;a href=&#34;https://github.com/espinielli&#34;&gt;@espinielli&lt;/a&gt;, &lt;a href=&#34;https://github.com/Freguglia&#34;&gt;@Freguglia&lt;/a&gt;, &lt;a href=&#34;https://github.com/gaborcsardi&#34;&gt;@gaborcsardi&lt;/a&gt;, &lt;a href=&#34;https://github.com/gdurif&#34;&gt;@gdurif&lt;/a&gt;, &lt;a href=&#34;https://github.com/gustavdelius&#34;&gt;@gustavdelius&lt;/a&gt;, &lt;a href=&#34;https://github.com/ha0ye&#34;&gt;@ha0ye&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/halldc&#34;&gt;@halldc&lt;/a&gt;, &lt;a href=&#34;https://github.com/HenrikBengtsson&#34;&gt;@HenrikBengtsson&lt;/a&gt;, &lt;a href=&#34;https://github.com/hongyuanjia&#34;&gt;@hongyuanjia&lt;/a&gt;, &lt;a href=&#34;https://github.com/huangwb8&#34;&gt;@huangwb8&lt;/a&gt;, &lt;a href=&#34;https://github.com/iembry&#34;&gt;@iembry&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/inmybrain&#34;&gt;@inmybrain&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackwasey&#34;&gt;@jackwasey&lt;/a&gt;, &lt;a href=&#34;https://github.com/JazzyPierrot&#34;&gt;@JazzyPierrot&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeroen&#34;&gt;@jeroen&lt;/a&gt;, &lt;a href=&#34;https://github.com/jhchou&#34;&gt;@jhchou&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;@jonthegeek&lt;/a&gt;, &lt;a href=&#34;https://github.com/kenahoo&#34;&gt;@kenahoo&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinrue&#34;&gt;@kevinrue&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinushey&#34;&gt;@kevinushey&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/leej3&#34;&gt;@leej3&lt;/a&gt;, &lt;a href=&#34;https://github.com/leepface&#34;&gt;@leepface&lt;/a&gt;, &lt;a href=&#34;https://github.com/lorenzwalthert&#34;&gt;@lorenzwalthert&lt;/a&gt;, &lt;a href=&#34;https://github.com/mamueller&#34;&gt;@mamueller&lt;/a&gt;, &lt;a href=&#34;https://github.com/maurolepore&#34;&gt;@maurolepore&lt;/a&gt;, &lt;a href=&#34;https://github.com/michaelquinn32&#34;&gt;@michaelquinn32&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikemc&#34;&gt;@mikemc&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikldk&#34;&gt;@mikldk&lt;/a&gt;, &lt;a href=&#34;https://github.com/mjskay&#34;&gt;@mjskay&lt;/a&gt;, &lt;a href=&#34;https://github.com/mnazarov&#34;&gt;@mnazarov&lt;/a&gt;, &lt;a href=&#34;https://github.com/msberends&#34;&gt;@msberends&lt;/a&gt;, &lt;a href=&#34;https://github.com/msenn&#34;&gt;@msenn&lt;/a&gt;, &lt;a href=&#34;https://github.com/nealrichardson&#34;&gt;@nealrichardson&lt;/a&gt;, &lt;a href=&#34;https://github.com/NikKrieger&#34;&gt;@NikKrieger&lt;/a&gt;, &lt;a href=&#34;https://github.com/nteetor&#34;&gt;@nteetor&lt;/a&gt;, &lt;a href=&#34;https://github.com/paleolimbot&#34;&gt;@paleolimbot&lt;/a&gt;, &lt;a href=&#34;https://github.com/pat-s&#34;&gt;@pat-s&lt;/a&gt;, &lt;a href=&#34;https://github.com/peterdesmet&#34;&gt;@peterdesmet&lt;/a&gt;, &lt;a href=&#34;https://github.com/phargarten2&#34;&gt;@phargarten2&lt;/a&gt;, &lt;a href=&#34;https://github.com/ramiromagno&#34;&gt;@ramiromagno&lt;/a&gt;, &lt;a href=&#34;https://github.com/Robinlovelace&#34;&gt;@Robinlovelace&lt;/a&gt;, &lt;a href=&#34;https://github.com/sfirke&#34;&gt;@sfirke&lt;/a&gt;, &lt;a href=&#34;https://github.com/Shians&#34;&gt;@Shians&lt;/a&gt;, &lt;a href=&#34;https://github.com/SoerenXD&#34;&gt;@SoerenXD&lt;/a&gt;, &lt;a href=&#34;https://github.com/stefanoborini&#34;&gt;@stefanoborini&lt;/a&gt;, &lt;a href=&#34;https://github.com/SteveBronder&#34;&gt;@SteveBronder&lt;/a&gt;, &lt;a href=&#34;https://github.com/tbates&#34;&gt;@tbates&lt;/a&gt;, &lt;a href=&#34;https://github.com/thalesmello&#34;&gt;@thalesmello&lt;/a&gt;, &lt;a href=&#34;https://github.com/the-knife&#34;&gt;@the-knife&lt;/a&gt;, &lt;a href=&#34;https://github.com/thomasp85&#34;&gt;@thomasp85&lt;/a&gt;, &lt;a href=&#34;https://github.com/trestletech&#34;&gt;@trestletech&lt;/a&gt;, &lt;a href=&#34;https://github.com/vivekbhr&#34;&gt;@vivekbhr&lt;/a&gt;, and &lt;a href=&#34;https://github.com/wenjie2wang&#34;&gt;@wenjie2wang&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>haven 2.2.0</title>
      <link>https://www.tidyverse.org/blog/2019/11/haven-2-2-0/</link>
      <pubDate>Fri, 08 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/haven-2-2-0/</guid>
      <description>We&amp;rsquo;re delighted to announce that haven 2.2.0 is now on CRAN. haven enables R to read and write various data formats used by other statistical packages by wrapping the ReadStat C library written by Evan Miller.
You can install haven from CRAN with:
install.packages(&amp;#34;haven&amp;#34;) This release features big improvements thanks to the hard work of Mikko Marttila: all read_*() functions gain three new arguments that allow you to read in only part of a large file.</description>
      <content>&lt;p&gt;We&amp;rsquo;re delighted to announce that &lt;a href=&#34;https://haven.tidyverse.org/&#34;&gt;haven 2.2.0&lt;/a&gt; is now on CRAN. haven enables R to read and write various data formats used by other statistical packages by wrapping the &lt;a href=&#34;https://github.com/WizardMac/ReadStat&#34;&gt;ReadStat&lt;/a&gt; C library written by &lt;a href=&#34;https://www.evanmiller.org/&#34;&gt;Evan Miller&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can install haven from CRAN with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;haven&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;p&gt;This release features big improvements thanks to the hard work of &lt;a href=&#34;https://github.com/mikmart&#34;&gt;Mikko Marttila&lt;/a&gt;: all &lt;code&gt;read_*()&lt;/code&gt; functions gain three new arguments that allow you to read in only part of a large file. I&amp;rsquo;ll quickly show of these features by saving out the &lt;a href=&#34;https://ggplot2.tidyverse.org/reference/diamonds.html&#34;&gt;&lt;code&gt;diamonds&lt;/code&gt;&lt;/a&gt; dataset to a Stata file:&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;haven&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;write_dta&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ggplot2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;diamonds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;diamonds.dta&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;p&gt;&lt;code&gt;n_max&lt;/code&gt; and &lt;code&gt;skip&lt;/code&gt; allow you to read in just a portion of the rows:&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;read_dta&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;diamonds.dta&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n_max&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;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   carat         cut     color   clarity depth table price     x     y     z&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;dbl&amp;gt;   &amp;lt;dbl+lbl&amp;gt; &amp;lt;dbl+lbl&amp;gt; &amp;lt;dbl+lbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 0.23  5 [Ideal]       2 [E]   2 [SI2]  61.5    55   326  3.95  3.98  2.43&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 0.21  4 [Premium]     2 [E]   3 [SI1]  59.8    61   326  3.89  3.84  2.31&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 0.23  2 [Good]        2 [E]   5 [VS1]  56.9    65   327  4.05  4.07  2.31&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 0.290 4 [Premium]     6 [I]   4 [VS2]  62.4    58   334  4.2   4.23  2.63&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 0.31  2 [Good]        7 [J]   2 [SI2]  63.3    58   335  4.34  4.35  2.75&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;read_dta&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;diamonds.dta&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;skip&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n_max&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;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   carat          cut     color  clarity depth table price     x     y     z&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;dbl&amp;gt;    &amp;lt;dbl+lbl&amp;gt; &amp;lt;dbl+lbl&amp;gt; &amp;lt;dbl+lb&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1  0.31 2 [Good]         7 [J] 2 [SI2]   63.3    58   335  4.34  4.35  2.75&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2  0.24 3 [Very Goo…     7 [J] 6 [VVS2]  62.8    57   336  3.94  3.96  2.48&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3  0.24 3 [Very Goo…     6 [I] 7 [VVS1]  62.3    57   336  3.95  3.98  2.47&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4  0.26 3 [Very Goo…     5 [H] 3 [SI1]   61.9    55   337  4.07  4.11  2.53&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5  0.22 1 [Fair]         2 [E] 4 [VS2]   65.1    61   337  3.87  3.78  2.49&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And &lt;code&gt;col_select()&lt;/code&gt; allows you to read in just some of the columns, using the same syntax that you use with &lt;a href=&#34;https://dplyr.tidyverse.org/reference/select.html&#34;&gt;&lt;code&gt;dplyr::select()&lt;/code&gt;&lt;/a&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;read_dta&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;diamonds.dta&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_select&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 53,940 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;        x     y     z&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1  3.95  3.98  2.43&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2  3.89  3.84  2.31&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3  4.05  4.07  2.31&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4  4.2   4.23  2.63&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5  4.34  4.35  2.75&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6  3.94  3.96  2.48&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7  3.95  3.98  2.47&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8  4.07  4.11  2.53&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9  3.87  3.78  2.49&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10  4     4.05  2.39&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 53,930 more rows&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;read_dta&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;diamonds.dta&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_select&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;starts_with&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;c&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 53,940 x 4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    carat           cut     color   clarity&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;dbl&amp;gt;     &amp;lt;dbl+lbl&amp;gt; &amp;lt;dbl+lbl&amp;gt; &amp;lt;dbl+lbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 0.23  5 [Ideal]         2 [E]  2 [SI2] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 0.21  4 [Premium]       2 [E]  3 [SI1] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 0.23  2 [Good]          2 [E]  5 [VS1] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 0.290 4 [Premium]       6 [I]  4 [VS2] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 0.31  2 [Good]          7 [J]  2 [SI2] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 0.24  3 [Very Good]     7 [J]  6 [VVS2]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 0.24  3 [Very Good]     6 [I]  7 [VVS1]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 0.26  3 [Very Good]     5 [H]  3 [SI1] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 0.22  1 [Fair]          2 [E]  4 [VS2] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 0.23  3 [Very Good]     5 [H]  5 [VS1] &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 53,930 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These features allow you to read in datasets that would otherwise not fit in memory, and should substantially improve performance when you only need a few rows or columns from a large file.&lt;/p&gt;
&lt;p&gt;This release includes a number of other bug fixes and small improvements, see the &lt;a href=&#34;https://haven.tidyverse.org/news/index.html&#34;&gt;changelog&lt;/a&gt; for a complete list.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A big thanks to everyone who helped out with this release:
&lt;a href=&#34;https://github.com/aaronrudkin&#34;&gt;@aaronrudkin&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/ccccfys&#34;&gt;@ccccfys&lt;/a&gt;, &lt;a href=&#34;https://github.com/courtiol&#34;&gt;@courtiol&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/Hadsga&#34;&gt;@Hadsga&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeremy17-Endo&#34;&gt;@jeremy17-Endo&lt;/a&gt;, &lt;a href=&#34;https://github.com/KyleHaynes&#34;&gt;@KyleHaynes&lt;/a&gt;, &lt;a href=&#34;https://github.com/lguangyu&#34;&gt;@lguangyu&lt;/a&gt;, &lt;a href=&#34;https://github.com/mihagazvoda&#34;&gt;@mihagazvoda&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikmart&#34;&gt;@mikmart&lt;/a&gt;, &lt;a href=&#34;https://github.com/MokeEire&#34;&gt;@MokeEire&lt;/a&gt;, &lt;a href=&#34;https://github.com/npaszty&#34;&gt;@npaszty&lt;/a&gt;, &lt;a href=&#34;https://github.com/pvanheus&#34;&gt;@pvanheus&lt;/a&gt;, &lt;a href=&#34;https://github.com/RaymondBalise&#34;&gt;@RaymondBalise&lt;/a&gt;, &lt;a href=&#34;https://github.com/sclewis23&#34;&gt;@sclewis23&lt;/a&gt;, &lt;a href=&#34;https://github.com/shubham1637&#34;&gt;@shubham1637&lt;/a&gt;, &lt;a href=&#34;https://github.com/sigbertklinke&#34;&gt;@sigbertklinke&lt;/a&gt;, &lt;a href=&#34;https://github.com/steffen-stell&#34;&gt;@steffen-stell&lt;/a&gt;, and &lt;a href=&#34;https://github.com/ttrodrigz&#34;&gt;@ttrodrigz&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>testthat 2.3.0</title>
      <link>https://www.tidyverse.org/blog/2019/11/testthat-2-3-0/</link>
      <pubDate>Wed, 06 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/testthat-2-3-0/</guid>
      <description>We&amp;rsquo;re pumped to announce that testthat 2.3.0 is now available on CRAN! testthat makes it easy to turn your existing informal tests into formal automated tests that you can rerun quickly and easily. testthat is the most popular unit-testing package for R, and is used by over 4,000 CRAN and Bioconductor packages. You can learn more about unit testing at https://r-pkgs.org/tests.html.
(We didn&amp;rsquo;t write a blog post about testthat 2.2.0 because it only introduced a single, experimental, new feature: verify_output().</description>
      <content>&lt;p&gt;We&amp;rsquo;re pumped to announce that &lt;a href=&#34;http://testthat.r-lib.org&#34;&gt;testthat 2.3.0&lt;/a&gt; is now available on CRAN!
testthat makes it easy to turn your existing informal tests into formal automated tests that you can rerun quickly and easily.
testthat is the most popular unit-testing package for R, and is used by over 4,000 CRAN and Bioconductor packages.
You can learn more about unit testing at &lt;a href=&#34;https://r-pkgs.org/tests.html&#34;&gt;https://r-pkgs.org/tests.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(We didn&amp;rsquo;t write a blog post about testthat 2.2.0 because it only introduced a single, experimental, new feature: &lt;code&gt;verify_output()&lt;/code&gt;.
It has now matured to the point we think you should also try it out, so it&amp;rsquo;s discussed below.)&lt;/p&gt;
&lt;p&gt;Install the latest version of testthat with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;testthat&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;p&gt;This release features two main improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A general overhaul of condition and error handling.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A polished &lt;code&gt;verify_output()&lt;/code&gt; that is ready for you to use to test your
print methods and error messages.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a complete list of changes, please see the &lt;a href=&#34;https://testthat.r-lib.org/news/index.html#testthat-2-3-0&#34;&gt;release notes&lt;/a&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;testthat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;errors&#34;&gt;Errors
  &lt;a href=&#34;#errors&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The main improvements are mostly behind the scenes: we have overhauled the handling of errors and backtraces so that you should get more informative outputs when tests error unexpectedly or fail.
It&amp;rsquo;s hard to authentically demonstrate this in an RMarkdown document, but if you have an error inside a test, 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;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;h&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;stop&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;This is an error!&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;test_that&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;f() works as expected&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;expect_equal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You&amp;rsquo;ll now get an informative backtrace that should allow you to quickly locate the source of the error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;test-error.R:6: error: f() works as expected
This is an error!
Backtrace:
 1. testthat::expect_equal(f(), 10) tests/testthat/test-error.R:6:2
 4. testthat:::f()
 5. testthat:::g() tests/testthat/test-catch.R:1:5
 6. testthat:::h() tests/testthat/test-catch.R:2:5
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The previous version only showed the error message, which wasn&amp;rsquo;t terribly useful!&lt;/p&gt;




&lt;h2 id=&#34;verify_output&#34;&gt;&lt;code&gt;verify_output()&lt;/code&gt;
  &lt;a href=&#34;#verify_output&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;verify_output()&lt;/code&gt; is designed to test output aimed at a human, like print methods and error messages.
Here you want to test that the output is useful to a human, but there&amp;rsquo;s obviously no way to do that automatically.
Instead, the best you can do is to check the results with your eyeballs every time the results change.
&lt;code&gt;verify_output()&lt;/code&gt; is designed to help you do this, making it a type of visual regression test.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll need to use &lt;code&gt;verify_output()&lt;/code&gt; in concert with git.
Whenever the output changes, you&amp;rsquo;ll get a test failure, but to see the change, you&amp;rsquo;ll need to use git.
If the change is correct, commit it with git.
If it&amp;rsquo;s incorrect, fix your code and rerun the tests.
Once fixed, the git diff will disappear.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;verify_output()&lt;/code&gt; works a little like RMarkdown: you give it some R code and it will run it, interleaving the input and output.
For example, imagine we were writing some tests to check that tibbles print correctly:&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;test_that&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tibbles print usefully&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;verify_output&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;test_path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;test-print-dataframe.txt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;df1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#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;1e6&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;print&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That test yields a &lt;code&gt;test-print-dataframe.txt&lt;/code&gt; containing this output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; df1 &amp;lt;- tibble(x = 1:1e+06)
&amp;gt; print(df1)
# A tibble: 1,000,000 x 1
       x
   &amp;lt;int&amp;gt;
 1     1
 2     2
 3     3
 4     4
 5     5
 6     6
 7     7
 8     8
 9     9
10    10
# ... with 999,990 more rows

&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Unfortunately, there&amp;rsquo;s no way for &lt;code&gt;verify_output()&lt;/code&gt; to capture comments, so you can instead use bare strings if you want comments to appear in the output. If you start the comment with &lt;code&gt;#&lt;/code&gt; it will be formatted as a heading:&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;test_that&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tibbles print usefully&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;verify_output&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;test_path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;test-print-dataframe-2.txt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;s&#34;&gt;&amp;#34;# long tibbles&amp;#34;&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;df1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#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;1e6&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;print&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    
    &lt;span class=&#34;s&#34;&gt;&amp;#34;# wide tibbles&amp;#34;&lt;/span&gt;
    &lt;span class=&#34;s&#34;&gt;&amp;#34;not yet written&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;})&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;
long tibbles
============

&amp;gt; df1 &amp;lt;- tibble(x = 1:1e+06)
&amp;gt; print(df1)
# A tibble: 1,000,000 x 1
       x
   &amp;lt;int&amp;gt;
 1     1
 2     2
 3     3
 4     4
 5     5
 6     6
 7     7
 8     8
 9     9
10    10
# ... with 999,990 more rows


wide tibbles
============

&amp;gt; # not yet written
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;verify_output()&lt;/code&gt; is automatically skipped when run on CRAN.
This avoids false positives because it&amp;rsquo;s very easy to accidentally depend on the code from other packages, and failure does not imply incorrect computation, just a change in presentation.
In other words, &lt;code&gt;verify_output()&lt;/code&gt; is meant to monitor the evolution of outputs produced by your package rather than checking for regressions.
In this way, it is similar to the &lt;a href=&#34;http://vdiffr.r-lib.org/&#34;&gt;vdiffr&lt;/a&gt; extension to testthat which uses the same approach to monitor the evolution of plots.&lt;/p&gt;




&lt;h2 id=&#34;acknoweldgements&#34;&gt;Acknoweldgements
  &lt;a href=&#34;#acknoweldgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A big thanks to everyone who helped make this version happen!
&lt;a href=&#34;https://github.com/aaronrudkin&#34;&gt;@aaronrudkin&lt;/a&gt;, &lt;a href=&#34;https://github.com/aneudecker&#34;&gt;@aneudecker&lt;/a&gt;, &lt;a href=&#34;https://github.com/atheriel&#34;&gt;@atheriel&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/cimentadaj&#34;&gt;@cimentadaj&lt;/a&gt;, &lt;a href=&#34;https://github.com/CorradoLanera&#34;&gt;@CorradoLanera&lt;/a&gt;, &lt;a href=&#34;https://github.com/cosi1&#34;&gt;@cosi1&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/dtm2451&#34;&gt;@dtm2451&lt;/a&gt;, &lt;a href=&#34;https://github.com/EmielSchmeink&#34;&gt;@EmielSchmeink&lt;/a&gt;, &lt;a href=&#34;https://github.com/flying-sheep&#34;&gt;@flying-sheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/gaborcsardi&#34;&gt;@gaborcsardi&lt;/a&gt;, &lt;a href=&#34;https://github.com/gdurif&#34;&gt;@gdurif&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hughjonesd&#34;&gt;@hughjonesd&lt;/a&gt;, &lt;a href=&#34;https://github.com/ianmcook&#34;&gt;@ianmcook&lt;/a&gt;, &lt;a href=&#34;https://github.com/jameslamb&#34;&gt;@jameslamb&lt;/a&gt;, &lt;a href=&#34;https://github.com/jcheng5&#34;&gt;@jcheng5&lt;/a&gt;, &lt;a href=&#34;https://github.com/jcubic&#34;&gt;@jcubic&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeroen&#34;&gt;@jeroen&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jozefhajnala&#34;&gt;@jozefhajnala&lt;/a&gt;, &lt;a href=&#34;https://github.com/jpritikin&#34;&gt;@jpritikin&lt;/a&gt;, &lt;a href=&#34;https://github.com/keesh0&#34;&gt;@keesh0&lt;/a&gt;, &lt;a href=&#34;https://github.com/kenahoo&#34;&gt;@kenahoo&lt;/a&gt;, &lt;a href=&#34;https://github.com/KrishanBhasin&#34;&gt;@KrishanBhasin&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/lorenzwalthert&#34;&gt;@lorenzwalthert&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxheld83&#34;&gt;@maxheld83&lt;/a&gt;, &lt;a href=&#34;https://github.com/mcol&#34;&gt;@mcol&lt;/a&gt;, &lt;a href=&#34;https://github.com/MichaelChirico&#34;&gt;@MichaelChirico&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkurdej&#34;&gt;@mkurdej&lt;/a&gt;, &lt;a href=&#34;https://github.com/MLopez-Ibanez&#34;&gt;@MLopez-Ibanez&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/mwmclean&#34;&gt;@mwmclean&lt;/a&gt;, &lt;a href=&#34;https://github.com/Nachtfeuer&#34;&gt;@Nachtfeuer&lt;/a&gt;, &lt;a href=&#34;https://github.com/nalzok&#34;&gt;@nalzok&lt;/a&gt;, &lt;a href=&#34;https://github.com/nbenn&#34;&gt;@nbenn&lt;/a&gt;, &lt;a href=&#34;https://github.com/oxr463&#34;&gt;@oxr463&lt;/a&gt;, &lt;a href=&#34;https://github.com/patr1ckm&#34;&gt;@patr1ckm&lt;/a&gt;, &lt;a href=&#34;https://github.com/richierocks&#34;&gt;@richierocks&lt;/a&gt;, &lt;a href=&#34;https://github.com/rillig&#34;&gt;@rillig&lt;/a&gt;, &lt;a href=&#34;https://github.com/sebastiangonsal&#34;&gt;@sebastiangonsal&lt;/a&gt;, &lt;a href=&#34;https://github.com/shrektan&#34;&gt;@shrektan&lt;/a&gt;, &lt;a href=&#34;https://github.com/StevenMaude&#34;&gt;@StevenMaude&lt;/a&gt;, &lt;a href=&#34;https://github.com/tdhock&#34;&gt;@tdhock&lt;/a&gt;, &lt;a href=&#34;https://github.com/theclue&#34;&gt;@theclue&lt;/a&gt;, &lt;a href=&#34;https://github.com/tjbell&#34;&gt;@tjbell&lt;/a&gt;, &lt;a href=&#34;https://github.com/topepo&#34;&gt;@topepo&lt;/a&gt;, &lt;a href=&#34;https://github.com/torbjorn&#34;&gt;@torbjorn&lt;/a&gt;, &lt;a href=&#34;https://github.com/trevorld&#34;&gt;@trevorld&lt;/a&gt;, &lt;a href=&#34;https://github.com/wlandau&#34;&gt;@wlandau&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zappingseb&#34;&gt;@zappingseb&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Tidyverse dev day 2020</title>
      <link>https://www.tidyverse.org/blog/2019/11/tidyverse-dev-day-2020/</link>
      <pubDate>Tue, 05 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/tidyverse-dev-day-2020/</guid>
      <description>We&amp;rsquo;re thrilled to announce that we&amp;rsquo;ll be holding our next tidyverse developer day on the Friday following rstudio::conf in San Francisco. The event will take place from 9:00 AM – 5:00 PM at Microsoft Reactor, which is about a mile away from the conference venue (though you&amp;rsquo;re welcome to attend even if you&amp;rsquo;re not coming to the conferece).
 📆 When: 31 January, 9 am – 5 pm. 🌉 Where: Microsoft Reactor, San Francisco.</description>
      <content>&lt;p&gt;We&amp;rsquo;re thrilled to announce that we&amp;rsquo;ll be holding our next &lt;a href=&#34;https://tdd-2019-jan.eventbrite.com/&#34;&gt;&lt;strong&gt;tidyverse developer day&lt;/strong&gt;&lt;/a&gt; on the Friday following &lt;a href=&#34;https://www.rstudio.com/conference/&#34;&gt;rstudio::conf&lt;/a&gt; in San Francisco. The event will take place from 9:00 AM – 5:00 PM at &lt;a href=&#34;https://goo.gl/maps/WkTivUvisfvVPRxt8&#34;&gt;Microsoft Reactor&lt;/a&gt;, which is about a mile away from the conference venue (though you&amp;rsquo;re welcome to attend even if you&amp;rsquo;re not coming to the conferece).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;📆 &lt;strong&gt;When:&lt;/strong&gt; 31 January, 9 am – 5 pm.&lt;/li&gt;
&lt;li&gt;🌉 &lt;strong&gt;Where:&lt;/strong&gt; &lt;a href=&#34;https://goo.gl/maps/WkTivUvisfvVPRxt8&#34;&gt;Microsoft Reactor, San Francisco&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;👥 &lt;strong&gt;Who:&lt;/strong&gt; Anyone who would like to get better at contributing to the tidyverse!&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;What:&lt;/strong&gt; A day of learning and coding. We&amp;rsquo;ll provide lunch, snacks, and coffee; you&amp;rsquo;ll bring your laptop and enthusiasm. The tidyverse team will be on hand to help out and answer your questions.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;tickets-&#34;&gt;Tickets 🎫
  &lt;a href=&#34;#tickets-&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Tickets are &lt;a href=&#34;https://www.eventbrite.com/e/tidyverse-developer-day-jan-2020-tickets-79952497071&#34;&gt;&lt;strong&gt;on sale
now&lt;/strong&gt;!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Tickets cost $10; we&amp;rsquo;re charging a small fee because space is limited. All fees
will be donated to a non-profit.&lt;/p&gt;
&lt;p&gt;Want to know more? Read about the &lt;a href=&#34;https://www.tidyverse.org/blog/2019/09/tidy-dev-day-toulouse/&#34;&gt;last tidy dev day&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;code-of-conduct&#34;&gt;Code of conduct
  &lt;a href=&#34;#code-of-conduct&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;All attendees will be expected to follow the &lt;a href=&#34;https://github.com/tidyverse/dev-day-2019/blob/master/CODE_OF_CONDUCT.md&#34;&gt;Code of Conduct&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>styler 1.2.0</title>
      <link>https://www.tidyverse.org/blog/2019/11/styler-1-2-0/</link>
      <pubDate>Mon, 04 Nov 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/11/styler-1-2-0/</guid>
      <description>We are pleased to announce that styler 1.2.0 is now available on CRAN. The initial version of styler was released in December 2017. Since then, five new versions were released, and styler was improved substantially, but many improvements were related to special cases or even edge cases. These are all contained in the change log. Here, we want to focus on a few changes since version 1.0.0 that we believe are the most relevant.</description>
      <content>&lt;p&gt;We are pleased to announce that &lt;a href=&#34;https://styler.r-lib.org&#34;&gt;styler&lt;/a&gt; 1.2.0 is now available on CRAN. The
&lt;a href=&#34;https://www.tidyverse.org/articles/2017/12/styler-1.0.0/&#34;&gt;initial version of styler&lt;/a&gt;
was released in December 2017. Since then,
five new versions were released, and styler was improved substantially, but many
improvements were related to special cases or even edge cases. These are all
contained in the &lt;a href=&#34;https://styler.r-lib.org/news/index.html&#34;&gt;change log&lt;/a&gt;. Here,
we want to focus on a few changes since version 1.0.0 that we believe are the
most relevant. You can install the latest stable version from CRAN with
&lt;code&gt;install.packages(&amp;quot;styler&amp;quot;)&lt;/code&gt;. Let&amp;rsquo;s get started:&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;styler&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;alignment-detection&#34;&gt;Alignment detection
  &lt;a href=&#34;#alignment-detection&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;styler can finally detect aligned code and keep it aligned! For example, the
following code won&amp;rsquo;t be modified by styler:&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;call&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;some_arg&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;123&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;more&lt;/span&gt;     &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;x&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;p&gt;We&amp;rsquo;ve tried to make this as intuitive as possible, but have a look at
&lt;a href=&#34;https://styler.r-lib.org/articles/detect-alignment.html&#34;&gt;dedicated vignette&lt;/a&gt;
when you are dealing with more complicated calls than the one above.
Note that the detection currently only works inside &lt;em&gt;function calls&lt;/em&gt;, so styler will not
recognize the below as aligned.&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;x&lt;/span&gt;  &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;x2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and turn it into&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;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;x2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;unless you also use &lt;code&gt;strict = FALSE&lt;/code&gt;.^[E.g. &lt;code&gt;styler::style_text(..., strict = FALSE)&lt;/code&gt;, but note that this also has other effects on styling that you might not
want.]&lt;/p&gt;




&lt;h2 id=&#34;rlangs-&#34;&gt;rlang&amp;rsquo;s {{
  &lt;a href=&#34;#rlangs-&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;In &lt;a href=&#34;https://www.tidyverse.org/articles/2019/06/rlang-0-4-0/&#34;&gt;rlang 0.4.0&lt;/a&gt; a new
interpolation operator was introduced: &lt;code&gt;{{&lt;/code&gt; (read curly curly). Because &lt;code&gt;styler &amp;lt; 1.2.0&lt;/code&gt; understood these as regular curly braces, you ended up with&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;call&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;when styling &lt;code&gt;call({{x}})&lt;/code&gt;, which is nonsense. Now styler yields &lt;code&gt;call({{ x }})&lt;/code&gt;.&lt;/p&gt;




&lt;h2 id=&#34;addins&#34;&gt;Addins
  &lt;a href=&#34;#addins&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The &lt;em&gt;Style active file&lt;/em&gt; addin now remembers the cursor position and the details
of styling can be specified as an R option:&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;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;styler.addins_style_transformer&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;styler::tidyverse_style(scope = &amp;#39;spaces&amp;#39;)&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;p&gt;You can also set the value of this option interactively with the &lt;em&gt;set style&lt;/em&gt;
addin (not persistent over sessions). For details, see &lt;code&gt;help(&amp;quot;styler_addins&amp;quot;, &amp;quot;styler&amp;quot;)&lt;/code&gt;
and &lt;code&gt;help(&amp;quot;tidyverse_style&amp;quot;, &amp;quot;styler&amp;quot;)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The customization of the styling does not affect the command-line API
(&lt;code&gt;styler::style_text()&lt;/code&gt; and friends). We are not sure how users could best
customize styling, but you can track our progress on that in
&lt;a href=&#34;https://github.com/r-lib/styler/issues/319&#34;&gt;r-lib/styler#319&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can also set the environment variable &lt;code&gt;save_after_styling&lt;/code&gt; to
&lt;code&gt;TRUE&lt;/code&gt;, if you are tired of saving the file after styling it with the addin.&lt;/p&gt;




&lt;h2 id=&#34;braces-in-function-calls&#34;&gt;Braces in function calls
  &lt;a href=&#34;#braces-in-function-calls&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;tryCatch()&lt;/code&gt; expressions often look 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;tryCatch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;exp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;error&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Prior to version 1.2.0, styler would return this odd formatting:&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;tryCatch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;exp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;error&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, the line is broken before the opening curly brace in function calls, except
if there is only one brace expression and it&amp;rsquo;s the last in the function call.
The typical use case is &lt;code&gt;testthat::test_that(...)&lt;/code&gt;, i.e. the following code
won&amp;rsquo;t be modified:&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;test_that&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;some condition holds&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;some_code&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;other-changes&#34;&gt;Other changes
  &lt;a href=&#34;#other-changes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;styler depends on tibble &amp;gt;= 1.4.2 and runs 2x as fast as initially.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;styler can style roxygen code examples in the source code of
packages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;styler can style &lt;code&gt;.Rnw&lt;/code&gt; files.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The print method for the output of &lt;code&gt;style_text()&lt;/code&gt; returns
syntax-highlighted code by default, controllable via the option
&lt;code&gt;styler.colored_print.vertical&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;adaption-of-styler&#34;&gt;Adaption of styler
  &lt;a href=&#34;#adaption-of-styler&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;d like to highlight that styler integrates with various other tools you might
be using:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;As a git pre-commit hook. Two standard calls from the R console, and you are
all set. We are convinced that this is the preferred way of using styler to
ensure all your files are consistently formatted. Check out the
&lt;a href=&#34;https://lorenzwalthert.github.io/precommit/&#34;&gt;precommit&lt;/a&gt; package that also
implements many other useful hooks.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;usethis::use_tidy_style()&lt;/code&gt; styles your project according to the tidyverse
style guide.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;knitr::knitr()&lt;/code&gt; and friends recognize the R code chunk option &lt;code&gt;tidy = &amp;quot;styler&amp;quot;&lt;/code&gt; for &lt;code&gt;.Rnw&lt;/code&gt; and &lt;code&gt;.Rmd&lt;/code&gt; files to pretty-print code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;reprex::reprex(..., style = TRUE)&lt;/code&gt; to prettify reprex code before printing.
To permanently use &lt;code&gt;style = TRUE&lt;/code&gt; without specifying it every time, you can
add the following line to your &lt;code&gt;.Rprofile&lt;/code&gt; (e.g. via
&lt;code&gt;usethis::edit_r_profile()&lt;/code&gt;): &lt;code&gt;options(reprex.styler = TRUE)&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There are plugins for
&lt;a href=&#34;https://github.com/lassik/emacs-format-all-the-code&#34;&gt;Emacs&lt;/a&gt; and
&lt;a href=&#34;https://github.com/dense-analysis/ale/blob/master/doc/ale-r.txt&#34;&gt;VIM&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;outlook&#34;&gt;Outlook
  &lt;a href=&#34;#outlook&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We have some cool new features in the pipeline such as
&lt;a href=&#34;https://github.com/r-lib/styler/pull/538&#34;&gt;caching&lt;/a&gt; for faster styling, and
&lt;a href=&#34;https://github.com/r-lib/styler/pull/560&#34;&gt;making styler ignore some lines&lt;/a&gt;,
which you can try out by installing from the respective branches. Feedback welcome.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgments&#34;&gt;Acknowledgments
  &lt;a href=&#34;#acknowledgments&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We are grateful to all of the people who contributed not just code, but also
issues and comments over the last two years:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/aaronrudkin&#34;&gt;@aaronrudkin&lt;/a&gt;,
&lt;a href=&#34;https://github.com/aedobbyn&#34;&gt;@aedobbyn&lt;/a&gt;, &lt;a href=&#34;https://github.com/ArthurPERE&#34;&gt;@ArthurPERE&lt;/a&gt;, &lt;a href=&#34;https://github.com/Banana1530&#34;&gt;@Banana1530&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/Bio7&#34;&gt;@Bio7&lt;/a&gt;, &lt;a href=&#34;https://github.com/ClaytonJY&#34;&gt;@ClaytonJY&lt;/a&gt;, &lt;a href=&#34;https://github.com/courtiol&#34;&gt;@courtiol&lt;/a&gt;,
&lt;a href=&#34;https://github.com/crew102&#34;&gt;@crew102&lt;/a&gt;,
&lt;a href=&#34;https://github.com/cpsievert&#34;&gt;@cpsievert&lt;/a&gt;, &lt;a href=&#34;https://github.com/dchiu911&#34;&gt;@dchiu911&lt;/a&gt;,
&lt;a href=&#34;https://github.com/devSJR&#34;&gt;@devSJR&lt;/a&gt;,
&lt;a href=&#34;https://github.com/dirkschumacher&#34;&gt;@dirkschumacher&lt;/a&gt;, &lt;a href=&#34;https://github.com/ellessenne&#34;&gt;@ellessenne&lt;/a&gt;, &lt;a href=&#34;https://github.com/Emiller88&#34;&gt;@Emiller88&lt;/a&gt;,
&lt;a href=&#34;https://github.com/fny&#34;&gt;@fny&lt;/a&gt;,
&lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/Hasnep&#34;&gt;@Hasnep&lt;/a&gt;, &lt;a href=&#34;https://github.com/igordot&#34;&gt;@igordot&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackwasey&#34;&gt;@jackwasey&lt;/a&gt;, &lt;a href=&#34;https://github.com/jcrodriguez1989&#34;&gt;@jcrodriguez1989&lt;/a&gt;,
&lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jjramsey&#34;&gt;@jjramsey&lt;/a&gt;,
&lt;a href=&#34;https://github.com/jkgrain&#34;&gt;@jkgrain&lt;/a&gt;
&lt;a href=&#34;https://github.com/jonmcalder&#34;&gt;@jonmcalder&lt;/a&gt;,
&lt;a href=&#34;https://github.com/joranE&#34;&gt;@joranE&lt;/a&gt;,
&lt;a href=&#34;https://github.com/kalibera&#34;&gt;@kalibera&lt;/a&gt;,
&lt;a href=&#34;https://github.com/katrinleinweber&#34;&gt;@katrinleinweber&lt;/a&gt;, &lt;a href=&#34;https://github.com/kiranmaiganji&#34;&gt;@kiranmaiganji&lt;/a&gt;, &lt;a href=&#34;https://github.com/krivit&#34;&gt;@krivit&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;,
&lt;a href=&#34;https://github.com/llrs&#34;&gt;@llrs&lt;/a&gt;,
&lt;a href=&#34;https://github.com/lorenzwalthert&#34;&gt;@lorenzwalthert&lt;/a&gt;, &lt;a href=&#34;https://github.com/lwjohnst86&#34;&gt;@lwjohnst86&lt;/a&gt;,
&lt;a href=&#34;https://github.com/martin-mfg&#34;&gt;@martin-mfg&lt;/a&gt;,
&lt;a href=&#34;https://github.com/maurolepore&#34;&gt;@maurolepore&lt;/a&gt;, &lt;a href=&#34;https://github.com/michaelquinn32&#34;&gt;@michaelquinn32&lt;/a&gt;, &lt;a href=&#34;https://github.com/mine-cetinkaya-rundel&#34;&gt;@mine-cetinkaya-rundel&lt;/a&gt;, &lt;a href=&#34;https://github.com/Moohan&#34;&gt;@Moohan&lt;/a&gt;, &lt;a href=&#34;https://github.com/msberends&#34;&gt;@msberends&lt;/a&gt;,
&lt;a href=&#34;https://github.com/NGaffney&#34;&gt;@NGaffney&lt;/a&gt;, &lt;a href=&#34;https://github.com/nxskok&#34;&gt;@nxskok&lt;/a&gt;, &lt;a href=&#34;https://github.com/oliverbeagley&#34;&gt;@oliverbeagley&lt;/a&gt;, &lt;a href=&#34;https://github.com/pat-s&#34;&gt;@pat-s&lt;/a&gt;, &lt;a href=&#34;https://github.com/ramnathv&#34;&gt;@ramnathv&lt;/a&gt;, &lt;a href=&#34;https://github.com/raynamharris&#34;&gt;@raynamharris&lt;/a&gt;, &lt;a href=&#34;https://github.com/reddy-ia&#34;&gt;@reddy-ia&lt;/a&gt;, &lt;a href=&#34;https://github.com/riccardoporreca&#34;&gt;@riccardoporreca&lt;/a&gt;, &lt;a href=&#34;https://github.com/rillig&#34;&gt;@rillig&lt;/a&gt;, &lt;a href=&#34;https://github.com/rjake&#34;&gt;@rjake&lt;/a&gt;, &lt;a href=&#34;https://github.com/Robinlovelace&#34;&gt;@Robinlovelace&lt;/a&gt;,
&lt;a href=&#34;https://github.com/RMHogervorst&#34;&gt;@RMHogervorst&lt;/a&gt;,
&lt;a href=&#34;https://github.com/rorynolan&#34;&gt;@rorynolan&lt;/a&gt;, &lt;a href=&#34;https://github.com/russHyde&#34;&gt;@russHyde&lt;/a&gt;,
&lt;a href=&#34;https://github.com/samhinshaw&#34;&gt;@samhinshaw&lt;/a&gt;,
&lt;a href=&#34;https://github.com/skirmer&#34;&gt;@skirmer&lt;/a&gt;, &lt;a href=&#34;https://github.com/thalesmello&#34;&gt;@thalesmello&lt;/a&gt;, &lt;a href=&#34;https://github.com/tobiasgerstenberg&#34;&gt;@tobiasgerstenberg&lt;/a&gt;, &lt;a href=&#34;https://github.com/tonytonov&#34;&gt;@tonytonov&lt;/a&gt;, &lt;a href=&#34;https://github.com/tvatter&#34;&gt;@tvatter&lt;/a&gt;,
&lt;a href=&#34;https://github.com/vnijs&#34;&gt;@vnijs&lt;/a&gt;,
&lt;a href=&#34;https://github.com/wdearden&#34;&gt;@wdearden&lt;/a&gt;, &lt;a href=&#34;https://github.com/wlandau&#34;&gt;@wlandau&lt;/a&gt;, &lt;a href=&#34;https://github.com/wmayner&#34;&gt;@wmayner&lt;/a&gt;, &lt;a href=&#34;https://github.com/yech1990&#34;&gt;@yech1990&lt;/a&gt; and
&lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>discrim 0.0.1</title>
      <link>https://www.tidyverse.org/blog/2019/10/discrim-0-0-1/</link>
      <pubDate>Thu, 17 Oct 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/10/discrim-0-0-1/</guid>
      <description>The new package discrim contains parsnip bindings for additional classification models, including:
 Linear discriminant analysis (LDA, simple and L2 regularized) Regularized discriminant analysis (RDA, via Friedman (1989)) Flexible discriminant analysis (FDA) using MARS features Naive Bayes models  The package can also be used as a template for adding new models to tidymodels without having to directly involve parsnip.
As an example, the package contains a simulated data set with two factors and two classes:</description>
      <content>&lt;p&gt;The new package &lt;a href=&#34;https://tidymodels.github.io/discrim/&#34;&gt;&lt;code&gt;discrim&lt;/code&gt;&lt;/a&gt; contains &lt;code&gt;parsnip&lt;/code&gt; bindings for additional classification models, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Linear discriminant analysis (LDA, simple and L2 regularized)&lt;/li&gt;
&lt;li&gt;Regularized discriminant analysis (RDA, via &lt;a href=&#34;https://scholar.google.com/scholar?hl=en&amp;amp;as_sdt=0%2C7&amp;amp;q=%22Regularized+Discriminant+Analysis%22&amp;amp;btnG=&#34;&gt;Friedman (1989)&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://scholar.google.com/scholar?hl=en&amp;amp;as_sdt=0%2C7&amp;amp;q=%22Flexible+discriminant+analysis%22&amp;amp;btnG=&#34;&gt;Flexible discriminant analysis&lt;/a&gt; (FDA) using &lt;a href=&#34;https://scholar.google.com/scholar?hl=en&amp;amp;as_sdt=0%2C7&amp;amp;q=%22multivariate+adaptive+regression+splines%22&amp;amp;btnG=&#34;&gt;MARS features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Naive Bayes models&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The package can also be used as a template for adding new models to &lt;code&gt;tidymodels&lt;/code&gt; without having to directly involve &lt;code&gt;parsnip&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;As an example, the package contains a simulated data set with two factors and two classes:&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;tidyverse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ── Attaching packages ────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ tibble  2.1.3     ✔ purrr   0.3.2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ tidyr   1.0.0     ✔ dplyr   0.8.3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ readr   1.3.1     ✔ stringr 1.4.0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ tibble  2.1.3     ✔ forcats 0.4.0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ── Conflicts ───────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dplyr::filter() masks stats::filter()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dplyr::lag()    masks stats::lag()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dplyr::select() masks MASS::select()&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;rsample&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;discrim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Loading required package: parsnip&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;earth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;parabolic&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;package&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;rsample&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Warning in data(&amp;#34;parabolic&amp;#34;, package = &amp;#34;rsample&amp;#34;): data set &amp;#39;parabolic&amp;#39; not&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; found&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;parabolic&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 500 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;        X1     X2 class &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     &amp;lt;dbl&amp;gt;  &amp;lt;dbl&amp;gt; &amp;lt;fct&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1  3.29   1.66  Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2  1.47   0.414 Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3  1.66   0.791 Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4  1.60   0.276 Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5  2.17   3.17  Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6  1.94   3.83  Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 -0.588 -0.977 Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 -0.951  1.40  Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9  0.275  0.370 Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 -1.13  -1.14  Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 490 more rows&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parabolic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;col&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;.3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;coord_equal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;theme&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;legend.position&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;top&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-10-discrim-0-01_files/figure-html/startup-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;How would a flexible discriminant model do here? We&amp;rsquo;ll split the data then fit the model:&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;set.seed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;115&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data_split&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;initial_split&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parabolic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;prop&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data_tr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;training&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_split&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data_te&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;testing&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_split&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;fda_mod&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;discrim_flexible&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;set_engine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;earth&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;fda_fit&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;fda_mod&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data_tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;fda_fit&lt;/span&gt; 
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; parsnip model object&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; mda::fda(formula = formula, data = data, method = earth::earth)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Dimension: 1 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Percent Between-Group Variance Explained:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  v1 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 100 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Training Misclassification Error: 0.105 ( N = 334 )&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since no model tuning parameters were specified, the MARS algorithm follows its own internal method for optimizing the number of features that are included in the model. The underlying MARS model is:&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;summary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fda_fit&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fit&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call: earth(x=x, y=Theta, weights=weights)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;                  coefficients&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; (Intercept)            -0.892&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; h(X1- -1.42535)         2.780&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; h(X1- -0.907457)       -1.972&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; h(X1- -0.450335)       -0.766&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; h(X2-0.351695)         -1.634&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; h(X2-1.44562)           1.461&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Selected 6 of 13 terms, and 2 of 2 predictors&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Termination condition: Reached nk 21&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Importance: X2, X1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Number of terms at each degree of interaction: 1 5 (additive model)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; GCV 0.333    RSS 104    GRSq 0.669    RSq 0.688&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The classification boundary, overlaid on the test set, shows a series of segmented lines:&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;pred_grid&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;expand.grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;X1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;seq&lt;/span&gt;&lt;span class=&#34;p&#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;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;seq&lt;/span&gt;&lt;span class=&#34;p&#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;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;bind_cols&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;predict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fda_fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;prob&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
      &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.pred_Class1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
      &lt;span class=&#34;nf&#34;&gt;setNames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;fda_pred&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_te&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;col&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;.3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;coord_equal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;theme&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;legend.position&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;top&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_contour&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fda_pred&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&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;n&#34;&gt;col&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;black&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-10-discrim-0-01_files/figure-html/grid-1-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;This boundary seems pretty reasonable.&lt;/p&gt;
&lt;p&gt;These models also work with the new &lt;a href=&#34;https://github.com/tidymodels/tune&#34;&gt;&lt;code&gt;tune&lt;/code&gt; package&lt;/a&gt;. To demonstrate, a regularized discriminant analysis model^[Despite the name, this type of regularization is different from the more commonly used lasso ($L_1$) or ridge ($L_2$) regression methods. Here, the &lt;em&gt;covariance matrix&lt;/em&gt; of the predictors is regularized in different ways as described &lt;a href=&#34;https://rdrr.io/cran/klaR/man/rda.html&#34;&gt;here&lt;/a&gt;.] will be fit to the data and optimized using a simple grid search.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ll use the devel version of dials:&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;# devtools::install_github(&amp;#34;tidymodels/tune&amp;#34;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;# We use the devel version of several tidymodels packages:&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;tidymodels&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Registered S3 method overwritten by &amp;#39;xts&amp;#39;:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   method     from&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   as.zoo.xts zoo&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ── Attaching packages ───────────────────────────────────────────────────────────────────────────────────── tidymodels 0.0.3 ──&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ broom     0.5.2          ✔ recipes   0.1.7.9001&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ dials     0.0.3.9001     ✔ yardstick 0.0.4     &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ infer     0.5.0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ── Conflicts ──────────────────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ──&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ scales::discard() masks purrr::discard()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dplyr::filter()   masks stats::filter()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ recipes::fixed()  masks stringr::fixed()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dplyr::lag()      masks stats::lag()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dials::margin()   masks ggplot2::margin()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dials::offset()   masks stats::offset()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ dplyr::select()   masks MASS::select()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ yardstick::spec() masks readr::spec()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✖ recipes::step()   masks stats::step()&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;tune&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;First, we mark the parameters for tuning:&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;rda_mod&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;discrim_regularized&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;frac_common_cov&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tune&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;frac_identity&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tune&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;set_engine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;klaR&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;p&gt;In order to tune the model, we require a grid of candidate values along with a resampling specification. We&amp;rsquo;ll also setup a &lt;code&gt;yardstick&lt;/code&gt; object to measure the area under the ROC curve for each candidate model:&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;set.seed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;20014&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;folds&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vfold_cv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;repeats&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;c1&#34;&gt;# Use a space-filling design with 30 candidate models&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;candidates&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;rda_mod&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;param_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;grid_max_entropy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;roc_values&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;metric_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;roc_auc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we can tune the model:&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;rda_res&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;tune_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rda_mod&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;rs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;folds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;grid&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;candidates&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
            &lt;span class=&#34;n&#34;&gt;perf&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;roc_values&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The resampling estimates rank the models (starting with the best) as:&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;auc_values&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;estimate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rda_res&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;arrange&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;desc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; 
&lt;span class=&#34;n&#34;&gt;auc_values&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;slice&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;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 7&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   frac_common_cov frac_identity .metric .estimator  mean     n std_err&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;             &amp;lt;dbl&amp;gt;         &amp;lt;dbl&amp;gt; &amp;lt;chr&amp;gt;   &amp;lt;chr&amp;gt;      &amp;lt;dbl&amp;gt; &amp;lt;int&amp;gt;   &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1          0.0223         0.171 roc_auc binary     0.949    50 0.00392&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2          0.107          0.362 roc_auc binary     0.943    50 0.00421&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3          0.255          0.410 roc_auc binary     0.941    50 0.00445&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4          0.434          0.685 roc_auc binary     0.939    50 0.00454&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5          0.357          0.584 roc_auc binary     0.939    50 0.00454&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Let&amp;rsquo;s plot the resampling results:&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;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auc_values&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;frac_common_cov&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;frac_identity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;alpha&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;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;coord_equal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-10-discrim-0-01_files/figure-html/grid-res-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;There is a wide range of parameter combinations associated with good performance here. The poor results occur mostly when the model tries to enforce a mostly LDA covariance matrix (&lt;code&gt;frac_common_cov&lt;/code&gt; &amp;gt; 0.9) along with &lt;code&gt;frac_identity&lt;/code&gt; &amp;lt;= 0.6. The latter parameter tries to shrink the covariance matrix towards one where the parameters are considered to be nearly independent.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;parsnip&lt;/code&gt; model object can be updated with the best parameter combination (&lt;code&gt;frac_common_cov&lt;/code&gt; = 0.022 and &lt;code&gt;frac_identity&lt;/code&gt; = 0.171).  These parameter values result in a model close to a pure QDA model. The &lt;code&gt;merge()&lt;/code&gt; function can be used to insert these values into our original &lt;code&gt;parsnip&lt;/code&gt; object:&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;final_param&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;auc_values&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;slice&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;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;frac_common_cov&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;frac_identity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;rda_mod&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;rda_mod&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;merge&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;final_param&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;pull&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;pluck&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;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;rda_mod&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Regularized Discriminant Model Specification (classification)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Main Arguments:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   frac_common_cov = 0.0222721435129642&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   frac_identity = 0.171292591374367&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Computational engine: klaR&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;rda_fit&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;rda_mod&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;X2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data_tr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To show the class boundary:&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;pred_grid&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;bind_cols&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;predict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rda_fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;prob&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
      &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.pred_Class1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
      &lt;span class=&#34;nf&#34;&gt;setNames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;rda_pred&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_contour&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fda_pred&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&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;n&#34;&gt;col&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;black&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
               &lt;span class=&#34;n&#34;&gt;alpha&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;n&#34;&gt;lty&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_contour&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pred_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rda_pred&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&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;n&#34;&gt;col&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;black&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-10-discrim-0-01_files/figure-html/rda-boundary-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;This is pretty close to the true simulated boundary, which is parabolic in nature.&lt;/p&gt;
&lt;p&gt;The test sets results are:&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;probs_te&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;predict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rda_fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data_te&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;prob&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;bind_cols&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data_te&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;probs_te&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 166 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    .pred_Class1 .pred_Class2 class &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;           &amp;lt;dbl&amp;gt;        &amp;lt;dbl&amp;gt; &amp;lt;fct&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1        0.851     0.149    Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2        0.205     0.795    Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3        1.000     0.000339 Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4        0.326     0.674    Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5        0.377     0.623    Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6        0.202     0.798    Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7        0.333     0.667    Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8        0.472     0.528    Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9        0.979     0.0210   Class1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10        0.166     0.834    Class2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 156 more rows&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;roc_auc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;probs_te&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.pred_Class1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 1 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   .metric .estimator .estimate&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;   &amp;lt;chr&amp;gt;          &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 roc_auc binary         0.971&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pretty good!&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>dials 0.0.3</title>
      <link>https://www.tidyverse.org/blog/2019/10/dials-0-0-3/</link>
      <pubDate>Tue, 01 Oct 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/10/dials-0-0-3/</guid>
      <description>A new version of dials is on CRAN. The package has contains basic frameworks for managing tuning parameters for models. It is a significant update to the package. The major change is that parameter objects are now generated by functions (as opposed to the prototype objects in the previous version). For example, to make a dials object for the number of PCA components in a model:
# previously pca_comps &amp;lt;- num_comp # now pca_comps &amp;lt;- num_comp() For numeric parameters, the range of values can be set using the first argument:</description>
      <content>&lt;p&gt;A new version of &lt;code&gt;dials&lt;/code&gt; is &lt;a href=&#34;https://cran.r-project.org/package=dials&#34;&gt;on CRAN&lt;/a&gt;. The package has contains basic frameworks for managing tuning parameters for models. It is a significant update to the package. The major change is that parameter objects are now generated by functions (as opposed to the prototype objects in the previous version). For example, to make a &lt;code&gt;dials&lt;/code&gt; object for the number of PCA components in a model:&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;# previously&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;pca_comps&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;num_comp&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# now&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;pca_comps&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;num_comp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For numeric parameters, the range of values can be set using the first 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;nf&#34;&gt;library&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tidymodels&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;## ── Attaching packages ──────────────────────────────────────── tidymodels 0.0.2 ──
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;## ✔ broom     0.5.2       ✔ purrr     0.3.2  
## ✔ dials     0.0.3       ✔ recipes   0.1.7  
## ✔ dplyr     0.8.3       ✔ rsample   0.0.5  
## ✔ ggplot2   3.2.1       ✔ tibble    2.1.3  
## ✔ infer     0.4.0.1     ✔ yardstick 0.0.4  
## ✔ parsnip   0.0.3.1
&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;## ── Conflicts ─────────────────────────────────────────── tidymodels_conflicts() ──
## ✖ purrr::discard()  masks scales::discard()
## ✖ dplyr::filter()   masks stats::filter()
## ✖ dplyr::lag()      masks stats::lag()
## ✖ ggplot2::margin() masks dials::margin()
## ✖ dials::offset()   masks stats::offset()
## ✖ recipes::step()   masks stats::step()
&lt;/code&gt;&lt;/pre&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;num_comp&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;## # Components  (quantitative)
## Range: [1, ?]
&lt;/code&gt;&lt;/pre&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;num_comp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;range&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;10&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;## # Components  (quantitative)
## Range: [2, 10]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Sets of tuning parameters can be created and managed:&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;boosting_set&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;param_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;trees&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;splits&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tree_depth&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;min_n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()))&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;boosting_set&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## Collection of 3 parameters for tuning
## 
##      id parameter type object class
##   trees          trees    nparam[+]
##  splits     tree_depth    nparam[+]
##   min_n          min_n    nparam[+]
&lt;/code&gt;&lt;/pre&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;# modifying the parameter range:&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;boosting_set&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;update&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;trees&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;trees&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1000&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;## Collection of 3 parameters for tuning
## 
##      id parameter type object class
##   trees          trees    nparam[+]
##  splits     tree_depth    nparam[+]
##   min_n          min_n    nparam[+]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note that the tree depth parameter has a user-defined identification variable. This can come in handy when there are multiple tuning parameters of the same type. For example, suppose two variables (&lt;code&gt;x1&lt;/code&gt; and &lt;code&gt;x2&lt;/code&gt;) were modeled using splines. The flexibility of each grouped be represented in a parameter set:&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;splines&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;param_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x1_df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;deg_free&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x2_df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;deg_free&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()))&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;splines&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;## Collection of 2 parameters for tuning
## 
##     id parameter type object class
##  x1_df       deg_free    nparam[+]
##  x2_df       deg_free    nparam[+]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This version of &lt;code&gt;dials&lt;/code&gt; also contains two functions for creating &lt;a href=&#34;https://scholar.google.com/scholar?hl=en&amp;amp;as_sdt=0%2C7&amp;amp;q=%22Space-Filling+Designs%22&amp;amp;btnG=&#34;&gt;space-filling designs&lt;/a&gt;, a technique from statistical experimental design theory. The two functions are &lt;code&gt;grid_max_entropy()&lt;/code&gt; and &lt;code&gt;grid_latin_hypercube()&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;n&#34;&gt;svm_set&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;param_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;rbf_sigma&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;cost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()))&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;set.seed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;463&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;me_grid&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;grid_max_entropy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;svm_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;max entropy&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;ls_grid&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;grid_latin_hypercube&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;svm_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;latin hypercube&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;rn_grid&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;grid_random&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;svm_set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;random&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;bind_rows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;me_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ls_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rn_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rbf_sigma&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;facet_wrap&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;scale_x_log10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;scale_y_log10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;  &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;coord_fixed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ratio&lt;/span&gt; &lt;span class=&#34;o&#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;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-10-dials-0-0-3_files/figure-html/svm-design-1.png&#34; width=&#34;672&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;dials&lt;/code&gt; will be central to the upcoming framework for optimizing tuning parameters so there is much more to come regarding this package.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>devtools 2.2.1</title>
      <link>https://www.tidyverse.org/blog/2019/09/devtools-2-2-1/</link>
      <pubDate>Thu, 26 Sep 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/09/devtools-2-2-1/</guid>
      <description>Introduction     devtools 2.2.1 is now on CRAN!
devtools makes package development easier by providing R functions that simplify and expedite common tasks. R Packages is a book based around this workflow, which you can read online for free (1st edition, in-progress 2nd edition).
Apart from the new features mentioned below this release also contains a number of smaller changes and bug fixes. As always a complete list of all the changes is available in the package Changelog.</description>
      <content>



&lt;h2 id=&#34;introduction&#34;&gt;Introduction
  &lt;a href=&#34;#introduction&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://devtools.r-lib.org&#34;&gt;devtools&lt;/a&gt; 2.2.1 is now on CRAN!&lt;/p&gt;
&lt;p&gt;devtools makes package development easier by providing R functions that
simplify and expedite common tasks. R Packages is a book based around this
workflow, which you can read online for free (&lt;a href=&#34;http://r-pkgs.had.co.nz/&#34;&gt;1st
edition&lt;/a&gt;, in-progress &lt;a href=&#34;https://r-pkgs.org/&#34;&gt;2nd
edition&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Apart from the new features mentioned below this release also contains a number
of smaller changes and bug fixes. As always a complete list of all the changes
is available in the package
&lt;a href=&#34;https://devtools.r-lib.org/news/index.html&#34;&gt;Changelog&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;new-features&#34;&gt;New features
  &lt;a href=&#34;#new-features&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;create&#34;&gt;&lt;code&gt;create()&lt;/code&gt;
  &lt;a href=&#34;#create&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;create()&lt;/code&gt; function has been re-added to the package. This functions was
previously removed in favor of &lt;code&gt;usethis::create_package()&lt;/code&gt; but it turns out the
RStudio IDE uses &lt;code&gt;devtools::create()&lt;/code&gt; as part of its create new project dialog,
so removing the function would break this functionality in older versions of
RStudio. &lt;code&gt;create()&lt;/code&gt; is however simply an alias for &lt;code&gt;usethis::create_package()&lt;/code&gt;,
so you are free to use whichever you would prefer in your own use.&lt;/p&gt;




&lt;h3 id=&#34;dev_sitrep&#34;&gt;&lt;code&gt;dev_sitrep()&lt;/code&gt;
  &lt;a href=&#34;#dev_sitrep&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;A new function &lt;code&gt;dev_sitrep()&lt;/code&gt; can be used to get a &amp;ldquo;situation report&amp;rdquo; about
your development setup. This is important when working on your own packages,
but also to help people get up and running quickly during developer events such
as the &lt;a href=&#34;https://github.com/tidyverse/dev-day-2019&#34;&gt;Tidyverse Dev Days&lt;/a&gt;. It
provides a series of checks that you have the latest versions of R, RStudio,
RTools and package dependencies, along with instructions on how to update them
if needed.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/devtools-2.2.1/sitrep.png&#34; alt=&#34;dev_sitrep() output&#34;&gt;&lt;/p&gt;




&lt;h3 id=&#34;ellipsis&#34;&gt;ellipsis
  &lt;a href=&#34;#ellipsis&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The &lt;a href=&#34;http://ellipsis.r-lib.org/&#34;&gt;ellipsis package&lt;/a&gt; provides a function
&lt;code&gt;check_dots_used()&lt;/code&gt; which ensures that all arguments specified in &lt;code&gt;...&lt;/code&gt; have
been used. Devtools uses &lt;code&gt;...&lt;/code&gt; to pass arguments down to base R functions such
as &lt;code&gt;install.packages()&lt;/code&gt;. If the arguments are invalid, such as mis-typing a
argument name they would often be silently ignored rather than throwing an
error. Using ellipsis instead causes a full error to occur in these cases,
catching many more bugs when they happen. &lt;code&gt;check_dots_used()&lt;/code&gt; is now used for
any devtools function taking &lt;code&gt;...&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;devtools 2.2.1 introduces a new option &lt;code&gt;devtools.ellipsis_action&lt;/code&gt; to control
the behavior of ellipsis in devtools. Because there are some cases, like when a
given package is already installed, that devtools does not actually use any of
the arguments in &lt;code&gt;...&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;devtools.ellipsis_action&lt;/code&gt; takes one of the following arguments&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;rlang::abort&lt;/code&gt; - to emit an error if arguments are unused&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rlang::warn&lt;/code&gt; - to emit a warning if arguments are unused&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rlang::inform&lt;/code&gt; - to emit a message if arguments are unused&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rlang::signal&lt;/code&gt; - to emit a message if arguments are unused&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using &lt;code&gt;rlang::signal&lt;/code&gt; will produce no output unless the custom condition is
caught, so it is the best way to retain backwards compatibility with devtools
behavior prior to 2.2.0.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We are of grateful to &lt;em&gt;all&lt;/em&gt; of the &lt;em&gt;29&lt;/em&gt; people who contributed not just code, but also issues and comments for this release:
&lt;a href=&#34;https://github.com/amit0thesingularity&#34;&gt;@amit0thesingularity&lt;/a&gt;,
&lt;a href=&#34;https://github.com/bbimber&#34;&gt;@bbimber&lt;/a&gt;,
&lt;a href=&#34;https://github.com/Cervangirard&#34;&gt;@Cervangirard&lt;/a&gt;,
&lt;a href=&#34;https://github.com/dachosen1&#34;&gt;@dachosen1&lt;/a&gt;,
&lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;,
&lt;a href=&#34;https://github.com/deslaur&#34;&gt;@deslaur&lt;/a&gt;,
&lt;a href=&#34;https://github.com/djnavarro&#34;&gt;@djnavarro&lt;/a&gt;,
&lt;a href=&#34;https://github.com/DSLituiev&#34;&gt;@DSLituiev&lt;/a&gt;,
&lt;a href=&#34;https://github.com/DzLGasoline&#34;&gt;@DzLGasoline&lt;/a&gt;,
&lt;a href=&#34;https://github.com/f527&#34;&gt;@f527&lt;/a&gt;,
&lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;,
&lt;a href=&#34;https://github.com/hrbrmstr&#34;&gt;@hrbrmstr&lt;/a&gt;,
&lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;,
&lt;a href=&#34;https://github.com/jameslamb&#34;&gt;@jameslamb&lt;/a&gt;,
&lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;,
&lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;,
&lt;a href=&#34;https://github.com/jrowen&#34;&gt;@jrowen&lt;/a&gt;,
&lt;a href=&#34;https://github.com/k-doering-NOAA&#34;&gt;@k-doering-NOAA&lt;/a&gt;,
&lt;a href=&#34;https://github.com/mezerji1365&#34;&gt;@mezerji1365&lt;/a&gt;,
&lt;a href=&#34;https://github.com/MichaelChirico&#34;&gt;@MichaelChirico&lt;/a&gt;,
&lt;a href=&#34;https://github.com/neonira&#34;&gt;@neonira&lt;/a&gt;,
&lt;a href=&#34;https://github.com/njtierney&#34;&gt;@njtierney&lt;/a&gt;,
&lt;a href=&#34;https://github.com/p-rocha&#34;&gt;@p-rocha&lt;/a&gt;,
&lt;a href=&#34;https://github.com/programgirl&#34;&gt;@programgirl&lt;/a&gt;,
&lt;a href=&#34;https://github.com/realDongWang&#34;&gt;@realDongWang&lt;/a&gt;,
&lt;a href=&#34;https://github.com/RoundNose&#34;&gt;@RoundNose&lt;/a&gt;,
&lt;a href=&#34;https://github.com/rstub&#34;&gt;@rstub&lt;/a&gt;,
&lt;a href=&#34;https://github.com/tbates&#34;&gt;@tbates&lt;/a&gt;, and
&lt;a href=&#34;https://github.com/TomKellyGenetics&#34;&gt;@TomKellyGenetics&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>tidyr 1.0.0</title>
      <link>https://www.tidyverse.org/blog/2019/09/tidyr-1-0-0/</link>
      <pubDate>Fri, 13 Sep 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/09/tidyr-1-0-0/</guid>
      <description>I&amp;rsquo;m very excited to announce the release of tidyr 1.0.0! tidyr provides a set of tools for transforming data frames to and from tidy data, where each variable is a column and each observation is a row. Tidy data is a convention for matching the semantics and structure of your data that makes using the rest of the tidyverse (and many other R packages) much easier.
Install tidyr with:
install.packages(&amp;#34;tidyr&amp;#34;) As you might guess from the version number, this is a major release, and the 1.</description>
      <content>&lt;p&gt;I&amp;rsquo;m very excited to announce the release of &lt;a href=&#34;https://tidyr.tidyverse.org&#34;&gt;tidyr 1.0.0&lt;/a&gt;! tidyr provides a set of tools for transforming data frames to and from &lt;a href=&#34;https://tidyr.tidyverse.org/articles/tidy-data.html&#34;&gt;tidy data&lt;/a&gt;, where each variable is a column and each observation is a row. Tidy data is a convention for matching the semantics and structure of your data that makes using the rest of the tidyverse (and many other R packages) much easier.&lt;/p&gt;
&lt;p&gt;Install tidyr with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tidyr&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;p&gt;As you might guess from the version number, this is a major release, and the 1.0.0 moniker indicates that I&amp;rsquo;m finally happy with the overall interface of the package. This has been a long time coming: it&amp;rsquo;s five years since the first tidyr release, nine years since the first reshape2 release, and fourteen years since the first reshape release!&lt;/p&gt;
&lt;p&gt;This blog post summarises the four major changes to the package:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;New &lt;code&gt;pivot_longer()&lt;/code&gt; and &lt;code&gt;pivot_wider()&lt;/code&gt; provide improved tools for reshaping,
superceding &lt;code&gt;spread()&lt;/code&gt; and &lt;code&gt;gather()&lt;/code&gt;. The new functions are substantially
more powerful, thanks to ideas from the
&lt;a href=&#34;https://CRAN.R-project.org/package=data.table&#34;&gt;data.table&lt;/a&gt; and
&lt;a href=&#34;https://CRAN.R-project.org/package=cdata&#34;&gt;cdata&lt;/a&gt; packages, and I&amp;rsquo;m
confident that you&amp;rsquo;ll find them easier to use and remember than their
predecessors.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;New &lt;code&gt;unnest_auto()&lt;/code&gt;, &lt;code&gt;unnest_longer()&lt;/code&gt;, &lt;code&gt;unnest_wider()&lt;/code&gt;, and &lt;code&gt;hoist()&lt;/code&gt;
provide new tools for rectangling, converting deeply nested lists into tidy
data frames.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;nest()&lt;/code&gt; and &lt;code&gt;unnest()&lt;/code&gt; have been changed to match an emerging principle for
the design of  &lt;code&gt;...&lt;/code&gt; interfaces. Four new functions (&lt;code&gt;pack()&lt;/code&gt;/&lt;code&gt;unpack()&lt;/code&gt;, and
&lt;code&gt;chop()&lt;/code&gt;/&lt;code&gt;unchop()&lt;/code&gt;) reveal that nesting is the combination of two simpler
steps.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;New &lt;code&gt;expand_grid()&lt;/code&gt;, a variant of &lt;code&gt;base::expand.grid()&lt;/code&gt;. This is a useful
function to know about, but also serves as a good reason to discuss the
important role that &lt;a href=&#34;http://vctrs.r-lib.org/&#34;&gt;vctrs&lt;/a&gt; plays behind the scenes.
You shouldn&amp;rsquo;t ever &lt;em&gt;have&lt;/em&gt; to learn about vctrs, but it brings improvements to
consistency and performance.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As well as implementing the new features, I&amp;rsquo;ve spent considerable time on the documentation, including four major new vignettes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://tidyr.tidyverse.org/articles/pivot.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;pivot&amp;quot;)&lt;/code&gt;&lt;/a&gt;,
&lt;a href=&#34;https://tidyr.tidyverse.org/articles/rectangle.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;rectangle&amp;quot;)&lt;/code&gt;&lt;/a&gt;,
and &lt;a href=&#34;https://tidyr.tidyverse.org/articles/nest.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;nest&amp;quot;)&lt;/code&gt;&lt;/a&gt;
provide detailed documentation and case studies of pivotting, rectangling,
and nesting respectively.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://tidyr.tidyverse.org/articles/in-packages.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;in-packages&amp;quot;)&lt;/code&gt;&lt;/a&gt;
provides best practices for using tidyr inside
another package, and detailed advice on working with multiple
versions of tidyr if an interface change has affected your package.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can see a list of all the other minor bug fixes and improvements in the &lt;a href=&#34;https://tidyr.tidyverse.org/news/index.html#tidyr-1-0-0&#34;&gt;release notes&lt;/a&gt;. I strongly recommend reading the complete release notes if you&amp;rsquo;re a package developer.&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;tidyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;dplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;pivoting&#34;&gt;Pivoting
  &lt;a href=&#34;#pivoting&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;New &lt;a href=&#34;https://tidyr.tidyverse.org/reference/pivot_longer.html&#34;&gt;&lt;code&gt;pivot_longer()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://tidyr.tidyverse.org/reference/pivot_wider.html&#34;&gt;&lt;code&gt;pivot_wider()&lt;/code&gt;&lt;/a&gt; provide modern alternatives to &lt;code&gt;spread()&lt;/code&gt; and &lt;code&gt;gather()&lt;/code&gt;. They have been carefully redesigned to be easier to learn and remember, and include many new features. &lt;code&gt;spread()&lt;/code&gt; and &lt;code&gt;gather()&lt;/code&gt; won&amp;rsquo;t go away, but they&amp;rsquo;ve been retired which means that they&amp;rsquo;re no longer under active development.&lt;/p&gt;
&lt;p&gt;The best place to learn about &lt;code&gt;pivot_longer()&lt;/code&gt; and &lt;code&gt;pivot_wider()&lt;/code&gt; is &lt;a href=&#34;https://tidyr.tidyverse.org/articles/pivot.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;pivot&amp;quot;)&lt;/code&gt;&lt;/a&gt;, or by watching my presentation to the &lt;a href=&#34;https://www.youtube.com/watch?v=D48JHU4llkk&#34;&gt;Vienna R users group&lt;/a&gt;. Here I&amp;rsquo;ll quickly show off a few of the coolest new features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;pivot_longer()&lt;/code&gt; can now separate column names into multiple variables in
a single step. For example, take the &lt;code&gt;who&lt;/code&gt; dataset which has column names
that look like &lt;code&gt;new_{diagnosis}_{gender}{age}&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;names&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;who&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [1] &amp;#34;country&amp;#34;      &amp;#34;iso2&amp;#34;         &amp;#34;iso3&amp;#34;         &amp;#34;year&amp;#34;        &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [5] &amp;#34;new_sp_m014&amp;#34;  &amp;#34;new_sp_m1524&amp;#34; &amp;#34;new_sp_m2534&amp;#34; &amp;#34;new_sp_m3544&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [9] &amp;#34;new_sp_m4554&amp;#34; &amp;#34;new_sp_m5564&amp;#34; &amp;#34;new_sp_m65&amp;#34;   &amp;#34;new_sp_f014&amp;#34; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [13] &amp;#34;new_sp_f1524&amp;#34; &amp;#34;new_sp_f2534&amp;#34; &amp;#34;new_sp_f3544&amp;#34; &amp;#34;new_sp_f4554&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [17] &amp;#34;new_sp_f5564&amp;#34; &amp;#34;new_sp_f65&amp;#34;   &amp;#34;new_sn_m014&amp;#34;  &amp;#34;new_sn_m1524&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [21] &amp;#34;new_sn_m2534&amp;#34; &amp;#34;new_sn_m3544&amp;#34; &amp;#34;new_sn_m4554&amp;#34; &amp;#34;new_sn_m5564&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [25] &amp;#34;new_sn_m65&amp;#34;   &amp;#34;new_sn_f014&amp;#34;  &amp;#34;new_sn_f1524&amp;#34; &amp;#34;new_sn_f2534&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [29] &amp;#34;new_sn_f3544&amp;#34; &amp;#34;new_sn_f4554&amp;#34; &amp;#34;new_sn_f5564&amp;#34; &amp;#34;new_sn_f65&amp;#34;  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [33] &amp;#34;new_ep_m014&amp;#34;  &amp;#34;new_ep_m1524&amp;#34; &amp;#34;new_ep_m2534&amp;#34; &amp;#34;new_ep_m3544&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [37] &amp;#34;new_ep_m4554&amp;#34; &amp;#34;new_ep_m5564&amp;#34; &amp;#34;new_ep_m65&amp;#34;   &amp;#34;new_ep_f014&amp;#34; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [41] &amp;#34;new_ep_f1524&amp;#34; &amp;#34;new_ep_f2534&amp;#34; &amp;#34;new_ep_f3544&amp;#34; &amp;#34;new_ep_f4554&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [45] &amp;#34;new_ep_f5564&amp;#34; &amp;#34;new_ep_f65&amp;#34;   &amp;#34;newrel_m014&amp;#34;  &amp;#34;newrel_m1524&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [49] &amp;#34;newrel_m2534&amp;#34; &amp;#34;newrel_m3544&amp;#34; &amp;#34;newrel_m4554&amp;#34; &amp;#34;newrel_m5564&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [53] &amp;#34;newrel_m65&amp;#34;   &amp;#34;newrel_f014&amp;#34;  &amp;#34;newrel_f1524&amp;#34; &amp;#34;newrel_f2534&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [57] &amp;#34;newrel_f3544&amp;#34; &amp;#34;newrel_f4554&amp;#34; &amp;#34;newrel_f5564&amp;#34; &amp;#34;newrel_f65&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can now tease apart the variable names in a single step
(i.e. without &lt;a href=&#34;https://tidyr.tidyverse.org/reference/separate.html&#34;&gt;&lt;code&gt;separate()&lt;/code&gt;&lt;/a&gt;))
by supplying a vector of variable names to &lt;code&gt;names_to&lt;/code&gt; and a regular
expression to &lt;code&gt;names_pattern&lt;/code&gt; (simpler cases might only need &lt;code&gt;names_sep&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;n&#34;&gt;who&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;pivot_longer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;cols&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new_sp_m014&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;newrel_f65&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;names_to&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;diagnosis&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;gender&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;age&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;names_pattern&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;new_?(.*)_(.)(.*)&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;values_to&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;count&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;values_drop_na&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 76,046 x 8&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   country     iso2  iso3   year diagnosis gender age   count&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;       &amp;lt;chr&amp;gt; &amp;lt;chr&amp;gt; &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt;     &amp;lt;chr&amp;gt;  &amp;lt;chr&amp;gt; &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Afghanistan AF    AFG    1997 sp        m      014       0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 Afghanistan AF    AFG    1997 sp        m      1524     10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 Afghanistan AF    AFG    1997 sp        m      2534      6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 Afghanistan AF    AFG    1997 sp        m      3544      3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 Afghanistan AF    AFG    1997 sp        m      4554      5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 Afghanistan AF    AFG    1997 sp        m      5564      2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 7.604e+04 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;pivot_longer()&lt;/code&gt; can now work with rows that contain multiple observations
(this feature was inspired by data.table&amp;rsquo;s &lt;code&gt;dcast()&lt;/code&gt; method). For example,
take the base &lt;code&gt;anscombe&lt;/code&gt; dataset. Each row consists of four pairs of
&lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; measurements:&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;head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;anscombe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   x1 x2 x3 x4   y1   y2    y3   y4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 10 10 10  8 8.04 9.14  7.46 6.58&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2  8  8  8  8 6.95 8.14  6.77 5.76&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 13 13 13  8 7.58 8.74 12.74 7.71&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4  9  9  9  8 8.81 8.77  7.11 8.84&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 11 11 11  8 8.33 9.26  7.81 8.47&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 14 14 14  8 9.96 8.10  8.84 7.04&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can now tidy this in a single step by using the special &lt;code&gt;.value&lt;/code&gt;
variable name:&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;anscombe&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;pivot_longer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;everything&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;names_to&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;.value&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;set&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;names_pattern&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;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 44 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   set       x     y&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 1        10  8.04&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 2        10  9.14&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 3        10  7.46&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 4         8  6.58&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 1         8  6.95&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 2         8  8.14&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 38 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;pivot_wider()&lt;/code&gt; can now do simple aggregations (&lt;code&gt;reshape2::dcast()&lt;/code&gt; fans
rejoice!). For example, take the base &lt;code&gt;warpbreaks&lt;/code&gt; dataset (converted to a
tibble to print more compactly):&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;warpbreaks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;warpbreaks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;wool&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tension&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;warpbreaks&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 54 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   wool  tension breaks&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt; &amp;lt;fct&amp;gt;    &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 A     L           26&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 A     L           30&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 A     L           54&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 A     L           25&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 A     L           70&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 A     L           52&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 48 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is a designed experiment with nine replicates for every combination of
&lt;code&gt;wool&lt;/code&gt; (&lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;) and &lt;code&gt;tension&lt;/code&gt; (&lt;code&gt;L&lt;/code&gt;, &lt;code&gt;M&lt;/code&gt;, &lt;code&gt;H&lt;/code&gt;). If we attempt to pivot
the levels of &lt;code&gt;wool&lt;/code&gt; into the columns, we get a warning and the output
contains list-columns:&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;warpbreaks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;pivot_wider&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;names_from&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;wool&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;values_from&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Warning: Values in `breaks` are not uniquely identified; output will contain list-cols.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Use `values_fn = list(breaks = list)` to suppress this warning.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Use `values_fn = list(breaks = length)` to identify where the duplicates arise&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Use `values_fn = list(breaks = summary_fun)` to summarise duplicates&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 3 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   tension           A           B&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt;   &amp;lt;list&amp;lt;dbl&amp;gt;&amp;gt; &amp;lt;list&amp;lt;dbl&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 L               [9]         [9]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 M               [9]         [9]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 H               [9]         [9]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can now summarise the duplicates with the &lt;code&gt;values_fn&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;warpbreaks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;pivot_wider&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;names_from&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;wool&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;values_from&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;breaks&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;values_fn&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;breaks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 3 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   tension     A     B&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt;   &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 L        44.6  28.2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 M        24    28.8&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 H        24.6  18.8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Learn the full details and see many more examples in &lt;a href=&#34;http://tidyr.tidyverse.org/articles/pivot.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;pivot&amp;quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;rectangling&#34;&gt;Rectangling
  &lt;a href=&#34;#rectangling&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Rectangling is the art and craft of taking a deeply nested list (often sourced from wild-caught JSON or XML) and taming it into a tidy data set of rows and columns. tidyr 1.0.0 provides four new functions to aid rectangling:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;unnest_longer()&lt;/code&gt; takes each element of a list-column and makes a new row.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unnest_wider()&lt;/code&gt; takes each element of a list-column and makes a new column.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unnest_auto()&lt;/code&gt; uses some heuristics to guess whether you want
&lt;code&gt;unnest_longer()&lt;/code&gt; or &lt;code&gt;unnest_wider()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hoist()&lt;/code&gt; is similar to &lt;code&gt;unnest_wider()&lt;/code&gt; but only plucks out selected
components, and can reach down multiple levels.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To see them in action, take this small sample from &lt;code&gt;repurrrsive::got_chars&lt;/code&gt;. It contains data about three characters from the Game of Thrones:&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;characters&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Theon Greyjoy&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;aliases&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Prince of Fools&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Theon Turncloak&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Theon Kinslayer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;alive&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Tyrion Lannister&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;aliases&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;The Imp&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Halfman&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Giant of Lannister&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;alive&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Arys Oakheart&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;alive&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To work with the new tidyr rectangling tools, we first put the list into a data frame, creating a list-column:&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;got&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;characters&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;got&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 3 x 1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   character       &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;list&amp;gt;          &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 &amp;lt;named list [3]&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 &amp;lt;named list [3]&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 &amp;lt;named list [2]&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can then use &lt;code&gt;unnest_wider()&lt;/code&gt; to make each element of that list into a column:&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;got&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;unnest_wider&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 3 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   name             aliases   alive&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;            &amp;lt;list&amp;gt;    &amp;lt;lgl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Theon Greyjoy    &amp;lt;chr [3]&amp;gt; TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 Tyrion Lannister &amp;lt;chr [3]&amp;gt; TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 Arys Oakheart    &amp;lt;???&amp;gt;     FALSE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Followed by &lt;code&gt;unnest_longer()&lt;/code&gt; to turn each alias into its own row:&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;got&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;unnest_wider&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;unnest_longer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;aliases&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 7 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   name             aliases            alive&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;            &amp;lt;chr&amp;gt;              &amp;lt;lgl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Theon Greyjoy    Prince of Fools    TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 Theon Greyjoy    Theon Turncloak    TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 Theon Greyjoy    Theon Kinslayer    TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 Tyrion Lannister The Imp            TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 Tyrion Lannister Halfman            TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 Tyrion Lannister Giant of Lannister TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 7 Arys Oakheart    &amp;lt;NA&amp;gt;               FALSE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Even more conveniently, you can use &lt;code&gt;unnest_auto()&lt;/code&gt; to guess which direction a list column should be unnested in. Here it yields the same results as above, and the messages tell you why:&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;got&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;unnest_auto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;unnest_auto&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;aliases&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Using `unnest_wider(character)`; elements have 2 names in common&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Using `unnest_longer(aliases)`; no element has names&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Alternatively, you can use &lt;code&gt;hoist()&lt;/code&gt; to reach deeply into a data structure and put out just the pieces you need:&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;got&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;hoist&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;alias&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;aliases&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;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;alive&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;alive&amp;#34;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 3 x 4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   name             alias           alive character       &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;            &amp;lt;chr&amp;gt;           &amp;lt;lgl&amp;gt; &amp;lt;list&amp;gt;          &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Theon Greyjoy    Prince of Fools TRUE  &amp;lt;named list [1]&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 Tyrion Lannister The Imp         TRUE  &amp;lt;named list [1]&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 Arys Oakheart    &amp;lt;NA&amp;gt;            FALSE &amp;lt;named list [0]&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This syntax provides a more approachable alternative to using &lt;code&gt;purrr::map()&lt;/code&gt; inside &lt;code&gt;dplyr::mutate()&lt;/code&gt;, as we&amp;rsquo;d previously recommended:&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;got&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;purrr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;map_chr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;alias&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;purrr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;map_chr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;aliases&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;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.default&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NA&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;alive&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;purrr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;map_lgl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;alive&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Learn more in &lt;a href=&#34;http://tidyr.tidyverse.org/articles/rectangle.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;rectangle&amp;quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;nesting&#34;&gt;Nesting
  &lt;a href=&#34;#nesting&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;nest()&lt;/code&gt; and &lt;code&gt;unnest()&lt;/code&gt; have been updated with new interfaces that are more closely aligned to evolving tidyverse conventions. The biggest change is to their operation with multiple columns:&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;# old&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;nest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;# new&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;nest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# old&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;unnest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;# new&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;unnest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;ve done my best to ensure that common uses of &lt;code&gt;nest()&lt;/code&gt; and &lt;code&gt;unnest()&lt;/code&gt; will continue to work, generating an informative warning telling you precisely how you need to update your code. If this doesn&amp;rsquo;t work, you can use &lt;code&gt;nest_legacy()&lt;/code&gt; or &lt;code&gt;unnest_legacy()&lt;/code&gt; to access the previous interfaces; see &lt;a href=&#34;https://tidyr.tidyverse.org/articles/in-packages.html#tidyr-v0-8-3---v1-0-0&#34;&gt;&lt;code&gt;vignette(&amp;quot;in-packages&amp;quot;)&lt;/code&gt;&lt;/a&gt; for more advice on managing this transition.&lt;/p&gt;
&lt;p&gt;Behind the scenes, I discovered that nesting (and unnesting) can be decomposed into the combination of two simpler operations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;pack()&lt;/code&gt; and &lt;code&gt;unpack()&lt;/code&gt; multiple columns into and out of a data
frame column.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;chop()&lt;/code&gt; and &lt;code&gt;unchop()&lt;/code&gt; chop up rows into and out of list-columns. It&amp;rsquo;s
a bit like an explicit form of &lt;code&gt;dplyr::group_by()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/tidyr-1-0-0/nest-pack-chop.png&#34; width=&#34;480&#34; height=&#34;352&#34; /&gt;&lt;/p&gt;
&lt;p&gt;This is primarily of internal interest, but it considerably simplifies the implementation of &lt;code&gt;nest()&lt;/code&gt;, and you may occasionally find the underlying functions useful when working with exotic data structures.&lt;/p&gt;




&lt;h2 id=&#34;expand_grid&#34;&gt;&lt;code&gt;expand_grid()&lt;/code&gt;
  &lt;a href=&#34;#expand_grid&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://tidyr.tidyverse.org/reference/expand_grid.html&#34;&gt;&lt;code&gt;expand_grid()&lt;/code&gt;&lt;/a&gt; completes the existing family of &lt;code&gt;expand()&lt;/code&gt;, &lt;code&gt;nesting()&lt;/code&gt;, and &lt;code&gt;crossing()&lt;/code&gt; with a low-level function that works with vectors:&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;expand_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#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;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;letters&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;[1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;LETTERS&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;[1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 27 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;       x y     z    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt; &amp;lt;chr&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1     1 a     A    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2     1 a     B    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3     1 a     C    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4     1 b     A    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5     1 b     B    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6     1 b     C    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 21 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Compared to the existing base function &lt;code&gt;expand.grid()&lt;/code&gt;, &lt;code&gt;expand_grid()&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Varies the first element most slowly (not most quickly).&lt;/li&gt;
&lt;li&gt;Never converts strings to factors and doesn&amp;rsquo;t add any additional attributes.&lt;/li&gt;
&lt;li&gt;Returns a tibble, not a data frame.&lt;/li&gt;
&lt;li&gt;Can expand data frames.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The last feature is quite powerful, as it allows you to generate partial grids:&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;students&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tribble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;school&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;student&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;A&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;      &lt;span class=&#34;s&#34;&gt;&amp;#34;John&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;A&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;      &lt;span class=&#34;s&#34;&gt;&amp;#34;Mary&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;A&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;      &lt;span class=&#34;s&#34;&gt;&amp;#34;Susan&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;s&#34;&gt;&amp;#34;B&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;      &lt;span class=&#34;s&#34;&gt;&amp;#34;John&amp;#34;&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;expand_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;students&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;semester&lt;/span&gt; &lt;span class=&#34;o&#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;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 8 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   school student semester&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;  &amp;lt;chr&amp;gt;      &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 A      John           1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 A      John           2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 A      Mary           1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 A      Mary           2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 A      Susan          1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 A      Susan          2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 7 B      John           1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 8 B      John           2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is made possible by the &lt;a href=&#34;https://vctrs.r-lib.org&#34;&gt;vctrs&lt;/a&gt; package. vctrs is primarily of interest to package developers but I want to talk about it briefly here because I&amp;rsquo;ve been having a lot of fun working with it. It&amp;rsquo;s hard to concisely describe vctrs, but one aspect is carefully defining what a &amp;ldquo;vector&amp;rdquo; is, and providing a set of useful functions that work on all types of vctrs, without any special cases. One interesting finding is that thinking of a data frame as a vector of &lt;em&gt;rows&lt;/em&gt; (not columns, as R usually does) is suprisingly useful, and something you can expect to see in more places in the tidyverse in the future.&lt;/p&gt;
&lt;p&gt;Note that when data frame inputs are unnamed, they&amp;rsquo;re automatically unpacked into individual columns in the output. It&amp;rsquo;s also possible to create a column that is itself a data frame, a &lt;strong&gt;df-column&lt;/strong&gt;, if you name it:&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;expand_grid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;student&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;students&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;semester&lt;/span&gt; &lt;span class=&#34;o&#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;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 8 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   student$school $student semester&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;          &amp;lt;chr&amp;gt;       &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 A              John            1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 A              John            2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 A              Mary            1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 A              Mary            2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 A              Susan           1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 A              Susan           2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 7 B              John            1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 8 B              John            2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Df-columns aren&amp;rsquo;t particularly useful yet, but they provide powerful building blocks for future extensions. For example, we expect a future version of dplyr will support df-columns as a way for &lt;code&gt;mutate()&lt;/code&gt; and &lt;code&gt;summarise()&lt;/code&gt; to create multiple new columns from a single function call.&lt;/p&gt;




&lt;h2 id=&#34;thanks&#34;&gt;Thanks
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A big thanks to all 95 people who help to make this release possible! &lt;a href=&#34;https://github.com/abiyug&#34;&gt;@abiyug&lt;/a&gt;, &lt;a href=&#34;https://github.com/AdvikS&#34;&gt;@AdvikS&lt;/a&gt;, &lt;a href=&#34;https://github.com/ahcyip&#34;&gt;@ahcyip&lt;/a&gt;, &lt;a href=&#34;https://github.com/alexpghayes&#34;&gt;@alexpghayes&lt;/a&gt;, &lt;a href=&#34;https://github.com/aneisse&#34;&gt;@aneisse&lt;/a&gt;, &lt;a href=&#34;https://github.com/apreshill&#34;&gt;@apreshill&lt;/a&gt;, &lt;a href=&#34;https://github.com/atusy&#34;&gt;@atusy&lt;/a&gt;, &lt;a href=&#34;https://github.com/ax42&#34;&gt;@ax42&lt;/a&gt;, &lt;a href=&#34;https://github.com/banfai&#34;&gt;@banfai&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/brentthorne&#34;&gt;@brentthorne&lt;/a&gt;, &lt;a href=&#34;https://github.com/brunj7&#34;&gt;@brunj7&lt;/a&gt;, &lt;a href=&#34;https://github.com/coolbutuseless&#34;&gt;@coolbutuseless&lt;/a&gt;, &lt;a href=&#34;https://github.com/courtiol&#34;&gt;@courtiol&lt;/a&gt;, &lt;a href=&#34;https://github.com/cwickham&#34;&gt;@cwickham&lt;/a&gt;, &lt;a href=&#34;https://github.com/DanielReedOcean&#34;&gt;@DanielReedOcean&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/dewittpe&#34;&gt;@dewittpe&lt;/a&gt;, &lt;a href=&#34;https://github.com/donboyd5&#34;&gt;@donboyd5&lt;/a&gt;, &lt;a href=&#34;https://github.com/earowang&#34;&gt;@earowang&lt;/a&gt;, &lt;a href=&#34;https://github.com/eElor&#34;&gt;@eElor&lt;/a&gt;, &lt;a href=&#34;https://github.com/enricoferrero&#34;&gt;@enricoferrero&lt;/a&gt;, &lt;a href=&#34;https://github.com/fresques&#34;&gt;@fresques&lt;/a&gt;, &lt;a href=&#34;https://github.com/garrettgman&#34;&gt;@garrettgman&lt;/a&gt;, &lt;a href=&#34;https://github.com/gederajeg&#34;&gt;@gederajeg&lt;/a&gt;, &lt;a href=&#34;https://github.com/georgevbsantiago&#34;&gt;@georgevbsantiago&lt;/a&gt;, &lt;a href=&#34;https://github.com/giocomai&#34;&gt;@giocomai&lt;/a&gt;, &lt;a href=&#34;https://github.com/gireeshkbogu&#34;&gt;@gireeshkbogu&lt;/a&gt;, &lt;a href=&#34;https://github.com/gorkang&#34;&gt;@gorkang&lt;/a&gt;, &lt;a href=&#34;https://github.com/ha0ye&#34;&gt;@ha0ye&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hplieninger&#34;&gt;@hplieninger&lt;/a&gt;, &lt;a href=&#34;https://github.com/iago-pssjd&#34;&gt;@iago-pssjd&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackdolgin&#34;&gt;@jackdolgin&lt;/a&gt;, &lt;a href=&#34;https://github.com/japhir&#34;&gt;@japhir&lt;/a&gt;, &lt;a href=&#34;https://github.com/jayhesselberth&#34;&gt;@jayhesselberth&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeroenjanssens&#34;&gt;@jeroenjanssens&lt;/a&gt;, &lt;a href=&#34;https://github.com/jestarr&#34;&gt;@jestarr&lt;/a&gt;, &lt;a href=&#34;https://github.com/jgendrinal&#34;&gt;@jgendrinal&lt;/a&gt;, &lt;a href=&#34;https://github.com/Jim89&#34;&gt;@Jim89&lt;/a&gt;, &lt;a href=&#34;https://github.com/jl5000&#34;&gt;@jl5000&lt;/a&gt;, &lt;a href=&#34;https://github.com/jmcastagnetto&#34;&gt;@jmcastagnetto&lt;/a&gt;, &lt;a href=&#34;https://github.com/justasmundeikis&#34;&gt;@justasmundeikis&lt;/a&gt;, &lt;a href=&#34;https://github.com/Kaz272&#34;&gt;@Kaz272&lt;/a&gt;, &lt;a href=&#34;https://github.com/KenatRSF&#34;&gt;@KenatRSF&lt;/a&gt;, &lt;a href=&#34;https://github.com/koncina&#34;&gt;@koncina&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/kuriwaki&#34;&gt;@kuriwaki&lt;/a&gt;, &lt;a href=&#34;https://github.com/lazappi&#34;&gt;@lazappi&lt;/a&gt;, &lt;a href=&#34;https://github.com/leeper&#34;&gt;@leeper&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/markdly&#34;&gt;@markdly&lt;/a&gt;, &lt;a href=&#34;https://github.com/martinjhnhadley&#34;&gt;@martinjhnhadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/MatthieuStigler&#34;&gt;@MatthieuStigler&lt;/a&gt;, &lt;a href=&#34;https://github.com/mattwarkentin&#34;&gt;@mattwarkentin&lt;/a&gt;, &lt;a href=&#34;https://github.com/mehrgoltiv&#34;&gt;@mehrgoltiv&lt;/a&gt;, &lt;a href=&#34;https://github.com/meriops&#34;&gt;@meriops&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikemc&#34;&gt;@mikemc&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikmart&#34;&gt;@mikmart&lt;/a&gt;, &lt;a href=&#34;https://github.com/mine-cetinkaya-rundel&#34;&gt;@mine-cetinkaya-rundel&lt;/a&gt;, &lt;a href=&#34;https://github.com/mitchelloharawild&#34;&gt;@mitchelloharawild&lt;/a&gt;, &lt;a href=&#34;https://github.com/mixolydianpink&#34;&gt;@mixolydianpink&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkapplebee&#34;&gt;@mkapplebee&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/mpaulacaldas&#34;&gt;@mpaulacaldas&lt;/a&gt;, &lt;a href=&#34;https://github.com/Myfanwy&#34;&gt;@Myfanwy&lt;/a&gt;, &lt;a href=&#34;https://github.com/ogorodriguez&#34;&gt;@ogorodriguez&lt;/a&gt;, &lt;a href=&#34;https://github.com/onesandzeroes&#34;&gt;@onesandzeroes&lt;/a&gt;, &lt;a href=&#34;https://github.com/Overlytic&#34;&gt;@Overlytic&lt;/a&gt;, &lt;a href=&#34;https://github.com/paleolimbot&#34;&gt;@paleolimbot&lt;/a&gt;, &lt;a href=&#34;https://github.com/PMassicotte&#34;&gt;@PMassicotte&lt;/a&gt;, &lt;a href=&#34;https://github.com/psychometrician&#34;&gt;@psychometrician&lt;/a&gt;, &lt;a href=&#34;https://github.com/Rekyt&#34;&gt;@Rekyt&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/romatik&#34;&gt;@romatik&lt;/a&gt;, &lt;a href=&#34;https://github.com/rubenarslan&#34;&gt;@rubenarslan&lt;/a&gt;, &lt;a href=&#34;https://github.com/SchollJ&#34;&gt;@SchollJ&lt;/a&gt;, &lt;a href=&#34;https://github.com/seabbs&#34;&gt;@seabbs&lt;/a&gt;, &lt;a href=&#34;https://github.com/sethmund&#34;&gt;@sethmund&lt;/a&gt;, &lt;a href=&#34;https://github.com/sfirke&#34;&gt;@sfirke&lt;/a&gt;, &lt;a href=&#34;https://github.com/SimonCoulombe&#34;&gt;@SimonCoulombe&lt;/a&gt;, &lt;a href=&#34;https://github.com/Stephonomon&#34;&gt;@Stephonomon&lt;/a&gt;, &lt;a href=&#34;https://github.com/stufield&#34;&gt;@stufield&lt;/a&gt;, &lt;a href=&#34;https://github.com/tdjames1&#34;&gt;@tdjames1&lt;/a&gt;, &lt;a href=&#34;https://github.com/thierrygosselin&#34;&gt;@thierrygosselin&lt;/a&gt;, &lt;a href=&#34;https://github.com/tklebel&#34;&gt;@tklebel&lt;/a&gt;, &lt;a href=&#34;https://github.com/tmastny&#34;&gt;@tmastny&lt;/a&gt;, &lt;a href=&#34;https://github.com/trannhatanh89&#34;&gt;@trannhatanh89&lt;/a&gt;, &lt;a href=&#34;https://github.com/TrentLobdell&#34;&gt;@TrentLobdell&lt;/a&gt;, &lt;a href=&#34;https://github.com/wcmbishop&#34;&gt;@wcmbishop&lt;/a&gt;, &lt;a href=&#34;https://github.com/wulixin&#34;&gt;@wulixin&lt;/a&gt;, &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zeehio&#34;&gt;@zeehio&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Multi Process Task Queue in 100 Lines of R Code</title>
      <link>https://www.tidyverse.org/blog/2019/09/callr-task-q/</link>
      <pubDate>Mon, 09 Sep 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/09/callr-task-q/</guid>
      <description>PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};  Introduction This post is a demo of callr::r_session, a persistent R session you can use to run R code asynchronously. I set out to build a task queue, which runs tasks in subprocesses, concurrently, in a mere 100 lines of R code.
Here is a short teaser for how the queue will work. task_q$new() creates a new R6 object, which represents the queue.</description>
      <content>


&lt;STYLE type=&#39;text/css&#39; scoped&gt;
PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};
&lt;/STYLE&gt;
&lt;div id=&#34;introduction&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This post is a demo of &lt;code&gt;callr::r_session&lt;/code&gt;, a persistent R session you can
use to run R code asynchronously. I set out to build a task queue, which
runs tasks in subprocesses, concurrently, in a mere 100 lines of R code.&lt;/p&gt;
&lt;p&gt;Here is a short teaser for how the queue will work. &lt;code&gt;task_q$new()&lt;/code&gt; creates
a new R6 object, which represents the queue. Its &lt;code&gt;push()&lt;/code&gt; method adds a
task, which is a function and its arguments, similar to &lt;code&gt;callr::r()&lt;/code&gt;.
The &lt;code&gt;pop()&lt;/code&gt; method gets the results of the first task that has finished.
&lt;code&gt;pop()&lt;/code&gt; has a timeout argument, which lets you wait for a task to finish,
if all pushed tasks are still running. It returns &lt;code&gt;NULL&lt;/code&gt; if no task has
finished before the timeout was over. The timeout can be &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;Inf&lt;/code&gt;,
meaning no wait at all, or wait indefinitely. The default timeout is &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q &amp;lt;- task_q$new()
q$push(function() { Sys.getpid() })
q$push(function() { Sys.sleep(.5); Sys.getpid() })
q$pop()
#&amp;gt; NULL&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This &lt;code&gt;pop()&lt;/code&gt; call returned &lt;code&gt;NULL&lt;/code&gt;, as none of the tasks are done yet.
Even though running &lt;code&gt;Sys.getpid()&lt;/code&gt; is fast, the worker processes also need
200-500 ms time start up, when the queue is created. If you are willing to
wait a bit, at least one task should be done in less than half a second
(500 ms), but usually not the second one yet:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q$pop(500)$result
#&amp;gt; [1] 18383
q$pop()
#&amp;gt; NULL&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;poll()&lt;/code&gt; method checks for finished tasks without removing their
results from the queue. It also has a timeout parameter, which works the
same way as &lt;code&gt;pop()&lt;/code&gt;’s timeout. &lt;code&gt;poll()&lt;/code&gt; returns the identifiers of all
tasks that are done.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q$poll(Inf)
#&amp;gt; [1] &amp;quot;.2&amp;quot;
q$pop()$result
#&amp;gt; [1] 18385&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the queue is empty, i.e. no tasks are running and no tasks are waiting,
then &lt;code&gt;pop()&lt;/code&gt; always returns &lt;code&gt;NULL&lt;/code&gt;, immediately, because there is nothing
to wait for:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q$pop()
#&amp;gt; NULL&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;api-design&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;API design&lt;/h2&gt;
&lt;p&gt;The task queue will be an R6 class, with &lt;code&gt;push()&lt;/code&gt;, &lt;code&gt;pop()&lt;/code&gt;, &lt;code&gt;poll()&lt;/code&gt;
methods like above, and some other query methods:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;task_q &amp;lt;- R6::R6Class(
  &amp;quot;task_q&amp;quot;,
  public = list(
    initialize      = function(num_workers = 4L) { },
    get_num_waiting = function() { },
    get_num_running = function() { },
    get_num_done    = function() { },
    is_idle         = function() { },
    list_tasks      = function() { },

    push = function(fun, args = list(), id = NULL) { },
    poll = function(timeout = 0) { },
    pop = function(timeout = 0) { }
  )
)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;initialize()&lt;/code&gt; has an argument to set the number of workers. The size of
the worker pool remains fixed for the lifetime of the queue.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;get_num_*()&lt;/code&gt; methods return the number of waiting, running and
completed tasks. &lt;code&gt;get_num_done()&lt;/code&gt; includes tasks that haven’t been
&lt;code&gt;pop()&lt;/code&gt;-d yet. Once a task is &lt;code&gt;pop()&lt;/code&gt;-d, it is removed completely from the
queue.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;is_idle()&lt;/code&gt; returns &lt;code&gt;TRUE&lt;/code&gt; if the queue does not have any tasks (in any
state). &lt;code&gt;list_tasks()&lt;/code&gt; returns a data frame (tibble) with data about the
tasks. This is especially useful for debugging.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;push()&lt;/code&gt; adds a task to the queue. &lt;code&gt;poll()&lt;/code&gt; returns the ids of all tasks
that are done. &lt;code&gt;pop()&lt;/code&gt; returns the result of the oldest task that is done.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;data-structure&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Data structure&lt;/h2&gt;
&lt;p&gt;Before writing the methods, I’ll design the data structure that will
store all information about the tasks and the worker processes. The
standard data structure for a list of records is a data frame in R.&lt;/p&gt;
&lt;p&gt;A logical choice would be to have two data frames, one for the
tasks, and another one for the workers. Then we could assign unique
identifiers to both tasks and processes and cross-reference them in the
two data frames, to mark which task a worker is running, and which worker
a task is running on.&lt;/p&gt;
&lt;p&gt;I’ll go a step further here, and store both the tasks and the workers
&lt;em&gt;in the same&lt;/em&gt; data frame. This will simplify the implementation
considerably. The queue will create a dummy &lt;em&gt;idle&lt;/em&gt; task for each worker.
Each worker will (pretend to) run its dummy task if there are no other,
real tasks waiting in the queue. So the task list will always contain at
least as many tasks as the number of workers in the queue.&lt;/p&gt;
&lt;p&gt;An example for a task data frame:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q$list_tasks()
#&amp;gt; # A tibble: 9 x 7
#&amp;gt;   id      idle  state   fun    args       worker     result
#&amp;gt;   &amp;lt;chr&amp;gt;   &amp;lt;lgl&amp;gt; &amp;lt;chr&amp;gt;   &amp;lt;list&amp;gt; &amp;lt;list&amp;gt;     &amp;lt;list&amp;gt;     &amp;lt;list&amp;gt;
#&amp;gt; 1 .11     FALSE running &amp;lt;fn&amp;gt;   &amp;lt;list [1]&amp;gt; &amp;lt;r_sessin&amp;gt; &amp;lt;NULL&amp;gt;
#&amp;gt; 2 .12     FALSE running &amp;lt;fn&amp;gt;   &amp;lt;list [1]&amp;gt; &amp;lt;r_sessin&amp;gt; &amp;lt;NULL&amp;gt;
#&amp;gt; 3 .13     FALSE running &amp;lt;fn&amp;gt;   &amp;lt;list [1]&amp;gt; &amp;lt;r_sessin&amp;gt; &amp;lt;NULL&amp;gt;
#&amp;gt; 4 .14     FALSE running &amp;lt;fn&amp;gt;   &amp;lt;list [1]&amp;gt; &amp;lt;r_sessin&amp;gt; &amp;lt;NULL&amp;gt;
#&amp;gt; 5 .15     FALSE waiting &amp;lt;fn&amp;gt;   &amp;lt;list [1]&amp;gt; &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;
#&amp;gt; 6 .idle-1 TRUE  waiting &amp;lt;NULL&amp;gt; &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;
#&amp;gt; 7 .idle-2 TRUE  waiting &amp;lt;NULL&amp;gt; &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;
#&amp;gt; 8 .idle-3 TRUE  waiting &amp;lt;NULL&amp;gt; &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;
#&amp;gt; 9 .idle-4 TRUE  waiting &amp;lt;NULL&amp;gt; &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;     &amp;lt;NULL&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The columns are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;id&lt;/code&gt;: a character id, which can be user-supplied or auto-assigned (if the
user did not supply it). This is useful to identify tasks.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;idle&lt;/code&gt;: a logical flag, whether this is a dummy idle task or not.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;state&lt;/code&gt;: current state of the task. More about this shortly.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fun&lt;/code&gt;: the function the task needs to run. This is a list column.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;args&lt;/code&gt;: arguments to pass to the function. This is a list itself,
so the column is a list column.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;worker&lt;/code&gt;: the &lt;code&gt;callr::r_session&lt;/code&gt; object, the R session that is running
the task, or &lt;code&gt;NULL&lt;/code&gt; if the task is not running.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;result&lt;/code&gt;: another list column, the result of the run, if the task is
already done, &lt;code&gt;NULL&lt;/code&gt; otherwise.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The possible task states are: &lt;em&gt;waiting&lt;/em&gt;, &lt;em&gt;running&lt;/em&gt;, &lt;em&gt;ready&lt;/em&gt; and &lt;em&gt;done&lt;/em&gt;.
The first two are not very surprising. The distinction between the
last two is somewhat technical. A task is &lt;em&gt;ready&lt;/em&gt; if the background R
session has finished running it. The queue hasn’t read out its result yet,
and the R session is still assigned to it. (I.e. the task’s &lt;code&gt;worker&lt;/code&gt; column
is not &lt;code&gt;NULL&lt;/code&gt;.) A task is &lt;em&gt;done&lt;/em&gt; if the queue has already read out the
result of the function call, and has reassigned the R session to another
task, so its &lt;code&gt;worker&lt;/code&gt; column is &lt;code&gt;NULL&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Tasks that are &lt;em&gt;running&lt;/em&gt; and &lt;em&gt;ready&lt;/em&gt; always have an R session assigned to
them. Since all R sessions are always assigned to tasks (dummy idle tasks,
if there is nothing else), this means the that the sum of the &lt;em&gt;running&lt;/em&gt;
and &lt;em&gt;ready&lt;/em&gt; tasks always equals the number of workers.&lt;/p&gt;
&lt;p&gt;The idle tasks are somewhat special, because they are never &lt;em&gt;done&lt;/em&gt;. If
an idle task is &lt;em&gt;ready&lt;/em&gt; and its worker is reassigned, it will be &lt;em&gt;waiting&lt;/em&gt;
again. They are also almost never in the &lt;em&gt;running&lt;/em&gt; state. When the queue
assigns a worker to an idle task, the task will immediately go into the
&lt;em&gt;ready&lt;/em&gt; state, since the queue is immediately allowed to re-assign the
worker, should a real task be &lt;em&gt;waiting&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;However, when a worker is starting up, its idle task is &lt;em&gt;running&lt;/em&gt;, until
their background R process has started up. After this initial &lt;em&gt;running&lt;/em&gt;
state the idle tasks are always either &lt;em&gt;waiting&lt;/em&gt; or &lt;em&gt;ready&lt;/em&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;implementation&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Implementation&lt;/h2&gt;
&lt;p&gt;I am ready to start the implementation now. I’ll focus on the individual
methods here, and show the complete code of the R6 class at the end.
Let’s start with the internal data. &lt;code&gt;tasks&lt;/code&gt; contains the task data frame,
&lt;code&gt;initialize()&lt;/code&gt; will create it. &lt;code&gt;next_id&lt;/code&gt; and &lt;code&gt;get_next_id&lt;/code&gt; will provide
us unique task ids. I prefix these with a dot, to increase the probability
that they won’t interfere with user supplied task ids. So they’ll
be &lt;code&gt;&amp;quot;.1&amp;quot;&lt;/code&gt;, &lt;code&gt;&amp;quot;.2&amp;quot;&lt;/code&gt;, etc.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;  private = list(
    tasks = NULL,
    next_id = 1L,
    get_next_id = function() {
      id &amp;lt;- private$next_id
      private$next_id &amp;lt;- id + 1L
      paste0(&amp;quot;.&amp;quot;, id)
    }
  )&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;initialize()&lt;/code&gt; method will just defer the work to a private method.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    initialize = function(num_workers = 4L) {
      private$start_workers(num_workers)
      invisible(self)
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The private &lt;code&gt;start_workers()&lt;/code&gt; method that actually starts the
workers and creates the &lt;code&gt;tasks&lt;/code&gt; data frame:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    start_workers = function(num_workers) {
      private$tasks &amp;lt;- tibble::tibble(
        id = character(), idle = logical(),
        state = c(&amp;quot;waiting&amp;quot;, &amp;quot;running&amp;quot;, &amp;quot;ready&amp;quot;, &amp;quot;done&amp;quot;)[0],
        fun = list(), args = list(), worker = list(), result = list())
      for (i in seq_len(num_workers)) {
        rs &amp;lt;- callr::r_session$new(wait = FALSE)
        private$tasks &amp;lt;- tibble::add_row(private$tasks,
          id = paste0(&amp;quot;.idle-&amp;quot;, i), idle = TRUE, state = &amp;quot;running&amp;quot;,
          fun = list(NULL), args = list(NULL), worker = list(rs),
          result = list(NULL))
      }
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The starting values of the empty task data frame are mostly straightforward.
If you are wondering about the indexing with zero here, it is a simple
way to list all possible task states in the code, in one place, as a note
for the code reader.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;callr::r_session$new()&lt;/code&gt; starts a background R process. The &lt;code&gt;wait = FALSE&lt;/code&gt;
argument tells callr &lt;em&gt;not&lt;/em&gt; to wait until the process is ready to run R
code. This way the R processes start up in parallel, which is worth the
trouble of making our dummy tasks a bit more complicated. The idle tasks
are named &lt;code&gt;.idle-*&lt;/code&gt;. After initialization, the workers are started, and
the &lt;em&gt;running&lt;/em&gt; idle tasks are added to the data frame.&lt;/p&gt;
&lt;p&gt;The query methods are next:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    list_tasks = function() private$tasks,
    get_num_waiting = function()
      sum(!private$tasks$idle &amp;amp; private$tasks$state == &amp;quot;waiting&amp;quot;),
    get_num_running = function() sum(private$tasks$state == &amp;quot;running&amp;quot;),
    get_num_done = function() sum(private$tasks$state == &amp;quot;done&amp;quot;),
    is_idle = function() sum(!private$tasks$idle) == 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;list_tasks()&lt;/code&gt; will just return the task data frame, for simplicity.
If not all data is needed, the &lt;code&gt;get_num_*()&lt;/code&gt; functions are simpler.
For the first two, we need to exclude the dummy idle tasks, because they
can be in the &lt;em&gt;waiting&lt;/em&gt; and &lt;em&gt;running&lt;/em&gt; state as well. They cannot be in the
&lt;em&gt;done&lt;/em&gt; state.&lt;/p&gt;
&lt;p&gt;We still need to write the &lt;code&gt;push()&lt;/code&gt;, &lt;code&gt;pop()&lt;/code&gt; and &lt;code&gt;poll()&lt;/code&gt; public methods.
As the reader might suspect, these are more involved. Let’s start with
&lt;code&gt;push()&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    push = function(fun, args = list(), id = NULL) {
      if (is.null(id)) id &amp;lt;- private$get_next_id()
      if (id %in% private$tasks$id) stop(&amp;quot;Duplicate task id&amp;quot;)
      before &amp;lt;- which(private$tasks$idle)[1]
      private$tasks &amp;lt;- tibble::add_row(private$tasks, .before = before,
        id = id, idle = FALSE, state = &amp;quot;waiting&amp;quot;, fun = list(fun),
        args = list(args), worker = list(NULL), result = list(NULL))
      private$schedule()
      invisible(id)
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The queue needs to run the tasks in the same order as they were added.
The data frame will keep the correct order, with the additional
tweak that the idle tasks are always at the end. Indeed, these should only
run if there is no other task waiting. So &lt;code&gt;push()&lt;/code&gt; adds the new task right
before the idle tasks.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;schedule()&lt;/code&gt; private method is the core of the queue. It starts the
tasks on the selected background R workers, and it also reads out the
results after they are done. I.e. it performs the &lt;em&gt;waiting&lt;/em&gt; to &lt;em&gt;running&lt;/em&gt; and
&lt;em&gt;ready&lt;/em&gt; to &lt;em&gt;done&lt;/em&gt; task state transitions. We will show it later.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;push()&lt;/code&gt; returns the id of the newly added task, this can be helpful
to follow the task and match it to the results of a &lt;code&gt;pop()&lt;/code&gt; call.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;pop()&lt;/code&gt; uses &lt;code&gt;poll()&lt;/code&gt; to get a list of tasks that are &lt;em&gt;done&lt;/em&gt;, and returns
the result of the oldest one, which is always the first, thanks to the
ordering of the task data frame.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    pop = function(timeout = 0) {
      if (is.na(done &amp;lt;- self$poll(timeout)[1])) return(NULL)
      row &amp;lt;- match(done, private$tasks$id)
      result &amp;lt;- private$tasks$result[[row]]
      private$tasks &amp;lt;- private$tasks[-row, ]
      c(result, list(task_id = done))
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If no task is &lt;em&gt;done&lt;/em&gt;, then it returns &lt;code&gt;NULL&lt;/code&gt;. The returned task is removed
from the task data frame, and from the queue in general, for good. &lt;code&gt;pop()&lt;/code&gt;
adds the id of the task to the returned result as &lt;code&gt;task_id&lt;/code&gt;, for easier
matching of tasks to results.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;poll()&lt;/code&gt; is the only method that checks on the running workers. This is
important to remember, and unfortunately easy to forget. If the user does
not call &lt;code&gt;poll()&lt;/code&gt;, either directly or via &lt;code&gt;pop()&lt;/code&gt;, the state of a &lt;em&gt;running&lt;/em&gt;
task cannot change, even if the background R session itself has finished.
In other words, one cannot check the status of the tasks by listing
the task data frame with &lt;code&gt;list_tasks()&lt;/code&gt; periodically. This will never
change if &lt;code&gt;poll()&lt;/code&gt; is not called.&lt;/p&gt;
&lt;p&gt;I start with an initial version of &lt;code&gt;poll()&lt;/code&gt;, which will need changes later,
but this is hopefully easier to understand first:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    poll = function(timeout = 0) {
      as_ms &amp;lt;- function(x) if (x == Inf) -1L else as.integer(x)
      topoll &amp;lt;- which(private$tasks$state == &amp;quot;running&amp;quot;)
      conns &amp;lt;- lapply(
        private$tasks$worker[topoll],
        function(x) x$get_poll_connection())
      pr &amp;lt;- processx::poll(conns, as_ms(timeout))
      private$tasks$state[topoll][pr == &amp;quot;ready&amp;quot;] &amp;lt;- &amp;quot;ready&amp;quot;
      private$schedule()
      private$tasks$id[private$tasks$state == &amp;quot;done&amp;quot;]
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We only need to check on tasks that are &lt;em&gt;running&lt;/em&gt;. &lt;code&gt;poll()&lt;/code&gt; uses the
&lt;code&gt;processx::poll()&lt;/code&gt; function that can wait on several &lt;code&gt;callr::r_session&lt;/code&gt;s
at once. More precisely, I extract the &lt;em&gt;poll connections&lt;/em&gt; of the
&lt;code&gt;r_session&lt;/code&gt; objects and call &lt;code&gt;processx::poll()&lt;/code&gt; on these. An &lt;code&gt;r_session&lt;/code&gt;
may have multiple pollable connections, one for its standard output
stream, one for its standard error stream. These are not used by default
in &lt;code&gt;r_session&lt;/code&gt;s, and I only want to check on the poll connection, which
signals if the R session has finished with the computation (or encountered
an error while working on it). &lt;code&gt;processx::poll()&lt;/code&gt; returns a list of
character vectors, one entry for each (&lt;em&gt;running&lt;/em&gt;) task. This is &lt;code&gt;&amp;quot;ready&amp;quot;&lt;/code&gt;
if the session is ready with the task. (Or it is &lt;code&gt;&amp;quot;silent&amp;quot;&lt;/code&gt; if it is not
ready, or &lt;code&gt;&amp;quot;timeout&amp;quot;&lt;/code&gt; if the time limit expired and no workers are ready.)&lt;/p&gt;
&lt;p&gt;All tasks that returned &lt;code&gt;&amp;quot;ready&amp;quot;&lt;/code&gt; are indeed set to the &lt;em&gt;ready&lt;/em&gt; state.
After this &lt;code&gt;poll()&lt;/code&gt; calls &lt;code&gt;schedule()&lt;/code&gt; to read out the results of the
&lt;em&gt;ready&lt;/em&gt; tasks and reassign their workers to &lt;em&gt;waiting&lt;/em&gt; ones.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;poll()&lt;/code&gt; returns the ids of all tasks that are &lt;em&gt;done&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This version of &lt;code&gt;poll()&lt;/code&gt; has a small issue when the R sessions are starting
up: it might return without any results, before the specified timeout
value is over. At startup the idle tasks are &lt;em&gt;running,&lt;/em&gt; and they are
polled by &lt;code&gt;processx::poll()&lt;/code&gt;. If any of the R sessions start up before the
timeout is over, &lt;code&gt;processx::poll()&lt;/code&gt; returns with &lt;code&gt;&amp;quot;ready&amp;quot;&lt;/code&gt; for them.
But &lt;code&gt;schedule()&lt;/code&gt; cannot mark these tasks as &lt;em&gt;done&lt;/em&gt;, because they are idle
tasks, they’ll be &lt;em&gt;waiting&lt;/em&gt;, and with no task &lt;em&gt;done&lt;/em&gt;, &lt;code&gt;poll()&lt;/code&gt;
will return an empty vector. This is problematic, because &lt;code&gt;poll()&lt;/code&gt;
promises to either wait until the specified timeout &lt;em&gt;or&lt;/em&gt; return a task
that is &lt;em&gt;done&lt;/em&gt;. So we need to wrap the simplified &lt;code&gt;poll()&lt;/code&gt; into a loop, and
keep calling &lt;code&gt;processx::poll()&lt;/code&gt; until either the timeout
expires or a task is &lt;em&gt;done&lt;/em&gt;. The final &lt;code&gt;poll()&lt;/code&gt; looks like this:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    poll = function(timeout = 0) {
      limit &amp;lt;- Sys.time() + timeout
      as_ms &amp;lt;- function(x) if (x == Inf) -1L else as.integer(x)
      repeat{
        topoll &amp;lt;- which(private$tasks$state == &amp;quot;running&amp;quot;)
        conns &amp;lt;- lapply(
          private$tasks$worker[topoll],
          function(x) x$get_poll_connection())
        pr &amp;lt;- processx::poll(conns, as_ms(timeout))
        private$tasks$state[topoll][pr == &amp;quot;ready&amp;quot;] &amp;lt;- &amp;quot;ready&amp;quot;
        private$schedule()
        ret &amp;lt;- private$tasks$id[private$tasks$state == &amp;quot;done&amp;quot;]
        if (is.finite(timeout)) timeout &amp;lt;- limit - Sys.time()
        if (length(ret) || timeout &amp;lt; 0) break;
      }
      ret
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Only the private &lt;code&gt;schedule()&lt;/code&gt; method is missing now:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;    schedule = function() {
      ready &amp;lt;- which(private$tasks$state == &amp;quot;ready&amp;quot;)
      if (!length(ready)) return()
      rss &amp;lt;- private$tasks$worker[ready]

      private$tasks$result[ready] &amp;lt;- lapply(rss, function(x) x$read())
      private$tasks$worker[ready] &amp;lt;- replicate(length(ready), NULL)
      private$tasks$state[ready] &amp;lt;-
        ifelse(private$tasks$idle[ready], &amp;quot;waiting&amp;quot;, &amp;quot;done&amp;quot;)

      waiting &amp;lt;- which(private$tasks$state == &amp;quot;waiting&amp;quot;)[1:length(ready)]
      private$tasks$worker[waiting] &amp;lt;- rss
      private$tasks$state[waiting] &amp;lt;-
        ifelse(private$tasks$idle[waiting], &amp;quot;ready&amp;quot;, &amp;quot;running&amp;quot;)
      lapply(waiting, function(i) {
        if (! private$tasks$idle[i]) {
          private$tasks$worker[[i]]$call(private$tasks$fun[[i]],
                                         private$tasks$args[[i]])
        }
      })
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;schedule()&lt;/code&gt;’s job is to perform the &lt;em&gt;ready&lt;/em&gt; to &lt;em&gt;done&lt;/em&gt; and the
&lt;em&gt;waiting&lt;/em&gt; to &lt;em&gt;running&lt;/em&gt; state transitions. The first involves reading
out the results of the &lt;em&gt;ready&lt;/em&gt; tasks and the second involves starting
new computation on the workers.&lt;/p&gt;
&lt;p&gt;For every &lt;em&gt;ready&lt;/em&gt; task, &lt;code&gt;schedule()&lt;/code&gt; perform three steps:&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;Reads out and stores its result. (It can do this for the idle tasks
as well, for these &lt;code&gt;r_session$read()&lt;/code&gt; will return &lt;code&gt;NULL&lt;/code&gt;.)&lt;/li&gt;
&lt;li&gt;Removes its worker, i.e. sets it to &lt;code&gt;NULL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Updates its state to &lt;em&gt;done&lt;/em&gt;. (Or to &lt;em&gt;waiting&lt;/em&gt; if it is an idle task.)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Then it deals with the &lt;em&gt;waiting&lt;/em&gt; tasks, but not more than the number of
&lt;em&gt;ready&lt;/em&gt; tasks the queue had. For these &lt;em&gt;waiting&lt;/em&gt; tasks &lt;code&gt;schedule()&lt;/code&gt;
performs three steps:&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;Assigns a just removed worker to it.&lt;/li&gt;
&lt;li&gt;Sets state to &lt;em&gt;running&lt;/em&gt;. (Or to &lt;em&gt;ready&lt;/em&gt; for idle tasks.)&lt;/li&gt;
&lt;li&gt;Calls &lt;code&gt;fun(args)&lt;/code&gt; in the background session.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When selecting the waiting tasks to run, the ordering of the task table
makes sure that the oldest task is selected first, and that idle tasks
are only selected if there is nothing else to run. The idle tasks make sure
that &lt;code&gt;schedule()&lt;/code&gt; always has at least as many waiting tasks as ready.&lt;/p&gt;
&lt;p&gt;It is possible that &lt;code&gt;schedule()&lt;/code&gt; first sets an idle task to &lt;em&gt;waiting&lt;/em&gt; and
then selects it and (re-)assigns a worker to it. This is perfectly fine.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;try-it-out&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Try it out&lt;/h2&gt;
&lt;p&gt;As a simple example, we add a bunch of fake tasks to a queue, and then
run a simple event loop to completion. (To run this code, first
you need to run the complete code at the end of the post.)&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q &amp;lt;- task_q$new()
for (i in 1:10) {
  q$push(function(i) { Sys.sleep(runif(1)); paste(i, &amp;quot;done&amp;quot;) }, list(i = i))
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is how the queue looks after adding all these tasks:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q$list_tasks()&lt;/code&gt;&lt;/pre&gt;
&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 14 x 7&lt;/span&gt;&lt;span&gt;
#&amp;gt;    id      idle  state   fun    args             worker     result
#&amp;gt;    &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;lgl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 1&lt;/span&gt;&lt;span&gt; .1      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 2&lt;/span&gt;&lt;span&gt; .2      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 3&lt;/span&gt;&lt;span&gt; .3      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 4&lt;/span&gt;&lt;span&gt; .4      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 5&lt;/span&gt;&lt;span&gt; .5      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 6&lt;/span&gt;&lt;span&gt; .6      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 7&lt;/span&gt;&lt;span&gt; .7      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 8&lt;/span&gt;&lt;span&gt; .8      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 9&lt;/span&gt;&lt;span&gt; .9      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;10&lt;/span&gt;&lt;span&gt; .10     FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;11&lt;/span&gt;&lt;span&gt; .idle-1 TRUE  running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;12&lt;/span&gt;&lt;span&gt; .idle-2 TRUE  running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;13&lt;/span&gt;&lt;span&gt; .idle-3 TRUE  running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;14&lt;/span&gt;&lt;span&gt; .idle-4 TRUE  running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;p&gt;Probably no tasks are running just yet. The queue only has the chance to
change its state when you &lt;code&gt;push()&lt;/code&gt;, &lt;code&gt;pop()&lt;/code&gt; or &lt;code&gt;poll()&lt;/code&gt;. When pushing the
tasks to the queue, the workers were still starting up (i.e. the idle tasks
are &lt;em&gt;running&lt;/em&gt;), so &lt;code&gt;push()&lt;/code&gt; could not start any real tasks. Never mind, as
soon as you try to &lt;code&gt;pop()&lt;/code&gt; or &lt;code&gt;poll()&lt;/code&gt;, they’ll start running:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q$poll(1000L)
#&amp;gt; [1] &amp;quot;.2&amp;quot;
q$list_tasks()&lt;/code&gt;&lt;/pre&gt;
&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 14 x 7&lt;/span&gt;&lt;span&gt;
#&amp;gt;    id      idle  state   fun    args             worker     result    
#&amp;gt;    &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;lgl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;list&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 1&lt;/span&gt;&lt;span&gt; .1      FALSE running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 2&lt;/span&gt;&lt;span&gt; .2      FALSE done    &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;cllr_ss_&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 3&lt;/span&gt;&lt;span&gt; .3      FALSE running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 4&lt;/span&gt;&lt;span&gt; .4      FALSE running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 5&lt;/span&gt;&lt;span&gt; .5      FALSE running &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;r_sessin&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 6&lt;/span&gt;&lt;span&gt; .6      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 7&lt;/span&gt;&lt;span&gt; .7      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 8&lt;/span&gt;&lt;span&gt; .8      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 9&lt;/span&gt;&lt;span&gt; .9      FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;10&lt;/span&gt;&lt;span&gt; .10     FALSE waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;named list [1]&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;    
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;11&lt;/span&gt;&lt;span&gt; .idle-1 TRUE  waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;cllr_ss_&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;12&lt;/span&gt;&lt;span&gt; .idle-2 TRUE  waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;cllr_ss_&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;13&lt;/span&gt;&lt;span&gt; .idle-3 TRUE  waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;cllr_ss_&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;14&lt;/span&gt;&lt;span&gt; .idle-4 TRUE  waiting &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;           &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;NULL&amp;gt;&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;&amp;lt;cllr_ss_&amp;gt;&lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;while (!q$is_idle()) {
  task_result &amp;lt;- q$pop(Inf)
  print(task_result$result)
}
#&amp;gt; [1] &amp;quot;1 done&amp;quot;
#&amp;gt; [1] &amp;quot;2 done&amp;quot;
#&amp;gt; [1] &amp;quot;3 done&amp;quot;
#&amp;gt; [1] &amp;quot;4 done&amp;quot;
#&amp;gt; [1] &amp;quot;6 done&amp;quot;
#&amp;gt; [1] &amp;quot;5 done&amp;quot;
#&amp;gt; [1] &amp;quot;7 done&amp;quot;
#&amp;gt; [1] &amp;quot;8 done&amp;quot;
#&amp;gt; [1] &amp;quot;9 done&amp;quot;
#&amp;gt; [1] &amp;quot;10 done&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;pop()&lt;/code&gt; just returns whatever &lt;code&gt;r_session$read()&lt;/code&gt; returns. Here is the last
result from the loop:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;task_result
#&amp;gt; $code
#&amp;gt; [1] 200
#&amp;gt; 
#&amp;gt; $message
#&amp;gt; [1] &amp;quot;done file47c57a1f62b5&amp;quot;
#&amp;gt; 
#&amp;gt; $result
#&amp;gt; [1] &amp;quot;10 done&amp;quot;
#&amp;gt; 
#&amp;gt; $stdout
#&amp;gt; [1] &amp;quot;&amp;quot;
#&amp;gt; 
#&amp;gt; $stderr
#&amp;gt; [1] &amp;quot;&amp;quot;
#&amp;gt; 
#&amp;gt; $error
#&amp;gt; NULL
#&amp;gt; 
#&amp;gt; $task_id
#&amp;gt; [1] &amp;quot;.10&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The important fields are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;result&lt;/code&gt;: the R object returned from the function. This is &lt;code&gt;NULL&lt;/code&gt; on
error.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;stdout&lt;/code&gt;: the standard output of the background session, while running the
function.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;stderr&lt;/code&gt;: the standard error.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;error&lt;/code&gt;: error object if the function failed. &lt;code&gt;NULL&lt;/code&gt; otherwise.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;task_id&lt;/code&gt;: the user supplied or auto-generated task id.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s see a task that errors.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;q$push(function() stop(&amp;quot;This failed, sorry&amp;quot;))
res &amp;lt;- q$pop(Inf)
res$error
#&amp;gt; &amp;lt;callr_status_error: callr subprocess failed: This failed, sorry&amp;gt;
#&amp;gt;  in process 
#&amp;gt; --&amp;gt;
#&amp;gt; &amp;lt;callr_remote_error in (function () stop(&amp;quot;This failed, sorry&amp;quot;))(): This failed, sorry&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The error has two parts, the first refers to the main process, and the
second is the original error, thrown in the background process. To help with
debugging, the error from the background process includes a stack trace:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;res$error$parent$trace&lt;/code&gt;&lt;/pre&gt;
&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; 
#&amp;gt; &lt;span style=&#39;font-weight: bold;&#39;&gt; ERROR TRACE for simpleError&lt;/span&gt;&lt;span&gt;
#&amp;gt; 
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 12. &lt;/span&gt;&lt;span&gt;(function ()  ...
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 13. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;base:::stop&lt;/span&gt;&lt;span&gt;(&#34;This failed, sorry&#34;)
#&amp;gt;     &lt;/span&gt;&lt;span style=&#39;color: #00BBBB;font-style: italic;&#39;&gt;R/&amp;lt;text&amp;gt;:1:8&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 14. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;base:::.handleSimpleError&lt;/span&gt;&lt;span&gt;(function (e)  ...
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 15. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;h&lt;/span&gt;&lt;span&gt;(simpleError(msg, call))
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #BB0000;font-weight: bold;&#39;&gt;
#&amp;gt;  x This failed, sorry &lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;p&gt;For this simple function that just calls &lt;code&gt;stop()&lt;/code&gt;, the trace is not
very exciting, but it can be very helpful in general.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;how-about-process-cleanup&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;How about process cleanup?&lt;/h2&gt;
&lt;p&gt;Luckily we don’t have to do anything extra to clean up the R processes.
&lt;code&gt;callr::r_session&lt;/code&gt; objects kill their background R session in their
finalizer, i.e. when they are garbage collected. As soon as the
workers have no references, because e.g. the queue object itself has no
references, the garbage collector will clean them up. An explicit &lt;code&gt;kill()&lt;/code&gt;
method would be still useful sometimes, but we leave that as an exercise to
the reader.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;possible-improvements&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Possible improvements&lt;/h2&gt;
&lt;p&gt;To use this task queue in real code, you would need to make it a bit more
robust and flexible.&lt;/p&gt;
&lt;ol style=&#34;list-style-type: decimal&#34;&gt;
&lt;li&gt;Most importantly, you would need to handle crashes and freezes in the
worker tasks. &lt;code&gt;callr::r_session&lt;/code&gt; does handle crashes properly, i.e.
&lt;code&gt;poll()&lt;/code&gt; returns immediately if the session crashes, and then &lt;code&gt;read()&lt;/code&gt;
returns an informative error result. But the task queue should also do
something sensible in this case, e.g. return the error result, and
restart the worker.&lt;/li&gt;
&lt;li&gt;To handle freezing worker tasks, the queue could support task timeouts,
and then kill the tasks that don’t finish before their timeout expires.
This can be probably implemented using the &lt;code&gt;r_session$interrupt()&lt;/code&gt; and
&lt;code&gt;r_session$kill()&lt;/code&gt; methods.&lt;/li&gt;
&lt;li&gt;Make the queue interrupt-safe. All operations of the queue (e.g.
&lt;code&gt;poll()&lt;/code&gt;, &lt;code&gt;pop()&lt;/code&gt;, etc.) are interruptible by the user, but they
don’t always leave the task data frame and the background sessions in a
consistent state. E.g. if &lt;code&gt;schedule()&lt;/code&gt; is interrupted and you are
unlucky, you might lose all worker processes. This is a very hard issue
to solve, the relatively new &lt;code&gt;suspendInterrupts()&lt;/code&gt; function probably
helps a lot.&lt;/li&gt;
&lt;li&gt;It would be great to be able to change the number of worker tasks of
the queue dynamically, i.e. add and remove worker processes.&lt;/li&gt;
&lt;li&gt;The whole queue could be implemented in a background process, so that
the scheduler runs concurrently with the main R process. This is far
from being trivial, especially if one wants to avoid copying data
(the function arguments) twice for every task.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div id=&#34;complete-code&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Complete code&lt;/h2&gt;
&lt;p&gt;It is also available &lt;a href=&#34;https://github.com/r-lib/callr/blob/811a02f604de2cf03264f6b35ce9ec8a412f2581/vignettes/taskq.R&#34;&gt;on GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;task_q &amp;lt;- R6::R6Class(
  &amp;quot;task_q&amp;quot;,
  public = list(
    initialize = function(concurrency = 4L) {
      private$start_workers(concurrency)
      invisible(self)
    },
    list_tasks = function() private$tasks,
    get_num_waiting = function()
      sum(!private$tasks$idle &amp;amp; private$tasks$state == &amp;quot;waiting&amp;quot;),
    get_num_running = function()
      sum(!private$tasks$idle &amp;amp; private$tasks$state == &amp;quot;running&amp;quot;),
    get_num_done = function() sum(private$tasks$state == &amp;quot;done&amp;quot;),
    is_idle = function() sum(!private$tasks$idle) == 0,

    push = function(fun, args = list(), id = NULL) {
      if (is.null(id)) id &amp;lt;- private$get_next_id()
      if (id %in% private$tasks$id) stop(&amp;quot;Duplicate task id&amp;quot;)
      before &amp;lt;- which(private$tasks$idle)[1]
      private$tasks &amp;lt;- tibble::add_row(private$tasks, .before = before,
        id = id, idle = FALSE, state = &amp;quot;waiting&amp;quot;, fun = list(fun),
        args = list(args), worker = list(NULL), result = list(NULL))
      private$schedule()
      invisible(id)
    },

    poll = function(timeout = 0) {
      limit &amp;lt;- Sys.time() + timeout
      as_ms &amp;lt;- function(x) if (x == Inf) -1L else as.integer(x)
      repeat{
        topoll &amp;lt;- which(private$tasks$state == &amp;quot;running&amp;quot;)
        conns &amp;lt;- lapply(
          private$tasks$worker[topoll],
          function(x) x$get_poll_connection())
        pr &amp;lt;- processx::poll(conns, as_ms(timeout))
        private$tasks$state[topoll][pr == &amp;quot;ready&amp;quot;] &amp;lt;- &amp;quot;ready&amp;quot;
        private$schedule()
        ret &amp;lt;- private$tasks$id[private$tasks$state == &amp;quot;done&amp;quot;]
        if (is.finite(timeout)) timeout &amp;lt;- limit - Sys.time()
        if (length(ret) || timeout &amp;lt; 0) break;
      }
      ret
    },

    pop = function(timeout = 0) {
      if (is.na(done &amp;lt;- self$poll(timeout)[1])) return(NULL)
      row &amp;lt;- match(done, private$tasks$id)
      result &amp;lt;- private$tasks$result[[row]]
      private$tasks &amp;lt;- private$tasks[-row, ]
      c(result, list(task_id = done))
    }
  ),

  private = list(
    tasks = NULL,
    next_id = 1L,
    get_next_id = function() {
      id &amp;lt;- private$next_id
      private$next_id &amp;lt;- id + 1L
      paste0(&amp;quot;.&amp;quot;, id)
    },

    start_workers = function(concurrency) {
      private$tasks &amp;lt;- tibble::tibble(
        id = character(), idle = logical(),
        state = c(&amp;quot;waiting&amp;quot;, &amp;quot;running&amp;quot;, &amp;quot;ready&amp;quot;, &amp;quot;done&amp;quot;)[NULL],
        fun = list(), args = list(), worker = list(), result = list())
      for (i in seq_len(concurrency)) {
        rs &amp;lt;- callr::r_session$new(wait = FALSE)
        private$tasks &amp;lt;- tibble::add_row(private$tasks,
          id = paste0(&amp;quot;.idle-&amp;quot;, i), idle = TRUE, state = &amp;quot;running&amp;quot;,
          fun = list(NULL), args = list(NULL), worker = list(rs),
          result = list(NULL))
      }
    },

    schedule = function() {
      ready &amp;lt;- which(private$tasks$state == &amp;quot;ready&amp;quot;)
      if (!length(ready)) return()
      rss &amp;lt;- private$tasks$worker[ready]

      private$tasks$result[ready] &amp;lt;- lapply(rss, function(x) x$read())
      private$tasks$worker[ready] &amp;lt;- replicate(length(ready), NULL)
      private$tasks$state[ready] &amp;lt;-
        ifelse(private$tasks$idle[ready], &amp;quot;waiting&amp;quot;, &amp;quot;done&amp;quot;)

      waiting &amp;lt;- which(private$tasks$state == &amp;quot;waiting&amp;quot;)[1:length(ready)]
      private$tasks$worker[waiting] &amp;lt;- rss
      private$tasks$state[waiting] &amp;lt;-
        ifelse(private$tasks$idle[waiting], &amp;quot;ready&amp;quot;, &amp;quot;running&amp;quot;)
      lapply(waiting, function(i) {
        if (! private$tasks$idle[i]) {
          private$tasks$worker[[i]]$call(private$tasks$fun[[i]],
                                         private$tasks$args[[i]])
        }
      })
    }
  )
)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content>
    </item>
    
    <item>
      <title>Tidy dev day take two: Toulouse</title>
      <link>https://www.tidyverse.org/blog/2019/09/tidy-dev-day-toulouse/</link>
      <pubDate>Fri, 06 Sep 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/09/tidy-dev-day-toulouse/</guid>
      <description>We had our second official tidyverse developer day just before useR! 2019 in Toulouse. It was a fun day, and we managed to merge around 40 pull requests on the day, and nearly 30 more afterwards. You can learn more about the experience in the words of attendees Laura Acion and Dragos Moldovan-Grünfeld.
Huge thanks to everyone who contributed to tidyverse developer day! We merged over 40 PRs and have almost 30 more to review over the next few days pic.</description>
      <content>&lt;p&gt;We had our second official &lt;a href=&#34;https://www.tidyverse.org/articles/2019/04/tidyverse-dev-day-at-user-2019/&#34;&gt;tidyverse developer
day&lt;/a&gt;
just before &lt;a href=&#34;http://www.user2019.fr/&#34;&gt;useR! 2019&lt;/a&gt; in Toulouse. It was a fun day, and we managed to merge around &lt;strong&gt;40&lt;/strong&gt; pull
requests on the day, and &lt;a href=&#34;https://github.com/search?q=is%3Apr+label%3A%22tidy-dev-day+%3Anerd_face%3A%22+created%3A%3E2019-07-07+is%3Amerged&amp;amp;type=Issues&#34;&gt;nearly &lt;strong&gt;30&lt;/strong&gt; more&lt;/a&gt; afterwards. You can learn more about the experience in the words of attendees &lt;a href=&#34;https://lacion.rbind.io/post/my-first-user/&#34;&gt;Laura
Acion&lt;/a&gt; and &lt;a href=&#34;https://www.mango-solutions.com/blog/user2019-roundup-workflow-reproducibility-and-friends&#34;&gt;Dragos
Moldovan-Grünfeld&lt;/a&gt;.&lt;/p&gt;
&lt;!--html_preserve--&gt;&lt;blockquote class=&#34;twitter-tweet&#34; data-dnt=&#34;true&#34;&gt;&lt;p lang=&#34;en&#34; dir=&#34;ltr&#34;&gt;Huge thanks to everyone who contributed to tidyverse developer day! We merged over 40 PRs and have almost 30 more to review over the next few days &lt;a href=&#34;https://t.co/uM9Tg1dMeX&#34;&gt;pic.twitter.com/uM9Tg1dMeX&lt;/a&gt;&lt;/p&gt;&amp;mdash; Hadley Wickham (@hadleywickham) &lt;a href=&#34;https://twitter.com/hadleywickham/status/1148252922272190464?ref_src=twsrc%5Etfw&#34;&gt;July 8, 2019&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src=&#34;https://platform.twitter.com/widgets.js&#34; charset=&#34;utf-8&#34;&gt;&lt;/script&gt;
&lt;!--/html_preserve--&gt;
&lt;p&gt;The event was particularly successful thanks to a few changes we made after our
&lt;a href=&#34;https://www.tidyverse.org/articles/2018/11/tidyverse-developer-day-2019/&#34;&gt;first try&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;🤝 &lt;strong&gt;Helpers&lt;/strong&gt; The goal of TDD is to provide
opportunities for everyone to contribute, regardless of their level of
expertise. This time we made sure to recruit plenty of helpers (~20 for
~70 participants) and to clearly identify them with snazzy nametags. Having
friendly faces circulating and ready to lend a hand made the event much
warmer for newcomers (and helping others is pretty satisfying, too).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;🏷 &lt;strong&gt;Post-its&lt;/strong&gt; Searching GitHub issues for a problem you
can help solve is hard enough at the best of times, but it&amp;rsquo;s darn near
impossible when you&amp;rsquo;re competing with a room full of people. To make it
easier we went back to the basics and paired every GitHub issue with a
colour-coded sticky note. This made it much easier to find issues, and
as a side-benefit made it possible to see collective progress over the day
as post-its migrated from &lt;code&gt;To Do&lt;/code&gt; to &lt;code&gt;Under Review&lt;/code&gt; to &lt;code&gt;Done&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;🛎 &lt;strong&gt;The gong&lt;/strong&gt; Getting your PR merged is a cause for
celebration, and Hadley likes to travel with a gong. It was only natural
to combine these two truths by ringing the gong every time a PR was merged!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will be hosting our next tidyverse dev day on &lt;strong&gt;January 31st&lt;/strong&gt; in San
Francisco, following &lt;a href=&#34;https://www.rstudio.com/conference/&#34;&gt;rstudio::conf(2020)&lt;/a&gt;.
We haven&amp;rsquo;t yet finalized a venue, but it&amp;rsquo;ll be convenient to the conference
location.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>pkgdown 1.4.0</title>
      <link>https://www.tidyverse.org/blog/2019/09/pkgdown-1-4-0/</link>
      <pubDate>Thu, 05 Sep 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/09/pkgdown-1-4-0/</guid>
      <description>We&amp;rsquo;re happy to announce that pkgdown 1.4.0 is now available on CRAN. pkgdown is designed to make it quick and easy to build a website for your package. Install it with:
install.packages(&amp;#34;pkgdown&amp;#34;)  Development and deployment modes     The main change in this version is that build_site(), build_reference() and build_home() gain a devel parameter that controls whether you&amp;rsquo;re in deployment or development mode.
  devel = FALSE activates deployment mode, which installs the package into a temporary library, and runs examples/articles in a new process.</description>
      <content>&lt;p&gt;We&amp;rsquo;re happy to announce that &lt;a href=&#34;https://pkgdown.r-lib.org/&#34;&gt;pkgdown&lt;/a&gt; 1.4.0 is now
available on CRAN. pkgdown is designed to make it quick and easy to build a
website for your package. Install it with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;pkgdown&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;h2 id=&#34;development-and-deployment-modes&#34;&gt;Development and deployment modes
  &lt;a href=&#34;#development-and-deployment-modes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The main change in this version is that &lt;a href=&#34;https://pkgdown.r-lib.org/reference/build_site.html&#34;&gt;&lt;code&gt;build_site()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://pkgdown.r-lib.org/reference/build_reference.html&#34;&gt;&lt;code&gt;build_reference()&lt;/code&gt;&lt;/a&gt; and  &lt;a href=&#34;https://pkgdown.r-lib.org/reference/build_home.html&#34;&gt;&lt;code&gt;build_home()&lt;/code&gt;&lt;/a&gt; gain a &lt;code&gt;devel&lt;/code&gt; parameter that controls whether you&amp;rsquo;re in deployment or development mode.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;devel = FALSE&lt;/code&gt; activates deployment mode, which installs the package into a
temporary library, and runs examples/articles in a new process. It&amp;rsquo;s the
default for &lt;code&gt;build_site()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using &lt;code&gt;build_site()&lt;/code&gt; as part of an existing deployment workflow,
you may need to set &lt;code&gt;install = FALSE&lt;/code&gt; so that the package doesn&amp;rsquo;t get
installed twice.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;devel = TRUE&lt;/code&gt; activates development mode, simulates package loading with
&lt;code&gt;pkgload::load_all()&lt;/code&gt; and does all work in the same process. This makes it
most suitable for rapid iteration, and so is the default for
&lt;code&gt;build_reference()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There were two related changes to &lt;code&gt;build_reference()&lt;/code&gt; and &lt;code&gt;build_home()&lt;/code&gt;: &lt;code&gt;build_reference()&lt;/code&gt; no longer runs &lt;code&gt;devtools::document()&lt;/code&gt; and &lt;code&gt;build_home()&lt;/code&gt; no longer rebuilds &lt;code&gt;README.Rmd&lt;/code&gt;.  This makes pkgdown&amp;rsquo;s responsibilities more clear: it only modifies files in &lt;code&gt;docs/&lt;/code&gt;.&lt;/p&gt;




&lt;h2 id=&#34;other-important-changes&#34;&gt;Other important changes
  &lt;a href=&#34;#other-important-changes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://pkgdown.r-lib.org/reference/build_home.html&#34;&gt;&lt;code&gt;build_home()&lt;/code&gt;&lt;/a&gt; now
strips quotes from &lt;code&gt;Title&lt;/code&gt; and &lt;code&gt;Description&lt;/code&gt; fields when generating page
metadata. Additionally, you can now override the defaults via the &lt;code&gt;title&lt;/code&gt;
and &lt;code&gt;description&lt;/code&gt; fields in the &lt;code&gt;home&lt;/code&gt; section of &lt;code&gt;_pkgdown.yml&lt;/code&gt;. Setting a
custom title is good practice as it allows you to add &amp;ldquo;R&amp;rdquo; and &amp;ldquo;package&amp;rdquo; to
the title, which is likely to be useful for SEO.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://pkgdown.r-lib.org/articles/linking.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;linking&amp;quot;)&lt;/code&gt;&lt;/a&gt;
describes how pkgdown&amp;rsquo;s automatic linking works, and how to ensure that
cross-package links point to the right place.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For external packages, if we can&amp;rsquo;t find an existing pkgdown website to link
to we now link to &lt;a href=&#34;https://rdrr.io&#34;&gt;https://rdrr.io&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The rendering of &lt;code&gt;\examples{}&lt;/code&gt;, &lt;code&gt;\dots&lt;/code&gt;, &lt;code&gt;\tabular{}&lt;/code&gt;, &lt;code&gt;\subsection{}&lt;/code&gt;,
and &lt;code&gt;\preformatted{}&lt;/code&gt; has been improved.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The navbar is now automatically hidden with
&lt;a href=&#34;https://wicky.nillia.ms/headroom.js/&#34;&gt;headroom.js&lt;/a&gt;, and the sidebar
is implemented with pure CSS.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A big thank you goes to &lt;a href=&#34;https://github.com/jayhesselberth&#34;&gt;@jayhesselberth&lt;/a&gt; (the co-maintainer of pkgdown), and to to the 77 other people who contributed to the release:
&lt;a href=&#34;https://github.com/abodnahk&#34;&gt;@abodnahk&lt;/a&gt;, &lt;a href=&#34;https://github.com/agila5&#34;&gt;@agila5&lt;/a&gt;, &lt;a href=&#34;https://github.com/AliciaSchep&#34;&gt;@AliciaSchep&lt;/a&gt;, &lt;a href=&#34;https://github.com/andrie&#34;&gt;@andrie&lt;/a&gt;, &lt;a href=&#34;https://github.com/aravind-j&#34;&gt;@aravind-j&lt;/a&gt;, &lt;a href=&#34;https://github.com/asardaes&#34;&gt;@asardaes&lt;/a&gt;, &lt;a href=&#34;https://github.com/Bisaloo&#34;&gt;@Bisaloo&lt;/a&gt;, &lt;a href=&#34;https://github.com/Blackglade&#34;&gt;@Blackglade&lt;/a&gt;, &lt;a href=&#34;https://github.com/burgerga&#34;&gt;@burgerga&lt;/a&gt;, &lt;a href=&#34;https://github.com/cboettig&#34;&gt;@cboettig&lt;/a&gt;, &lt;a href=&#34;https://github.com/cderv&#34;&gt;@cderv&lt;/a&gt;, &lt;a href=&#34;https://github.com/chfleming&#34;&gt;@chfleming&lt;/a&gt;, &lt;a href=&#34;https://github.com/choisy&#34;&gt;@choisy&lt;/a&gt;, &lt;a href=&#34;https://github.com/CrumpLab&#34;&gt;@CrumpLab&lt;/a&gt;, &lt;a href=&#34;https://github.com/davidski&#34;&gt;@davidski&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/ddiez&#34;&gt;@ddiez&lt;/a&gt;, &lt;a href=&#34;https://github.com/docbiz&#34;&gt;@docbiz&lt;/a&gt;, &lt;a href=&#34;https://github.com/dongzhuoer&#34;&gt;@dongzhuoer&lt;/a&gt;, &lt;a href=&#34;https://github.com/dpprdan&#34;&gt;@dpprdan&lt;/a&gt;, &lt;a href=&#34;https://github.com/echasnovski&#34;&gt;@echasnovski&lt;/a&gt;, &lt;a href=&#34;https://github.com/EmilHvitfeldt&#34;&gt;@EmilHvitfeldt&lt;/a&gt;, &lt;a href=&#34;https://github.com/emilyriederer&#34;&gt;@emilyriederer&lt;/a&gt;, &lt;a href=&#34;https://github.com/espinielli&#34;&gt;@espinielli&lt;/a&gt;, &lt;a href=&#34;https://github.com/florisvdh&#34;&gt;@florisvdh&lt;/a&gt;, &lt;a href=&#34;https://github.com/flying-sheep&#34;&gt;@flying-sheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/Fredo-XVII&#34;&gt;@Fredo-XVII&lt;/a&gt;, &lt;a href=&#34;https://github.com/grabear&#34;&gt;@grabear&lt;/a&gt;, &lt;a href=&#34;https://github.com/GregorDeCillia&#34;&gt;@GregorDeCillia&lt;/a&gt;, &lt;a href=&#34;https://github.com/gustavdelius&#34;&gt;@gustavdelius&lt;/a&gt;, &lt;a href=&#34;https://github.com/gvegayon&#34;&gt;@gvegayon&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/ijlyttle&#34;&gt;@ijlyttle&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackwasey&#34;&gt;@jackwasey&lt;/a&gt;, &lt;a href=&#34;https://github.com/jangorecki&#34;&gt;@jangorecki&lt;/a&gt;, &lt;a href=&#34;https://github.com/jemus42&#34;&gt;@jemus42&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeroen&#34;&gt;@jeroen&lt;/a&gt;, &lt;a href=&#34;https://github.com/JohnCoene&#34;&gt;@JohnCoene&lt;/a&gt;, &lt;a href=&#34;https://github.com/katrinleinweber&#34;&gt;@katrinleinweber&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinushey&#34;&gt;@kevinushey&lt;/a&gt;, &lt;a href=&#34;https://github.com/kkmann&#34;&gt;@kkmann&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/maelle&#34;&gt;@maelle&lt;/a&gt;, &lt;a href=&#34;https://github.com/maksymiuks&#34;&gt;@maksymiuks&lt;/a&gt;, &lt;a href=&#34;https://github.com/manish-saraswat-olx&#34;&gt;@manish-saraswat-olx&lt;/a&gt;, &lt;a href=&#34;https://github.com/maurolepore&#34;&gt;@maurolepore&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxheld83&#34;&gt;@maxheld83&lt;/a&gt;, &lt;a href=&#34;https://github.com/maximilianmordig&#34;&gt;@maximilianmordig&lt;/a&gt;, &lt;a href=&#34;https://github.com/mcanouil&#34;&gt;@mcanouil&lt;/a&gt;, &lt;a href=&#34;https://github.com/MichaelChirico&#34;&gt;@MichaelChirico&lt;/a&gt;, &lt;a href=&#34;https://github.com/mitchelloharawild&#34;&gt;@mitchelloharawild&lt;/a&gt;, &lt;a href=&#34;https://github.com/mjsteinbaugh&#34;&gt;@mjsteinbaugh&lt;/a&gt;, &lt;a href=&#34;https://github.com/msberends&#34;&gt;@msberends&lt;/a&gt;, &lt;a href=&#34;https://github.com/muschellij2&#34;&gt;@muschellij2&lt;/a&gt;, &lt;a href=&#34;https://github.com/NEONKID&#34;&gt;@NEONKID&lt;/a&gt;, &lt;a href=&#34;https://github.com/noamross&#34;&gt;@noamross&lt;/a&gt;, &lt;a href=&#34;https://github.com/nteetor&#34;&gt;@nteetor&lt;/a&gt;, &lt;a href=&#34;https://github.com/paul-buerkner&#34;&gt;@paul-buerkner&lt;/a&gt;, &lt;a href=&#34;https://github.com/peterdesmet&#34;&gt;@peterdesmet&lt;/a&gt;, &lt;a href=&#34;https://github.com/ramiromagno&#34;&gt;@ramiromagno&lt;/a&gt;, &lt;a href=&#34;https://github.com/rorynolan&#34;&gt;@rorynolan&lt;/a&gt;, &lt;a href=&#34;https://github.com/royfrancis&#34;&gt;@royfrancis&lt;/a&gt;, &lt;a href=&#34;https://github.com/s-fleck&#34;&gt;@s-fleck&lt;/a&gt;, &lt;a href=&#34;https://github.com/scizmeli&#34;&gt;@scizmeli&lt;/a&gt;, &lt;a href=&#34;https://github.com/sdhutchins&#34;&gt;@sdhutchins&lt;/a&gt;, &lt;a href=&#34;https://github.com/seanhardison1&#34;&gt;@seanhardison1&lt;/a&gt;, &lt;a href=&#34;https://github.com/seymakalay&#34;&gt;@seymakalay&lt;/a&gt;, &lt;a href=&#34;https://github.com/sharlagelfand&#34;&gt;@sharlagelfand&lt;/a&gt;, &lt;a href=&#34;https://github.com/surmann&#34;&gt;@surmann&lt;/a&gt;, &lt;a href=&#34;https://github.com/talgalili&#34;&gt;@talgalili&lt;/a&gt;, &lt;a href=&#34;https://github.com/TheOnlyArtz&#34;&gt;@TheOnlyArtz&lt;/a&gt;, &lt;a href=&#34;https://github.com/thierrygosselin&#34;&gt;@thierrygosselin&lt;/a&gt;, &lt;a href=&#34;https://github.com/thomasp85&#34;&gt;@thomasp85&lt;/a&gt;, &lt;a href=&#34;https://github.com/tobyhodges&#34;&gt;@tobyhodges&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yiluheihei&#34;&gt;@yiluheihei&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>tidymodels updates</title>
      <link>https://www.tidyverse.org/blog/2019/09/tidymodels-2019-09/</link>
      <pubDate>Thu, 05 Sep 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/09/tidymodels-2019-09/</guid>
      <description>We&amp;rsquo;ve sent a few packages to CRAN recently. Here&amp;rsquo;s a recap of the changes (and some notes at the bottom):
recipes 0.1.6      Breaking Changes      Since 2018, a warning has been issued when the wrong argument was used in bake(recipe, newdata). The deprecation period is over and new_data is officially required. Previously, if step_other() did not collapse any levels, it would still add an &amp;ldquo;other&amp;rdquo; level to the factor.</description>
      <content>&lt;p&gt;We&amp;rsquo;ve sent a few packages to CRAN recently. Here&amp;rsquo;s a recap of the changes (and some notes at the bottom):&lt;/p&gt;




&lt;h2 id=&#34;recipes-016&#34;&gt;recipes 0.1.6
  &lt;a href=&#34;#recipes-016&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;breaking-changes&#34;&gt;Breaking Changes
  &lt;a href=&#34;#breaking-changes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Since 2018, a warning has been issued when the wrong argument was used in &lt;code&gt;bake(recipe, newdata)&lt;/code&gt;. The deprecation period is over and &lt;code&gt;new_data&lt;/code&gt; is officially required.&lt;/li&gt;
&lt;li&gt;Previously, if &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_other.html&#34;&gt;&lt;code&gt;step_other()&lt;/code&gt;&lt;/a&gt; did &lt;em&gt;not&lt;/em&gt; collapse any levels, it would still add an &amp;ldquo;other&amp;rdquo; level to the factor. This would lump new factor levels into &amp;ldquo;other&amp;rdquo; when data were baked (as  &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_novel.html&#34;&gt;&lt;code&gt;step_novel()&lt;/code&gt;&lt;/a&gt; does). This no longer occurs, since it was inconsistent with &lt;code&gt;?step_other&lt;/code&gt;, which said that: &amp;ldquo;If no pooling is done the data are unmodified&amp;rdquo;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;new-operations&#34;&gt;New Operations:
  &lt;a href=&#34;#new-operations&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_normalize.html&#34;&gt;&lt;code&gt;step_normalize()&lt;/code&gt;&lt;/a&gt; centers and scales the data (if you are, like Max, too lazy to use two separate steps).&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_unknown.html&#34;&gt;&lt;code&gt;step_unknown()&lt;/code&gt;&lt;/a&gt; will convert missing data in categorical columns to &amp;ldquo;unknown&amp;rdquo; and update factor levels.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;other-changes&#34;&gt;Other Changes:
  &lt;a href=&#34;#other-changes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;If the &lt;code&gt;threshold&lt;/code&gt; argument of &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_other.html&#34;&gt;&lt;code&gt;step_other()&lt;/code&gt;&lt;/a&gt; is greater than one, it specifies the minimum sample size before the levels of the factor are collapsed into the &amp;ldquo;other&amp;rdquo; category. &lt;a href=&#34;https://github.com/tidymodels/recipes/issues/289&#34;&gt;#289&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_knnimpute.html&#34;&gt;&lt;code&gt;step_knnimpute()&lt;/code&gt;&lt;/a&gt; can now pass two options to the underlying knn code, including the number of threads (&lt;a href=&#34;https://github.com/tidymodels/recipes/issues/323&#34;&gt;#323&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Due to changes by CRAN,  &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_nnmf.html&#34;&gt;&lt;code&gt;step_nnmf()&lt;/code&gt;&lt;/a&gt; only works on versions of R &amp;gt;= 3.6.0 due to dependency issues.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_dummy.html&#34;&gt;&lt;code&gt;step_dummy()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_other.html&#34;&gt;&lt;code&gt;step_other()&lt;/code&gt;&lt;/a&gt; are now tolerant to cases where that step&amp;rsquo;s selectors do not capture any columns. In this case, no modifications to the data are made. (&lt;a href=&#34;https://github.com/tidymodels/recipes/issues/290&#34;&gt;#290&lt;/a&gt;, &lt;a href=&#34;https://github.com/tidymodels/recipes/issues/348&#34;&gt;#348&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_dummy.html&#34;&gt;&lt;code&gt;step_dummy()&lt;/code&gt;&lt;/a&gt; can now retain the original columns that are used to make the dummy variables by setting &lt;code&gt;preserve = TRUE&lt;/code&gt;. (&lt;a href=&#34;https://github.com/tidymodels/recipes/issues/328&#34;&gt;#328&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_other.html&#34;&gt;&lt;code&gt;step_other()&lt;/code&gt;&lt;/a&gt;&amp;lsquo;s print method only reports the variables with collapsed levels (as opposed to any column that was &lt;em&gt;tested&lt;/em&gt; to see if it needed collapsing). (&lt;a href=&#34;https://github.com/tidymodels/recipes/issues/338&#34;&gt;#338&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_pca.html&#34;&gt;&lt;code&gt;step_pca()&lt;/code&gt;&lt;/a&gt;,  &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_kpca.html&#34;&gt;&lt;code&gt;step_kpca()&lt;/code&gt;&lt;/a&gt;,  &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_ica.html&#34;&gt;&lt;code&gt;step_ica()&lt;/code&gt;&lt;/a&gt;,  &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_nnmf.html&#34;&gt;&lt;code&gt;step_nnmf()&lt;/code&gt;&lt;/a&gt;,  &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_pls.html&#34;&gt;&lt;code&gt;step_pls()&lt;/code&gt;&lt;/a&gt;, and  &lt;a href=&#34;https://tidymodels.github.io/recipes/reference/step_isomap.html&#34;&gt;&lt;code&gt;step_isomap()&lt;/code&gt;&lt;/a&gt; now accept zero components. In this case, the original data are returned. Please use this with great care.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;embed-003&#34;&gt;embed 0.0.3
  &lt;a href=&#34;#embed-003&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Two new steps were added:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/embed/reference/step_umap.html&#34;&gt;&lt;code&gt;step_umap()&lt;/code&gt;&lt;/a&gt; was added for both supervised and unsupervised encodings.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/embed/reference/step_woe.html&#34;&gt;&lt;code&gt;step_woe()&lt;/code&gt;&lt;/a&gt; creates weight of evidence encodings. Thanks to Athos Petri Damiani for this.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;rsample-005&#34;&gt;rsample 0.0.5
  &lt;a href=&#34;#rsample-005&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Added three functions to compute different &lt;a href=&#34;https://tidymodels.github.io/rsample/articles/Applications/Intervals.html&#34;&gt;bootstrap confidence intervals&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A new function (&lt;a href=&#34;https://tidymodels.github.io/rsample/reference/add_resample_id.html&#34;&gt;&lt;code&gt;add_resample_id()&lt;/code&gt;&lt;/a&gt;) augments a data frame with columns for the resampling identifier.&lt;/li&gt;
&lt;li&gt;Updated &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/initial_split.html&#34;&gt;&lt;code&gt;initial_split()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/mc_cv.html&#34;&gt;&lt;code&gt;mc_cv()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/vfold_cv.html&#34;&gt;&lt;code&gt;vfold_cv()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/bootstraps.html&#34;&gt;&lt;code&gt;bootstraps()&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/group_vfold_cv.html&#34;&gt;&lt;code&gt;group_vfold_cv()&lt;/code&gt;&lt;/a&gt; to use tidyselect on the stratification variable.&lt;/li&gt;
&lt;li&gt;Updated &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/initial_split.html&#34;&gt;&lt;code&gt;initial_split()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/mc_cv.html&#34;&gt;&lt;code&gt;mc_cv()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/vfold_cv.html&#34;&gt;&lt;code&gt;vfold_cv()&lt;/code&gt;&lt;/a&gt;, and  &lt;a href=&#34;https://tidymodels.github.io/rsample/reference/bootstraps.html&#34;&gt;&lt;code&gt;bootstraps()&lt;/code&gt;&lt;/a&gt; with new &lt;code&gt;breaks&lt;/code&gt; parameter that specifies the number of bins to stratify by for a numeric stratification variable.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;parsnip-0031&#34;&gt;parsnip 0.0.3.1
  &lt;a href=&#34;#parsnip-0031&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Unplanned release based on CRAN requirements for Solaris.&lt;/p&gt;




&lt;h3 id=&#34;breaking-changes-1&#34;&gt;Breaking Changes
  &lt;a href=&#34;#breaking-changes-1&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The method that &lt;code&gt;parsnip&lt;/code&gt; uses to store the model information has changed. Any custom models from previous versions will need to use the new method for registering models. The methods are detailed in &lt;code&gt;?get_model_env&lt;/code&gt; and the &lt;a href=&#34;https://tidymodels.github.io/parsnip/articles/articles/Scratch.html&#34;&gt;package vignette for adding models&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The mode needs to be declared for models that can be used for more than one mode prior to fitting and/or translation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For &lt;code&gt;surv_reg()&lt;/code&gt;, the engine that uses the &lt;code&gt;survival&lt;/code&gt; package is now called &lt;code&gt;survival&lt;/code&gt; instead of &lt;code&gt;survreg&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For &lt;code&gt;glmnet&lt;/code&gt; models, the full regularization path is always fit regardless of the value given to &lt;code&gt;penalty&lt;/code&gt;. Previously, the model was fit by passing &lt;code&gt;penalty&lt;/code&gt; to &lt;code&gt;glmnet&lt;/code&gt;&#39;s &lt;code&gt;lambda&lt;/code&gt; argument, and the model could only make predictions at those specific values. &lt;a href=&#34;https://github.com/tidymodels/parsnip/issues/195&#34;&gt;(#195)&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;new-features&#34;&gt;New Features
  &lt;a href=&#34;#new-features&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;add_rowindex()&lt;/code&gt; can create a column called &lt;code&gt;.row&lt;/code&gt; to a data frame.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If a computational engine is not explicitly set, a default will be used. Each default is documented on the corresponding model page. A warning is issued at fit time unless verbosity is zero.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;nearest_neighbor()&lt;/code&gt; gained a &lt;code&gt;multi_predict&lt;/code&gt; method. The &lt;code&gt;multi_predict()&lt;/code&gt; documentation is a little better organized.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A suite of internal functions were added to help with upcoming model tuning features.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A &lt;code&gt;parsnip&lt;/code&gt; object always saved the name(s) of the outcome variable(s) for proper naming of the predicted values.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;corrr-04&#34;&gt;corrr 0.4
  &lt;a href=&#34;#corrr-04&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;new-features-1&#34;&gt;New features
  &lt;a href=&#34;#new-features-1&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;New function called &lt;a href=&#34;https://tidymodels.github.io/corrr/reference/dice.html&#34;&gt;&lt;code&gt;dice()&lt;/code&gt;&lt;/a&gt; function, wraps &lt;code&gt;focus(x,..., mirror = TRUE)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;A new &lt;a href=&#34;https://tidymodels.github.io/corrr/reference/retract.html&#34;&gt;&lt;code&gt;retract()&lt;/code&gt;&lt;/a&gt; function does the opposite of &lt;code&gt;stretch()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;A new argument was added to &lt;a href=&#34;https://tidymodels.github.io/corrr/reference/stretch.html&#34;&gt;&lt;code&gt;stretch()&lt;/code&gt;&lt;/a&gt; called &lt;code&gt;remove.dups&lt;/code&gt;. It removes duplicates with out removing all NAs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;improvements&#34;&gt;Improvements
  &lt;a href=&#34;#improvements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;correlate()&lt;/code&gt;&#39;s interface for databases was improved. It now only calculates unique pairs, and simplifies the formula that ultimately runs in-database. We also re-added the vignette to the package, which is also available on the site as an &lt;a href=&#34;https://tidymodels.github.io/corrr/articles/databases.html&#34;&gt;article&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;tidypredict-043&#34;&gt;tidypredict 0.4.3
  &lt;a href=&#34;#tidypredict-043&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;new-models&#34;&gt;New models
  &lt;a href=&#34;#new-models&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The new version is now able to parse the following models:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cubist()&lt;/code&gt;, from the &lt;code&gt;Cubist&lt;/code&gt; package&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctree()&lt;/code&gt;, from the &lt;code&gt;partykit&lt;/code&gt; package&lt;/li&gt;
&lt;li&gt;XGBoost trained models, via the &lt;code&gt;xgboost&lt;/code&gt; package&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;new-features-2&#34;&gt;New features
  &lt;a href=&#34;#new-features-2&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Integration with &lt;code&gt;broom&lt;/code&gt;&#39;s &lt;code&gt;tidy()&lt;/code&gt; function. It works with Regression models only&lt;/li&gt;
&lt;li&gt;Adds support for &lt;code&gt;parsnip&lt;/code&gt; fitted models: &lt;code&gt;lm&lt;/code&gt;, &lt;code&gt;randomForest&lt;/code&gt;, &lt;code&gt;ranger&lt;/code&gt;, and &lt;code&gt;earth&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Adds &lt;a href=&#34;https://tidymodels.github.io/tidypredict/reference/as_parsed_model.html&#34;&gt;&lt;code&gt;as_parsed_model()&lt;/code&gt;&lt;/a&gt; function. It adds the proper class components to the list. This allows any model exported in the correct spec to be read in by &lt;code&gt;tidypredict&lt;/code&gt;. See the &lt;a href=&#34;https://tidymodels.github.io/tidypredict/articles/save.html&#34;&gt;Save Models&lt;/a&gt; and &lt;a href=&#34;https://tidymodels.github.io/tidypredict/articles/non-r.html&#34;&gt;Non-R models&lt;/a&gt; for more information&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;improvements-1&#34;&gt;Improvements
  &lt;a href=&#34;#improvements-1&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Now supports classification models from &lt;code&gt;ranger&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;website&#34;&gt;Website
  &lt;a href=&#34;#website&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The package&amp;rsquo;s &lt;a href=&#34;https://tidymodels.github.io/tidypredict/index.html&#34;&gt;official website&lt;/a&gt; has been expanded greatly. Here are some highlights:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An article per each supported model, they are found under Model List&lt;/li&gt;
&lt;li&gt;A how to guide to save and reload models, &lt;a href=&#34;https://tidymodels.github.io/tidypredict/articles/save.html&#34;&gt;link here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;How to integrate non-R models to &lt;code&gt;tidypredict&lt;/code&gt;, &lt;a href=&#34;https://tidymodels.github.io/tidypredict/articles/non-r.html&#34;&gt;link here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;yardstick-004&#34;&gt;yardstick 0.0.4
  &lt;a href=&#34;#yardstick-004&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;new-metrics&#34;&gt;New Metrics
  &lt;a href=&#34;#new-metrics&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;Two new metrics have been added to yardstick:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/yardstick/reference/iic.html&#34;&gt;&lt;code&gt;iic()&lt;/code&gt;&lt;/a&gt; is a numeric metric for computing the index of ideality of correlation. It is a potential alternative to the traditional correlation coefficient, and has been used in QSAR models (&lt;a href=&#34;https://github.com/tidymodels/yardstick/issues/87&#34;&gt;#115&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://tidymodels.github.io/yardstick/reference/average_precision.html&#34;&gt;&lt;code&gt;average_precision()&lt;/code&gt;&lt;/a&gt; is a probability metric that can be used as an alternative to &lt;code&gt;pr_auc()&lt;/code&gt;. It has the benefit of avoiding any issues of ambiguity in the edge case where &lt;code&gt;recall == 0&lt;/code&gt; and the current number of false positives is &lt;code&gt;0&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3 id=&#34;improvements-2&#34;&gt;Improvements
  &lt;a href=&#34;#improvements-2&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pr_curve()&lt;/code&gt; (and by extension &lt;code&gt;pr_auc()&lt;/code&gt;) has been greatly improved to better handle edge cases when duplicate class probability values are present. Additionally, the first precision value in the curve is now a &lt;code&gt;1&lt;/code&gt;, rather than an &lt;code&gt;NA&lt;/code&gt;, which results in a more practical curve, and generates a more correct AUC value (&lt;a href=&#34;https://github.com/tidymodels/yardstick/issues/93&#34;&gt;#93&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Each metric function now has a &lt;code&gt;direction&lt;/code&gt; attribute, which specifies the direction required for optimization, either minimization or maximization.&lt;/li&gt;
&lt;li&gt;Documentation for class probability metrics has been improved with more informative examples (&lt;a href=&#34;https://github.com/tidymodels/yardstick/issues/100&#34;&gt;#100&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mn_log_loss()&lt;/code&gt; now uses the min/max rule before computing the log of the estimated probabilities to avoid problematic undefined log values (&lt;a href=&#34;https://github.com/tidymodels/yardstick/issues/103&#34;&gt;#103&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;upcoming-changes-and-directions&#34;&gt;Upcoming Changes and Directions
  &lt;a href=&#34;#upcoming-changes-and-directions&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We are currently working on two general use packages: &lt;code&gt;workflows&lt;/code&gt; and &lt;code&gt;tune&lt;/code&gt;. The former bundles together recipes, model object, and other items so that there can be single &lt;code&gt;fit()&lt;/code&gt; and &lt;code&gt;predict()&lt;/code&gt; methods. &lt;code&gt;tune&lt;/code&gt; will have tools for&amp;hellip; um&amp;hellip; tuning models. We are hoping to make these public in the next month or so.&lt;/p&gt;
&lt;p&gt;There will be some changes to accommodate model tuning. The &lt;code&gt;dials&lt;/code&gt; package has been re-factored substantially (see the current GH master branch) and there were some small interfaces changes to &lt;code&gt;recipes&lt;/code&gt; too (mostly backwards compatible and also on GH). We are pretty close to end of &amp;ldquo;Phase I&amp;rdquo; of our tidymodels work.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>gmailr v1.0.0</title>
      <link>https://www.tidyverse.org/blog/2019/08/gmailr-1-0-0/</link>
      <pubDate>Mon, 26 Aug 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/08/gmailr-1-0-0/</guid>
      <description>Introduction     gmailr v1.0.0 (https://gmailr.r-lib.org) is now on CRAN!
gmailr wraps the Gmail REST API v3. It provides a variety of funcitons to query your mailbox and create and send new email messages. You can retrieve, create and send emails and drafts, manage email labels, trash and untrash emails, and delete messages, drafts and threads.
The tidyverse team uses gmailr most often to send emails to the maintainers of packages which depend on our packages, to inform them when a new package release is imminent or if any of our changes require action on their part.</description>
      <content>



&lt;h2 id=&#34;introduction&#34;&gt;Introduction
  &lt;a href=&#34;#introduction&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;gmailr v1.0.0 (&lt;a href=&#34;https://gmailr.r-lib.org&#34;&gt;https://gmailr.r-lib.org&lt;/a&gt;) is now on CRAN!&lt;/p&gt;
&lt;p&gt;gmailr wraps the &lt;a href=&#34;https://developers.google.com/gmail/&#34;&gt;Gmail REST API v3&lt;/a&gt;. It provides a variety of funcitons to query your mailbox and create and send new email messages. You can retrieve, create and send emails and drafts, manage email labels, trash and untrash emails, and delete messages, drafts and threads.&lt;/p&gt;
&lt;p&gt;The tidyverse team uses gmailr most often to send emails to the maintainers of packages which depend on our packages, to inform them when a new package release is imminent or if any of our changes require action on their part.&lt;/p&gt;
&lt;p&gt;Install gmailr with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;gmailr&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;p&gt;The release of version 1.0.0 marks three events:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There are changes in the auth interface that are not backwards compatible.&lt;/li&gt;
&lt;li&gt;The built-in application has been removed.&lt;/li&gt;
&lt;li&gt;The functions have all been prefixed with &lt;code&gt;gm_()&lt;/code&gt;, to avoid name conflicts with functions in other packages (including the base package).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is also new functionality that make writing emails with non-ASCII characters more robust, and improved documentation. See the &lt;a href=&#34;http://gmailr.r-lib.org/news/index.html#gmailr-1-0-0&#34;&gt;changelog&lt;/a&gt; for the full details on this release.&lt;/p&gt;




&lt;h2 id=&#34;auth-from-gargle&#34;&gt;Auth from gargle
  &lt;a href=&#34;#auth-from-gargle&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;gmailr&amp;rsquo;s auth functionality now comes from the &lt;a href=&#34;https://gargle.r-lib.org&#34;&gt;gargle package&lt;/a&gt;, which provides R infrastructure to work with Google APIs, in general. We&amp;rsquo;ve just &lt;a href=&#34;https://www.tidyverse.org/articles/2019/08/gargle-hello-world/&#34;&gt;blogged about gargle&amp;rsquo;s initial release&lt;/a&gt;, so check out that post for more details.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;re adopting gargle for auth in several other packages, such as &lt;a href=&#34;https://bigrquery.r-dbi.org&#34;&gt;bigrquery&lt;/a&gt; (&amp;gt;= v1.2.0), &lt;a href=&#34;https://googledrive.r-lib.org&#34;&gt;googledrive&lt;/a&gt;  (&amp;gt;= v1.0.0), and &lt;a href=&#34;https://googlesheets4.tidyverse.org&#34;&gt;googlesheets4&lt;/a&gt; (currently GitHub-only, successor of googlesheets). This makes new token flows available in these packages, such as &lt;a href=&#34;https://www.jhanley.com/google-cloud-application-default-credentials/&#34;&gt;Application Default Credentials&lt;/a&gt;, and makes auth less idiosyncratic.&lt;/p&gt;




&lt;h3 id=&#34;auth-changes-the-typical-user-will-notice&#34;&gt;Auth changes the typical user will notice
  &lt;a href=&#34;#auth-changes-the-typical-user-will-notice&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The functions used for authentication have changed. Use &lt;code&gt;gm_auth_configure()&lt;/code&gt; to configure your application and then &lt;code&gt;gm_auth()&lt;/code&gt; to actually authenticate your user with the application.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;OAuth2 tokens are now cached at the user level, by default, instead of in &lt;code&gt;.httr-oauth&lt;/code&gt; in the current project. We will ask if it&amp;rsquo;s OK to create a new folder to hold your OAuth tokens. We recommend that you delete any vestigial &lt;code&gt;.httr-oauth&lt;/code&gt; files lying around your gmailr projects and re-authorize gmailr, i.e. get a new token, stored in the new way.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The new strategy makes it harder to accidentally push your tokens to the cloud, easier to use multiple Google identities, and easier to share tokens across projects and packages.&lt;/p&gt;
&lt;p&gt;Overall, gmailr has gotten more careful about getting your permission to use a cached token. See the gargle vignette &lt;a href=&#34;https://gargle.r-lib.org/articles/non-interactive-auth.html&#34;&gt;Non-interactive auth&lt;/a&gt; to learn how to prevent attempts to interact with you, especially the section &lt;a href=&#34;https://gargle.r-lib.org/articles/non-interactive-auth.html#arrange-for-an-oauth-token-to-be-re-discovered&#34;&gt;&amp;ldquo;Arrange for an oauth token to be re-discovered&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;gmailr also removes the built-in OAuth &amp;ldquo;app&amp;rdquo;. This was nessesary to comply with &lt;a href=&#34;https://developers.google.com/terms/api-services-user-data-policy#additional-requirements-for-specific-api-scopes&#34;&gt;stricter rules and enforcement&lt;/a&gt; by google for Gmail API applications. It was not possible to comply with these rules and continue to have a default application embedded in gmailr. See the &lt;a href=&#34;http://gmailr.r-lib.org/#setup&#34;&gt;setup&lt;/a&gt; section of the readme for how to create a new project and authenticate it with only a few steps. gmailr operates under the same &lt;a href=&#34;https://www.tidyverse.org/google_privacy_policy/&#34;&gt;Privacy Policy&lt;/a&gt; as other tidyverse API packages, the most relevant bit for users is &amp;lsquo;The packages only communicate with Google APIs. No user data is shared with the owners of the Tidyverse API Packages, RStudio, or any other servers.&amp;rsquo;&lt;/p&gt;




&lt;h2 id=&#34;preventing-name-conflicts&#34;&gt;Preventing name conflicts
  &lt;a href=&#34;#preventing-name-conflicts&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Historically functions in gmailr did not attempt to avoid conflicts, including common functions in the base package like &lt;code&gt;body()&lt;/code&gt; and &lt;code&gt;message()&lt;/code&gt;. It was assumed users would use namespaced calls, e.g. &lt;code&gt;gmailr::body()&lt;/code&gt; if there were issues. However this inadvertantly causes confusing errors for users. All of the functions are now prefixed with &lt;code&gt;gm_()&lt;/code&gt; to solve this conflict. This also increases function discoverability via auto-complete.&lt;/p&gt;
&lt;p&gt;The un-exported function &lt;code&gt;gmailr:::gm_convert_file()&lt;/code&gt; converts existing scripts to use the new functions. Use &lt;code&gt;gmailr:::gm_convert_file(list.files(pattern = &amp;quot;[.]R$&amp;quot;, recursive = TRUE))&lt;/code&gt; to convert all of your R scripts in the current directory and below. (Be sure to inspect the changes manually!)&lt;/p&gt;




&lt;h2 id=&#34;shared-workflows&#34;&gt;Shared workflows
  &lt;a href=&#34;#shared-workflows&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The shared use of gargle allows us to create centralized articles for several workflows that can be tricky for users:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/non-interactive-auth.html&#34;&gt;Non-interactive auth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/auth-from-web.html&#34;&gt;Auth when using R in the browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/articles/managing-tokens-securely.html&#34;&gt;Managing tokens securely&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/get-api-credentials.html&#34;&gt;How to get your own API credentials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;thanks&#34;&gt;Thanks!
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to the 58 people who contributed issues, code, and comments to this release!&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/abhishek1608&#34;&gt;@abhishek1608&lt;/a&gt;, &lt;a href=&#34;https://github.com/alansz&#34;&gt;@alansz&lt;/a&gt;, &lt;a href=&#34;https://github.com/alkashef&#34;&gt;@alkashef&lt;/a&gt;, &lt;a href=&#34;https://github.com/ascheinwald&#34;&gt;@ascheinwald&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/Btibert3&#34;&gt;@Btibert3&lt;/a&gt;, &lt;a href=&#34;https://github.com/choisy&#34;&gt;@choisy&lt;/a&gt;, &lt;a href=&#34;https://github.com/coatless&#34;&gt;@coatless&lt;/a&gt;, &lt;a href=&#34;https://github.com/csalgads&#34;&gt;@csalgads&lt;/a&gt;, &lt;a href=&#34;https://github.com/ctbrown&#34;&gt;@ctbrown&lt;/a&gt;, &lt;a href=&#34;https://github.com/eluerken&#34;&gt;@eluerken&lt;/a&gt;, &lt;a href=&#34;https://github.com/EricGoldsmith&#34;&gt;@EricGoldsmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/fiol92&#34;&gt;@fiol92&lt;/a&gt;, &lt;a href=&#34;https://github.com/grepinsight&#34;&gt;@grepinsight&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/Hellengeremias&#34;&gt;@Hellengeremias&lt;/a&gt;, &lt;a href=&#34;https://github.com/hopeful-coder&#34;&gt;@hopeful-coder&lt;/a&gt;, &lt;a href=&#34;https://github.com/howard-gu&#34;&gt;@howard-gu&lt;/a&gt;, &lt;a href=&#34;https://github.com/jamespmcguire&#34;&gt;@jamespmcguire&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jim0wheel&#34;&gt;@jim0wheel&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jlegewie&#34;&gt;@jlegewie&lt;/a&gt;, &lt;a href=&#34;https://github.com/jnolis&#34;&gt;@jnolis&lt;/a&gt;, &lt;a href=&#34;https://github.com/josibake&#34;&gt;@josibake&lt;/a&gt;, &lt;a href=&#34;https://github.com/kazuya030&#34;&gt;@kazuya030&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevin-dyrland&#34;&gt;@kevin-dyrland&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/lawremi&#34;&gt;@lawremi&lt;/a&gt;, &lt;a href=&#34;https://github.com/lmmx&#34;&gt;@lmmx&lt;/a&gt;, &lt;a href=&#34;https://github.com/lwasser&#34;&gt;@lwasser&lt;/a&gt;, &lt;a href=&#34;https://github.com/maaraaj&#34;&gt;@maaraaj&lt;/a&gt;, &lt;a href=&#34;https://github.com/marco-vene&#34;&gt;@marco-vene&lt;/a&gt;, &lt;a href=&#34;https://github.com/martijnvv&#34;&gt;@martijnvv&lt;/a&gt;, &lt;a href=&#34;https://github.com/matt-negrin&#34;&gt;@matt-negrin&lt;/a&gt;, &lt;a href=&#34;https://github.com/mattbaggott&#34;&gt;@mattbaggott&lt;/a&gt;, &lt;a href=&#34;https://github.com/msgoussi&#34;&gt;@msgoussi&lt;/a&gt;, &lt;a href=&#34;https://github.com/msrodrigues&#34;&gt;@msrodrigues&lt;/a&gt;, &lt;a href=&#34;https://github.com/MST2803&#34;&gt;@MST2803&lt;/a&gt;, &lt;a href=&#34;https://github.com/nicocriscuolo&#34;&gt;@nicocriscuolo&lt;/a&gt;, &lt;a href=&#34;https://github.com/obarisk&#34;&gt;@obarisk&lt;/a&gt;, &lt;a href=&#34;https://github.com/paddytobias&#34;&gt;@paddytobias&lt;/a&gt;, &lt;a href=&#34;https://github.com/prithajnath&#34;&gt;@prithajnath&lt;/a&gt;, &lt;a href=&#34;https://github.com/RockScience&#34;&gt;@RockScience&lt;/a&gt;, &lt;a href=&#34;https://github.com/RozennGZ&#34;&gt;@RozennGZ&lt;/a&gt;, &lt;a href=&#34;https://github.com/rpietro&#34;&gt;@rpietro&lt;/a&gt;, &lt;a href=&#34;https://github.com/scottgrimes&#34;&gt;@scottgrimes&lt;/a&gt;, &lt;a href=&#34;https://github.com/SimonCoulombe&#34;&gt;@SimonCoulombe&lt;/a&gt;, &lt;a href=&#34;https://github.com/slomanl1&#34;&gt;@slomanl1&lt;/a&gt;, &lt;a href=&#34;https://github.com/songyurita&#34;&gt;@songyurita&lt;/a&gt;, &lt;a href=&#34;https://github.com/sumxf&#34;&gt;@sumxf&lt;/a&gt;, &lt;a href=&#34;https://github.com/TheKashe&#34;&gt;@TheKashe&lt;/a&gt;, &lt;a href=&#34;https://github.com/tingmar&#34;&gt;@tingmar&lt;/a&gt;, &lt;a href=&#34;https://github.com/tmamiya&#34;&gt;@tmamiya&lt;/a&gt;, &lt;a href=&#34;https://github.com/Vestaxis&#34;&gt;@Vestaxis&lt;/a&gt;, &lt;a href=&#34;https://github.com/vikram-rawat&#34;&gt;@vikram-rawat&lt;/a&gt;, &lt;a href=&#34;https://github.com/williamgunn&#34;&gt;@williamgunn&lt;/a&gt;, and &lt;a href=&#34;https://github.com/xhudik&#34;&gt;@xhudik&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>gargle&#39;s debut on CRAN</title>
      <link>https://www.tidyverse.org/blog/2019/08/gargle-hello-world/</link>
      <pubDate>Tue, 20 Aug 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/08/gargle-hello-world/</guid>
      <description>We&amp;rsquo;re elated to (somewhat belatedly) announce the initial release of gargle on CRAN!
The gargle package (https://gargle.r-lib.org) is meant to take some of the pain out of working with Google APIs. It&amp;rsquo;s mostly aimed at the maintainers of R packages that call Google APIs. If we&amp;rsquo;re successful, users won&amp;rsquo;t really notice gargle, they&amp;rsquo;ll just feel like these packages got easier to work with and less idiosyncratic.
The timing of this post is motivated by the release of googledrive v1.</description>
      <content>&lt;p&gt;We&amp;rsquo;re elated to (somewhat belatedly) announce the initial release of gargle on CRAN!&lt;/p&gt;
&lt;p&gt;The gargle package (&lt;a href=&#34;https://gargle.r-lib.org&#34;&gt;https://gargle.r-lib.org&lt;/a&gt;) is meant to take some of the pain out of working with Google APIs. It&amp;rsquo;s mostly aimed at the maintainers of R packages that call Google APIs. If we&amp;rsquo;re successful, users won&amp;rsquo;t really notice gargle, they&amp;rsquo;ll just feel like these packages got easier to work with and less idiosyncratic.&lt;/p&gt;
&lt;p&gt;The timing of this post is motivated by the release of &lt;a href=&#34;https://googledrive.tidyverse.org&#34;&gt;googledrive&lt;/a&gt; v1.0.0. As of this version, googledrive gets all of its auth functionality (and more) from gargle. Although we did not blog about it, bigrquery also recently made the switch, with the release of v1.2.0.&lt;/p&gt;
&lt;p&gt;If you are interested in the user-facing implications of using gargle, check out the &lt;a href=&#34;https://www.tidyverse.org/articles/2019/08/googledrive-1-0-0/&#34;&gt;blog post announcing googledrive v1.0.0&lt;/a&gt; and the &lt;a href=&#34;https://bigrquery.r-dbi.org/news/index.html#bigrquery-1-2-0&#34;&gt;changelog for bigrquery v1.2.0&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;gargle&#34;&gt;gargle
  &lt;a href=&#34;#gargle&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The &lt;a href=&#34;https://gargle.r-lib.org&#34;&gt;gargle package&lt;/a&gt; first appeared on CRAN in early June 2019 and has gotten a few small updates as we learn more by wiring it into packages. gargle is already used by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://bigrquery.r-dbi.org&#34;&gt;bigrquery&lt;/a&gt; (&amp;gt;= v1.2.0)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://googledrive.tidyverse.org&#34;&gt;googledrive&lt;/a&gt; (&amp;gt;= v1.0.0)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gmailr.r-lib.org&#34;&gt;gmailr&lt;/a&gt; (&amp;gt;= v1.0.0 &lt;em&gt;coming soon to CRAN&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://code.markedmondson.me/googleAuthR/&#34;&gt;googleAuthR&lt;/a&gt; (&lt;em&gt;dev version&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://googlesheets4.tidyverse.org&#34;&gt;googlesheets4&lt;/a&gt; &lt;em&gt;GitHub only&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://andrie.github.io/gcalendr/&#34;&gt;gcalendr&lt;/a&gt; &lt;em&gt;GitHub only&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;gargle&amp;rsquo;s current functionality falls into two domains, which a client package can adopt (or not) separately:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Auth: help users authenticate themselves with their Google identity and
obtain a token that the wrapper package can use to make authorized requests.&lt;/li&gt;
&lt;li&gt;Request preparation and response handling: check requests against the
machine-readable &lt;a href=&#34;https://developers.google.com/discovery/v1/reference/apis&#34;&gt;Discovery Documents&lt;/a&gt;
that describe Google APIs and process API responses, especially errors.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The long-term stretch goal is to do for R what the &lt;a href=&#34;https://developers.google.com/api-client-library/&#34;&gt;official Google API Client Libraries&lt;/a&gt; do for other languages, like Python and Java.&lt;/p&gt;




&lt;h2 id=&#34;auth-via-gargle&#34;&gt;Auth via gargle
  &lt;a href=&#34;#auth-via-gargle&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Under the hood, gargle&amp;rsquo;s main auth function is &lt;a href=&#34;https://gargle.r-lib.org/articles/how-gargle-gets-tokens.html&#34;&gt;&lt;code&gt;token_fetch()&lt;/code&gt;&lt;/a&gt;, which tries a series of different methods for obtaining a token. The intent is to make auth &amp;ldquo;just work&amp;rdquo; in a wide variety of contexts. This makes some flows newly available in the client packages, such as Application Default Credentials (&lt;a href=&#34;https://cloud.google.com/docs/authentication/production&#34;&gt;official Google docs&lt;/a&gt; and a &lt;a href=&#34;https://www.jhanley.com/google-cloud-application-default-credentials/&#34;&gt;more readable 3rd party blog post&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The main change that users will notice is that gargle implements its own way of storing user OAuth tokens between sessions. The &lt;a href=&#34;https://httr.r-lib.org&#34;&gt;httr package&lt;/a&gt;, which gargle depends on, has historically used a local &lt;code&gt;.httr-oauth&lt;/code&gt; file for this. In contrast, gargle encourages tokens to be stored &lt;em&gt;outside&lt;/em&gt; the project, in a hidden directory at the user level, in a key-value store that incorporates the Google user&amp;rsquo;s email. This makes it harder to accidentally push your tokens to the cloud, easier to use multiple Google identities, and easier to share tokens across projects and packages. Users will notice they need to re-auth and may want to track down and delete vestigial &lt;code&gt;.httr-oauth&lt;/code&gt; files.&lt;/p&gt;




&lt;h2 id=&#34;articles-and-docs&#34;&gt;Articles and docs
  &lt;a href=&#34;#articles-and-docs&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The release of gargle has provided an occasion to document several recurring workflows that can be tricky for useRs, which now work the same across multiple packages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/non-interactive-auth.html&#34;&gt;Non-interactive auth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/auth-from-web.html&#34;&gt;Auth when using R in the browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/articles/managing-tokens-securely.html&#34;&gt;Managing tokens securely&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/get-api-credentials.html&#34;&gt;How to get your own API credentials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;gargle also offers a mechanism for client packages to build the documentation for their auth function from templates stored in gargle. This means that packages using a common design will also use the same words to describe it.&lt;/p&gt;
&lt;p&gt;Another set of articles is aimed at package maintainers interested in delegating auth or request &amp;amp; response handling to gargle:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/gargle-auth-in-client-package.html&#34;&gt;How to use gargle for auth in a client package&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/request-helper-functions.html&#34;&gt;Request helper functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;privacy-policy-for-google-related-tidyverser-lib-packages&#34;&gt;Privacy policy for Google-related tidyverse/r-lib packages
  &lt;a href=&#34;#privacy-policy-for-google-related-tidyverser-lib-packages&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Google is tightening the rules around various aspects of API access (see, e.g., &lt;a href=&#34;https://www.blog.google/technology/safety-security/project-strobe/&#34;&gt;Project Strobe&lt;/a&gt; and &lt;a href=&#34;https://cloud.google.com/blog/products/g-suite/elevating-user-trust-in-our-api-ecosystems&#34;&gt;Elevating user trust in our API ecosystem&lt;/a&gt;). I predict the main thing that useRs will notice is that more and more R packages and apps will require the user to get involved in the nitty gritty details of auth. Users will need to create their own Google Cloud Platform projects, obtain their own API keys, and their own OAuth client IDs and secrets. The overall rationale for Google&amp;rsquo;s changes makes sense, but the way people use open source R packages is an awkward fit with their recommended auth solutions. It&amp;rsquo;s becoming more difficult for package developers to make auth feel like it &amp;ldquo;just works&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;The Google-wrapping packages maintained by the tidyverse / r-lib team are now governed by a shared &lt;a href=&#34;https://www.tidyverse.org/google_privacy_policy/&#34;&gt;Privacy Policy&lt;/a&gt;. This is linked from each package and also from the consent screen whenever auth is facilitated through our OAuth client.&lt;/p&gt;




&lt;h2 id=&#34;some-gargle-history&#34;&gt;Some gargle history
  &lt;a href=&#34;#some-gargle-history&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;I find gargle&amp;rsquo;s origin story find very satisfying. I suspect that Hadley Wickham&amp;rsquo;s bigrquery (first on CRAN January 2015) has shaped the basic design for how most R packages handle Google auth, directly or indirectly. I can certainly say that Joanna Zhao and I consulted it when developing googlesheets (first on CRAN July 2015). I know that Mark Edmondson was influenced, in turn, by googlesheets, when he developed googleAuthR (first on CRAN August 2015), used in his &lt;a href=&#34;https://code.markedmondson.me/r-packages/&#34;&gt;suite of packages&lt;/a&gt;. By the time Lucy D&amp;rsquo;Agostino McGowan and I created googledrive (first on CRAN August 2017), I&amp;rsquo;d developed some strong opinions about how to modify httr&amp;rsquo;s default behaviour for work with Google APIs. I was also working with Hadley Wickham at RStudio by that point and Lucy and I benefited from his design advice. In May-ish 2017, leading up to &lt;a href=&#34;https://unconf17.ropensci.org&#34;&gt;rOpenSci&amp;rsquo;s 2017 Unconf&lt;/a&gt;, Craig Citro &lt;a href=&#34;https://github.com/ropensci/unconf17/issues/85&#34;&gt;opened an issue&lt;/a&gt; to generate discussion about how to de-duplicate even more API pain, especially for Google APIs. He has a wealth of experience from his role in shaping the &lt;a href=&#34;https://developers.google.com/api-client-library/&#34;&gt;official Python client&lt;/a&gt; and he made the initial commits that laid the foundation for &lt;code&gt;gargle::token_fetch()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Starting from a common origin (bigrquery), all these people and packages have explored different aspects of this problem space and have developed various solutions. gargle represents the distillation of a lot of hard-won experience and a promising space for future consolidation.&lt;/p&gt;




&lt;h2 id=&#34;thanks&#34;&gt;Thanks!
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to all those who have helped get gargle to its first release:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/andrie&#34;&gt;@andrie&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/byapparov&#34;&gt;@byapparov&lt;/a&gt;, &lt;a href=&#34;https://github.com/craigcitro&#34;&gt;@craigcitro&lt;/a&gt;, &lt;a href=&#34;https://github.com/dlebech&#34;&gt;@dlebech&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;@jonthegeek&lt;/a&gt;, &lt;a href=&#34;https://github.com/MarkEdmondson1234&#34;&gt;@MarkEdmondson1234&lt;/a&gt;, &lt;a href=&#34;https://github.com/wlongabaugh&#34;&gt;@wlongabaugh&lt;/a&gt;, and &lt;a href=&#34;https://github.com/ZainRizvi&#34;&gt;@ZainRizvi&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>googledrive v1.0.0</title>
      <link>https://www.tidyverse.org/blog/2019/08/googledrive-1-0-0/</link>
      <pubDate>Tue, 20 Aug 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/08/googledrive-1-0-0/</guid>
      <description>Introduction     We&amp;rsquo;re jazzed to announce the release of googledrive v1.0.0 (https://googledrive.tidyverse.org).
googledrive wraps the Drive REST API v3. The most common file operations are implemented in high-level functions designed for ease of use. You can find, list, create, trash, delete, rename, move, copy, browse, download, share and publish Drive files, including those on Team Drives.
Install googledrive with:
install.packages(&amp;#34;googledrive&amp;#34;) The release of version 1.0.0 marks two events:</description>
      <content>



&lt;h2 id=&#34;introduction&#34;&gt;Introduction
  &lt;a href=&#34;#introduction&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;re jazzed to announce the release of googledrive v1.0.0 (&lt;a href=&#34;https://googledrive.tidyverse.org&#34;&gt;https://googledrive.tidyverse.org&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;googledrive wraps the &lt;a href=&#34;https://developers.google.com/drive/&#34;&gt;Drive REST API v3&lt;/a&gt;. The most common file operations are implemented in high-level functions designed for ease of use. You can find, list, create, trash, delete, rename, move, copy, browse, download, share and publish Drive files, including those on Team Drives.&lt;/p&gt;
&lt;p&gt;Install googledrive with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;googledrive&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;p&gt;The release of version 1.0.0 marks two events:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The overall design of googledrive has survived ~2 years on CRAN, with very little need for change. The interface and feature set are fairly stable. googledrive facilitated around 7 million requests to the Drive API in the past month. But also &amp;hellip;&lt;/li&gt;
&lt;li&gt;There are changes in the auth interface that are not backwards compatible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is also new functionality that makes it less likely you&amp;rsquo;ll create multiple files with the same name, without actually meaning to.&lt;/p&gt;




&lt;h2 id=&#34;auth-from-gargle&#34;&gt;Auth from gargle
  &lt;a href=&#34;#auth-from-gargle&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;googledrive&amp;rsquo;s auth functionality now comes from the &lt;a href=&#34;https://gargle.r-lib.org&#34;&gt;gargle package&lt;/a&gt;, which provides R infrastructure to work with Google APIs, in general. We&amp;rsquo;ve just &lt;a href=&#34;https://www.tidyverse.org/articles/2019/08/gargle-hello-world/&#34;&gt;blogged about gargle&amp;rsquo;s initial release&lt;/a&gt;, so check out that post for more details.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;re adopting gargle for auth in several other packages, such as &lt;a href=&#34;https://bigrquery.r-dbi.org&#34;&gt;bigrquery&lt;/a&gt; (&amp;gt;= v1.2.0), &lt;a href=&#34;https://gmailr.r-lib.org&#34;&gt;gmailr&lt;/a&gt;  (&amp;gt;= v1.0.0 &lt;em&gt;coming soon to CRAN&lt;/em&gt;), and &lt;a href=&#34;https://googlesheets4.tidyverse.org&#34;&gt;googlesheets4&lt;/a&gt; (currently GitHub-only, successor of googlesheets). This makes new token flows available in these packages, such as &lt;a href=&#34;https://www.jhanley.com/google-cloud-application-default-credentials/&#34;&gt;Application Default Credentials&lt;/a&gt;, and makes auth less idiosyncratic.&lt;/p&gt;




&lt;h3 id=&#34;auth-changes-the-typical-user-will-notice&#34;&gt;Auth changes the typical user will notice
  &lt;a href=&#34;#auth-changes-the-typical-user-will-notice&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;If you&amp;rsquo;ve always let googledrive guide you through auth, here is the one change you will notice:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;OAuth2 tokens are now cached at the user level, by default, instead of in &lt;code&gt;.httr-oauth&lt;/code&gt; in the current project. We will ask if it&amp;rsquo;s OK to create a new folder to hold your OAuth tokens. We recommend that you delete any vestigial &lt;code&gt;.httr-oauth&lt;/code&gt; files lying around your googledrive projects and re-authorize googledrive, i.e. get a new token, stored in the new way.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The new strategy makes it harder to accidentally push your tokens to the cloud, easier to use multiple Google identities, and easier to share tokens across projects and packages.&lt;/p&gt;
&lt;p&gt;Overall, googledrive has gotten more careful about getting your permission to use a cached token. See the gargle vignette &lt;a href=&#34;https://gargle.r-lib.org/articles/non-interactive-auth.html&#34;&gt;Non-interactive auth&lt;/a&gt; to learn how to prevent attempts to interact with you, especially the section &lt;a href=&#34;https://gargle.r-lib.org/articles/non-interactive-auth.html#i-just-want-my--rmd-to-render&#34;&gt;&amp;ldquo;I just want my &lt;code&gt;.Rmd&lt;/code&gt; to render&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;googledrive also uses a new OAuth &amp;ldquo;app&amp;rdquo;, owned by a verified Google Cloud Project entitled &amp;ldquo;Tidyverse API Packages&amp;rdquo;, which is the project name you will see on the OAuth consent screen. See our new &lt;a href=&#34;https://www.tidyverse.org/google_privacy_policy/&#34;&gt;Privacy Policy&lt;/a&gt; for details.&lt;/p&gt;
&lt;p&gt;For more advanced users who call &lt;code&gt;drive_auth()&lt;/code&gt; directly or who configure auth settings, such as their own OAuth app or API key, see the &lt;a href=&#34;https://googledrive.tidyverse.org/news/index.html#googledrive-1-0-0&#34;&gt;changelog&lt;/a&gt; for more details.&lt;/p&gt;




&lt;h2 id=&#34;preventing-name-clashes&#34;&gt;Preventing name clashes
  &lt;a href=&#34;#preventing-name-clashes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Google Drive doesn&amp;rsquo;t impose a 1-to-1 relationship between files and filepaths, the way your local file system does. Therefore, when working via the Drive API (instead of in the browser), it&amp;rsquo;s fairly easy to create multiple Drive files with the same name or filepath, without actually meaning to. This is perfectly valid on Drive, which identifies file by ID, but can be confusing and undesirable for humans. Very few people actually want this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/googledrive/je-suis-unique.png&#34; width=&#34;60%&#34; /&gt;&lt;/p&gt;
&lt;p&gt;googledrive v1.0.0 offers some new ways to prevent writing more than one file to the same filepath.&lt;/p&gt;
&lt;p&gt;All functions that create a new item or rename/move an existing item have gained an &lt;code&gt;overwrite&lt;/code&gt; argument:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;drive_create()&lt;/code&gt; &lt;em&gt;this function is new in v1.0.0&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;drive_cp()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;drive_mkdir()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;drive_mv()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;drive_rename()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;drive_upload()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The default of &lt;code&gt;overwrite = NA&lt;/code&gt; corresponds to the existing behaviour, which does not consider pre-existing files at all. &lt;code&gt;overwrite = TRUE&lt;/code&gt; requests to move a pre-existing file at the target filepath to the trash, prior to creating the new item. If 2 or more files are found, an error is thrown, because it&amp;rsquo;s not clear which one(s) to trash. &lt;code&gt;overwrite = FALSE&lt;/code&gt; means the new item will only be created if there is no pre-existing file at that filepath. Existence checks based on filepath (or name) can be expensive. This is why the default is &lt;code&gt;overwrite = NA&lt;/code&gt;, in addition to backwards compatibility.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;drive_put()&lt;/code&gt; is a new convenience wrapper that figures out whether to call &lt;code&gt;drive_upload()&lt;/code&gt; or &lt;code&gt;drive_update()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Sometimes you have a file you will repeatedly send to Drive, i.e. the first time you run an analysis, you create the file and, when you re-run it, you update the file. Previously this was hard to express with googledrive.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;drive_put()&lt;/code&gt; is useful here and refers to the HTTP verb &lt;code&gt;PUT&lt;/code&gt;: create the thing if it doesn&amp;rsquo;t exist or, if it does, replace its contents. A good explanation of &lt;code&gt;PUT&lt;/code&gt; is &lt;a href=&#34;https://medium.com/backticks-tildes/restful-api-design-put-vs-patch-4a061aa3ed0b&#34;&gt;RESTful API Design — PUT vs PATCH&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In pseudo-code, here&amp;rsquo;s the basic idea of &lt;code&gt;drive_put()&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;n&#34;&gt;target_filepath&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;determined&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;arguments&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`path`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`name`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;and&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`media`&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;all&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Drive&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;files&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;at&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;target_filepath&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;if &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;no&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
 &lt;span class=&#34;nf&#34;&gt;drive_upload&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;media&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;verbose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;if &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;exactly&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
 &lt;span class=&#34;nf&#34;&gt;drive_update&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;media&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;verbose&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
 &lt;span class=&#34;n&#34;&gt;ERROR&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;shared-workflows&#34;&gt;Shared workflows
  &lt;a href=&#34;#shared-workflows&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The shared use of gargle allows us to create centralized articles for several workflows that can be tricky for useRs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/non-interactive-auth.html&#34;&gt;Non-interactive auth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/auth-from-web.html&#34;&gt;Auth when using R in the browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/articles/managing-tokens-securely.html&#34;&gt;Managing tokens securely&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gargle.r-lib.org/articles/get-api-credentials.html&#34;&gt;How to get your own API credentials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;thanks&#34;&gt;Thanks!
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thank you to the &lt;strong&gt;41&lt;/strong&gt; people who contributed issues, code, and comments to this release:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/abeburnett&#34;&gt;@abeburnett&lt;/a&gt;, &lt;a href=&#34;https://github.com/admahood&#34;&gt;@admahood&lt;/a&gt;, &lt;a href=&#34;https://github.com/alexpghayes&#34;&gt;@alexpghayes&lt;/a&gt;, &lt;a href=&#34;https://github.com/arendsee&#34;&gt;@arendsee&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/benmarwick&#34;&gt;@benmarwick&lt;/a&gt;, &lt;a href=&#34;https://github.com/Chanajit&#34;&gt;@Chanajit&lt;/a&gt;, &lt;a href=&#34;https://github.com/cowlumbus&#34;&gt;@cowlumbus&lt;/a&gt;, &lt;a href=&#34;https://github.com/ctlamb&#34;&gt;@ctlamb&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavidGarciaEstaun&#34;&gt;@DavidGarciaEstaun&lt;/a&gt;, &lt;a href=&#34;https://github.com/dgplaco&#34;&gt;@dgplaco&lt;/a&gt;, &lt;a href=&#34;https://github.com/Diego-MX&#34;&gt;@Diego-MX&lt;/a&gt;, &lt;a href=&#34;https://github.com/dsdaveh&#34;&gt;@dsdaveh&lt;/a&gt;, &lt;a href=&#34;https://github.com/eeenilsson&#34;&gt;@eeenilsson&lt;/a&gt;, &lt;a href=&#34;https://github.com/efh0888&#34;&gt;@efh0888&lt;/a&gt;, &lt;a href=&#34;https://github.com/giocomai&#34;&gt;@giocomai&lt;/a&gt;, &lt;a href=&#34;https://github.com/grabear&#34;&gt;@grabear&lt;/a&gt;, &lt;a href=&#34;https://github.com/hwsamuel&#34;&gt;@hwsamuel&lt;/a&gt;, &lt;a href=&#34;https://github.com/ianmcook&#34;&gt;@ianmcook&lt;/a&gt;, &lt;a href=&#34;https://github.com/jarodmeng&#34;&gt;@jarodmeng&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/lohancock&#34;&gt;@lohancock&lt;/a&gt;, &lt;a href=&#34;https://github.com/lotard&#34;&gt;@lotard&lt;/a&gt;, &lt;a href=&#34;https://github.com/LucyMcGowan&#34;&gt;@LucyMcGowan&lt;/a&gt;, &lt;a href=&#34;https://github.com/lukaskawerau&#34;&gt;@lukaskawerau&lt;/a&gt;, &lt;a href=&#34;https://github.com/MariaMetriplica&#34;&gt;@MariaMetriplica&lt;/a&gt;, &lt;a href=&#34;https://github.com/Martin-Jung&#34;&gt;@Martin-Jung&lt;/a&gt;, &lt;a href=&#34;https://github.com/medewitt&#34;&gt;@medewitt&lt;/a&gt;, &lt;a href=&#34;https://github.com/njudd&#34;&gt;@njudd&lt;/a&gt;, &lt;a href=&#34;https://github.com/philmikejones&#34;&gt;@philmikejones&lt;/a&gt;, &lt;a href=&#34;https://github.com/prokulski&#34;&gt;@prokulski&lt;/a&gt;, &lt;a href=&#34;https://github.com/RNA-Ninja&#34;&gt;@RNA-Ninja&lt;/a&gt;, &lt;a href=&#34;https://github.com/romunov&#34;&gt;@romunov&lt;/a&gt;, &lt;a href=&#34;https://github.com/sanjmeh&#34;&gt;@sanjmeh&lt;/a&gt;, &lt;a href=&#34;https://github.com/Serenthia&#34;&gt;@Serenthia&lt;/a&gt;, &lt;a href=&#34;https://github.com/shawzhifei&#34;&gt;@shawzhifei&lt;/a&gt;, &lt;a href=&#34;https://github.com/stapial&#34;&gt;@stapial&lt;/a&gt;, &lt;a href=&#34;https://github.com/svenhalvorson&#34;&gt;@svenhalvorson&lt;/a&gt;, &lt;a href=&#34;https://github.com/tarunparmar&#34;&gt;@tarunparmar&lt;/a&gt;, and &lt;a href=&#34;https://github.com/tsmith64&#34;&gt;@tsmith64&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>ragg 0.1.0</title>
      <link>https://www.tidyverse.org/blog/2019/07/ragg-0-1-0/</link>
      <pubDate>Mon, 15 Jul 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/07/ragg-0-1-0/</guid>
      <description>We&amp;rsquo;re stoked to announce the release of ragg 0.1.0 on CRAN. ragg provides a set of high quality and high performance raster devices, capable of producing png, tiff, or ppm files, or a matrix of raw color values directly within R.
ragg is part of our broader effort to improve graphics performance and quality in R at all levels of the stack, so that you&amp;rsquo;ll benefit no matter what plotting framework you choose to use.</description>
      <content>&lt;p&gt;We&amp;rsquo;re stoked to announce the release of &lt;a href=&#34;https://ragg.r-lib.org&#34;&gt;ragg 0.1.0&lt;/a&gt; on CRAN. ragg provides a set of high quality and high performance raster devices, capable of producing png, tiff, or ppm files, or a matrix of raw color values directly within R.&lt;/p&gt;
&lt;p&gt;ragg is part of our broader effort to improve graphics performance and quality in R at all levels of the stack, so that you&amp;rsquo;ll benefit no matter what plotting framework you choose to use. Other parts of this efforts have been:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Developing the &lt;a href=&#34;https://github.com/r-lib/devoid&#34;&gt;devoid&lt;/a&gt; package to allow more precise benchmarking of plotting code.&lt;/li&gt;
&lt;li&gt;Multiple improvements to rendering speed in grid in the latest R release (3.6.0).&lt;/li&gt;
&lt;li&gt;Performance improvements in &lt;a href=&#34;https://ggplot2.tidyverse.org&#34;&gt;ggplot2&lt;/a&gt; 3.2.0 both broadly and for sf plotting specifically.&lt;/li&gt;
&lt;li&gt;Performance improvements in &lt;a href=&#34;https://gtable.r-lib.com&#34;&gt;gtable&lt;/a&gt; 0.3.0.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;the-devices&#34;&gt;The devices
  &lt;a href=&#34;#the-devices&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;An R graphic device is an object that receives instructions from the graphic engine in R and translates that into some meaningful format for viewing. The graphic engine in R is the layer that sits between the graphic generating code in R and the devices, and is responsible for allowing the plethora of different output options from the same plot code. The output from a graphic device can either be a file, on screen, or in some other form. ragg provides a set of raster devices, that is, devices that rasterize the instructions and write it to some sort of raster output (e.g. a png file). This is opposed to vector devices such as &lt;code&gt;pdf()&lt;/code&gt; and &lt;code&gt;svg()&lt;/code&gt; that do not perform rasterization but write the instructions directly into a vector graphics format.&lt;/p&gt;
&lt;p&gt;ragg provides three different file outputs (png, tiff, and ppm), though it is important to note that everything, except for the serialization of the data into the file format, is equivalent. A case could be made for also including jpeg output, but this format is generally not useful for graphics as it introduces noticeable artifacts with line graphics.&lt;/p&gt;
&lt;p&gt;Apart from the three file-based devices, ragg also provides a device that gives direct access to the raster buffer from R. This means that you can plot directly into a matrix of color values which you can then further process in R, should you wish.&lt;/p&gt;




&lt;h2 id=&#34;features&#34;&gt;Features
  &lt;a href=&#34;#features&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;There are 5 main areas where ragg sets itself apart from the graphic devices already available:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Performance:&lt;/strong&gt; ragg is faster than cairo, the standard anti-aliased device in R. Tests show that it is about twice as fast to render a moderately complex ggplot. See the
&lt;a href=&#34;https://ragg.r-lib.org/articles/ragg_performance.html&#34;&gt;Performance&lt;/a&gt; vignette for more in-depth benchmarking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anti-aliasing:&lt;/strong&gt; ragg is fully anti-aliased, as opposed to the cairo devices that only apply anti-aliasing to strokes and text (not fill). For a comparison, see the &lt;a href=&#34;https://ragg.r-lib.org/articles/ragg_quality.html#shape-rendering&#34;&gt;shape rendering&lt;/a&gt; section of the Quality vignette.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Text rendering:&lt;/strong&gt; ragg provides high-quality rendering of rotated text, something that other raster devices struggle with. See the &lt;a href=&#34;https://ragg.r-lib.org/articles/ragg_quality.html#text&#34;&gt;text&lt;/a&gt; section of the Quality vignette for examples.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Font access:&lt;/strong&gt; ragg has direct access to all your system fonts, without you having to do anything. All installed fonts on your system should be ready to use.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;System independence:&lt;/strong&gt; The rendering code in ragg is system independent and should be identical whether it has been rendered on Windows, macOS, or Linux. The only difference is the available fonts on the different systems.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;example&#34;&gt;Example
  &lt;a href=&#34;#example&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The ragg devices are used just like any other device, by starting them, running your plotting code, and turning them off (code below add some complexity in order to embed the created file in the page):&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;ragg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;ggplot2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;file&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&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;fig_path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#39;.png&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;agg_png&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;width&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;700&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;height&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;500&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;units&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;px&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;diamonds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_bar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fill&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;ggtitle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;A fancy font&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;theme&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;text&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;element_text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;family&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Daubmark&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;50&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;invisible&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dev.off&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;include_graphics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-06-26-ragg-0-1-0_files/figure-html/unnamed-chunk-1-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;ragg can also be used with &lt;code&gt;ggsave()&lt;/code&gt; by passing the device in as an 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;file&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&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;fig_path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#39;.png&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mpg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;displ&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hwy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;ggsave&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;device&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;agg_png&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;300&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Saving 7 x 4.33 in image&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;include_graphics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-06-26-ragg-0-1-0_files/figure-html/unnamed-chunk-2-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;




&lt;h2 id=&#34;life-cycle&#34;&gt;Life cycle
  &lt;a href=&#34;#life-cycle&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;ragg is currently to be considered &lt;a href=&#34;https://www.tidyverse.org/lifecycle/#experimental&#34;&gt;experimental&lt;/a&gt;. That is not to indicate that any API changes are to be expected, or that using it is not a safe long-term strategy. But we are continuing to invest and improve upon the graphic stack in R, and we cannot say whether ragg will be part of our final solution, or if it is just an interesting experiment. The experience gained in the graphic stack from building ragg will definitely be put to good use though, and you can expect more improvements in the future.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to &lt;a href=&#34;https://github.com/jeroen&#34;&gt;@jeroen&lt;/a&gt; for much assistance in getting ragg to compile on all systems!&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>callr 3.3.0</title>
      <link>https://www.tidyverse.org/blog/2019/07/callr-3.3.0/</link>
      <pubDate>Mon, 08 Jul 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/07/callr-3.3.0/</guid>
      <description>PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};  We have just updated the callr package to version 3.3.0 on CRAN. The biggest change in this release is better support for debugging the background process. See the full changelog here.
callr helps with running R code in a separate R process, synchronously or asynchronously. With synchronous execution the main R process waits until the separate R subprocess finishes, see callr::r(). Asynchronous execution uses processx processes, see callr::r_bg() and callr::r_process() for one-off and callr::r_session() for persistent background R processes.</description>
      <content>


&lt;STYLE type=&#39;text/css&#39; scoped&gt;
PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};
&lt;/STYLE&gt;
&lt;p&gt;We have just updated the &lt;a href=&#34;https://callr.r-lib.org/&#34;&gt;callr&lt;/a&gt; package to version 3.3.0 on CRAN.
The biggest change in this release is better support for debugging the
background process. See the full
&lt;a href=&#34;https://callr.r-lib.org/news/index.html&#34;&gt;changelog here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;callr helps with running R code in a separate R process, synchronously or
asynchronously. With synchronous execution the main R process waits until
the separate R subprocess finishes, see &lt;a href=&#34;https://callr.r-lib.org/reference/r.html&#34;&gt;&lt;code&gt;callr::r()&lt;/code&gt;&lt;/a&gt;. Asynchronous execution
uses &lt;a href=&#34;https://processx.r-lib.org/&#34;&gt;processx&lt;/a&gt; processes, see &lt;a href=&#34;https://callr.r-lib.org/reference/r_bg.html&#34;&gt;&lt;code&gt;callr::r_bg()&lt;/code&gt;&lt;/a&gt;
and &lt;a href=&#34;https://callr.r-lib.org/reference/r_process.html&#34;&gt;&lt;code&gt;callr::r_process()&lt;/code&gt;&lt;/a&gt; for one-off and &lt;a href=&#34;https://callr.r-lib.org/reference/r_session.html&#34;&gt;&lt;code&gt;callr::r_session()&lt;/code&gt;&lt;/a&gt; for persistent
background R processes.&lt;/p&gt;
&lt;div id=&#34;callr-error-objects&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;callr error objects&lt;/h2&gt;
&lt;p&gt;Debugging code running in a background process is notoriously difficult.
Most of the time you cannot use an interactive debugger, and often even
print-debugging, i.e. inserting &lt;code&gt;print()&lt;/code&gt; and &lt;code&gt;cat()&lt;/code&gt; calls into the
code that runs in the background, can be non-trivial.&lt;/p&gt;
&lt;p&gt;The new 3.3.0 version of callr aims to help with this, by creating better
error messages and error traces for errors originating from the background
process. In particular, callr now always throws error objects that
contain:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the exit status of the R process, if the process terminated,&lt;/li&gt;
&lt;li&gt;the full error object thrown in the subprocess,&lt;/li&gt;
&lt;li&gt;the call that generated the error,&lt;/li&gt;
&lt;li&gt;the process id of the subprocess, and&lt;/li&gt;
&lt;li&gt;the full stack trace in the subprocess.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is an example for a trivial error that shows how to extract this
information if the error was caught in the main process:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;err &amp;lt;- tryCatch(
  callr::r(function() library(Callr)),
  error = function(e) e)
err
#&amp;gt; &amp;lt;callr_status_error: callr subprocess failed: there is no package called ‘Callr’&amp;gt;
#&amp;gt;  in process 
#&amp;gt; --&amp;gt;
#&amp;gt; &amp;lt;callr_remote_error in library(Callr): there is no package called ‘Callr’&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The error objects has two parts. The first is the error object thrown in
the main process, and the second is the error object from the the
subprocess. We can extract more information from &lt;code&gt;err&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;err$status
#&amp;gt; [1] 0
err$parent
#&amp;gt; &amp;lt;callr_remote_error in library(Callr): there is no package called ‘Callr’&amp;gt;
err$parent$call
#&amp;gt; function() library(Callr)
err$parent$`_pid`
#&amp;gt; [1] 79124&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;err$status&lt;/code&gt; is the exit status of the subprocess. This is not present
for persistent background processes, i.e. the ones created by &lt;code&gt;r_session&lt;/code&gt;,
because these do not exit on error, but continue running. &lt;code&gt;err$parent&lt;/code&gt; is
the error object, thrown in the subprocess. &lt;code&gt;err$parent$call&lt;/code&gt; is the call
that generated the error, and &lt;code&gt;err$parent$`_pid`&lt;/code&gt; is the process id
of the subprocess.&lt;/p&gt;
&lt;p&gt;The stack trace of the error in subprocess can be printed via
&lt;code&gt;err$parent$trace&lt;/code&gt;. By default the trace omits the boilerplate frames
added by callr, these are usually not very useful for the user.
Nevertheless they are still included in &lt;code&gt;err$parent$trace$calls&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;err$parent$trace&lt;/code&gt;&lt;/pre&gt;
&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; 
#&amp;gt; &lt;span style=&#39;font-weight: bold;&#39;&gt; ERROR TRACE for packageNotFoundError&lt;/span&gt;&lt;span&gt;
#&amp;gt; 
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 12. &lt;/span&gt;&lt;span&gt;(function ()  ...
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 13. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;base:::library&lt;/span&gt;&lt;span&gt;(Callr)
#&amp;gt;     &lt;/span&gt;&lt;span style=&#39;color: #00BBBB;font-style: italic;&#39;&gt;R/&amp;lt;text&amp;gt;:2:12&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 14. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;base:::stop&lt;/span&gt;&lt;span&gt;(packageNotFoundError(package, lib.loc, sys.call()))
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 15. &lt;/span&gt;&lt;span&gt;(function (e)  ...
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #BB0000;font-weight: bold;&#39;&gt;
#&amp;gt;  x there is no package called ‘Callr’ &lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;p&gt;The trace starts with the anonymous function that we passed to &lt;code&gt;callr::r()&lt;/code&gt;,
and it is annotated with package names and source references, if they are
available.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;the-last-error&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;The last error&lt;/h2&gt;
&lt;p&gt;Often, the error object is uncaught, i.e. we don’t &lt;code&gt;tryCatch()&lt;/code&gt; the error
in the main R process. Then the error message is printed, but the actual
error object is lost, and you need to re-run the code in a &lt;code&gt;tryCatch()&lt;/code&gt;,
hoping that it would produce the same error.&lt;/p&gt;
&lt;p&gt;For a better workflow, whenever a callr error is uncaught, callr
assigns it to the &lt;code&gt;.Last.error&lt;/code&gt; variable, that can be inspected.
Of course, a subsequent callr error will overwrite &lt;code&gt;.Last.error&lt;/code&gt;, it works very
much like &lt;code&gt;.Last.value&lt;/code&gt;, but for errors. Here is the same code as above
but without the &lt;code&gt;tryCatch()&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;callr::r(function() library(Callr))
#&amp;gt; Error: callr subprocess failed: there is no package called ‘Callr’&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;.Last.error
#&amp;gt; &amp;lt;callr_status_error: callr subprocess failed: there is no package called ‘Callr’&amp;gt;
#&amp;gt; --&amp;gt;
#&amp;gt; &amp;lt;callr_remote_error in library(Callr): there is no package called ‘Callr’&amp;gt;
.Last.error$parent$call
#&amp;gt; function() library(Callr)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;the-last-error-trace&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;The last error trace&lt;/h2&gt;
&lt;p&gt;If the error is uncaught, then callr adds a trace to the error object of
the main process as well. The trace will have two parts in this case.
callr also sets the &lt;code&gt;.Last.error.trace&lt;/code&gt; variable for convenience, this is
easier to type than &lt;code&gt;.Last.error$trace&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;.Last.error.trace&lt;/code&gt;&lt;/pre&gt;
&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; 
#&amp;gt; &lt;span style=&#39;font-weight: bold;&#39;&gt; ERROR TRACE for callr_status_error, callr_error, rlib_error&lt;/span&gt;&lt;span&gt;
#&amp;gt; 
#&amp;gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;Process 79108:&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 30. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;callr::r&lt;/span&gt;&lt;span&gt;(function() library(Callr))
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 31. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;callr:::get_result&lt;/span&gt;&lt;span&gt;(output = out, options)
#&amp;gt;     &lt;/span&gt;&lt;span style=&#39;color: #00BBBB;font-style: italic;&#39;&gt;R/eval.R:149:3&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 32. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;base:::throw&lt;/span&gt;&lt;span&gt;(new_callr_error(output, msg), parent = err[[2]])
#&amp;gt;     &lt;/span&gt;&lt;span style=&#39;color: #00BBBB;font-style: italic;&#39;&gt;R/result.R:73:5&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #BB0000;font-weight: bold;&#39;&gt;
#&amp;gt;  x callr subprocess failed: there is no package called ‘Callr’ &lt;/span&gt;&lt;span&gt;
#&amp;gt; 
#&amp;gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;Process 79135:&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 44. &lt;/span&gt;&lt;span&gt;(function ()  ...
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 45. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;base:::library&lt;/span&gt;&lt;span&gt;(Callr)
#&amp;gt;     &lt;/span&gt;&lt;span style=&#39;color: #00BBBB;font-style: italic;&#39;&gt;R/&amp;lt;text&amp;gt;:1:10&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 46. &lt;/span&gt;&lt;span style=&#39;color: #BBBB00;&#39;&gt;base:::stop&lt;/span&gt;&lt;span&gt;(packageNotFoundError(package, lib.loc, sys.call()))
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 47. &lt;/span&gt;&lt;span&gt;(function (e)  ...
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #BB0000;font-weight: bold;&#39;&gt;
#&amp;gt;  x there is no package called ‘Callr’ &lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;p&gt;The top part of the trace contains the frames in the main process, and the
bottom part contains the frames in the subprocess, starting with the
anonymous function.&lt;/p&gt;
&lt;/div&gt;
</content>
    </item>
    
    <item>
      <title>dplyr 0.8.3</title>
      <link>https://www.tidyverse.org/blog/2019/07/dplyr-0-8-3/</link>
      <pubDate>Thu, 04 Jul 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/07/dplyr-0-8-3/</guid>
      <description>Introduction     We&amp;rsquo;re pleased (and a little embarrassed) to announce the release of dplyr 0.8.3 on CRAN 😬 !
This is an emergency release, one week after 0.8.2 to fix a major performance regression as reported by the community on twitter.
Nostra culpa     This commit was pushed to dplyr on May 10, as a seemingly very harmless update to better support list columns being used in summarise().</description>
      <content>



&lt;h2 id=&#34;introduction&#34;&gt;Introduction
  &lt;a href=&#34;#introduction&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;re pleased (and a little embarrassed) to announce the release of dplyr 0.8.3 on CRAN 😬 !&lt;/p&gt;
&lt;p&gt;This is an emergency release, one week after &lt;a href=&#34;https://www.tidyverse.org/articles/2019/06/dplyr-0-8-2/&#34;&gt;0.8.2&lt;/a&gt;
to fix a major performance regression as reported by the community on twitter.&lt;/p&gt;




&lt;h2 id=&#34;nostra-culpa&#34;&gt;Nostra culpa
  &lt;a href=&#34;#nostra-culpa&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;This &lt;a href=&#34;https://github.com/tidyverse/dplyr/commit/036de90fbf9e3eef72c015982a5d1294d2157a2c#r34165423&#34;&gt;commit&lt;/a&gt; was pushed to
&lt;a href=&#34;https://dplyr.tidyverse.org&#34;&gt;dplyr&lt;/a&gt; on May 10, as a seemingly very harmless update to better support list
columns being used in &lt;a href=&#34;https://dplyr.tidyverse.org/reference/summarise.html&#34;&gt;summarise()&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In addition to the changes that were necessary to fix the problem reported in &lt;a href=&#34;https://github.com/tidyverse/dplyr/issues/4349&#34;&gt;issue 4349&lt;/a&gt;,
the commit removed two lines of code in a very central piece of &lt;a href=&#34;https://dplyr.tidyverse.org&#34;&gt;dplyr&lt;/a&gt; infrastructure,
namely its data mask layout.&lt;/p&gt;
&lt;p&gt;As part of &lt;a href=&#34;https://www.tidyverse.org/articles/2019/02/dplyr-0-8-0/&#34;&gt;dplyr 0.8.0&lt;/a&gt;, internals of the data mask layout has
dramatically changed and uses a data mask composed of two environments. The first environment contains a set of active
bindings for each of the columns in the data frame to process, the first time a variable is used in an expression,
presumably on the first group, the active binding is resolved to get the relevant slice of that column. This is a
somewhat expensive operation, therefore subsequent groups pro actively materialise the slice of columns which are known
to be needed, using the second environment of the data mask.&lt;/p&gt;
&lt;p&gt;The two lines that were removed by mistake are central to this system, without them each group would
invoke the costly active binding. Even worse, the list of indices of columns to be rematerialised,
as maintained by a vector of integers, would grow each time, so on the second group the column slice would
be materialized twice to be then forgotten, on the third group three times &amp;hellip;&lt;/p&gt;
&lt;p&gt;Classic embarrassing quadratic performance regression.&lt;/p&gt;




&lt;h2 id=&#34;thanks&#34;&gt;Thanks
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to the community for quickly alerting us of the situation, the 🐌 had been
in the code base for almost two months but we had not noticed because our continuous
integration protects us from regressions in functionality, but not regression in performance.&lt;/p&gt;
&lt;p&gt;We might investigate in that direction in the future.Thanks to all contributors for this release.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/ajkroeg&#34;&gt;@ajkroeg&lt;/a&gt;, &lt;a href=&#34;https://github.com/bschneidr&#34;&gt;@bschneidr&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/dhicks&#34;&gt;@dhicks&lt;/a&gt;, &lt;a href=&#34;https://github.com/gvfarns&#34;&gt;@gvfarns&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, and &lt;a href=&#34;https://github.com/shane-kercheval&#34;&gt;@shane-kercheval&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>dplyr 0.8.2</title>
      <link>https://www.tidyverse.org/blog/2019/06/dplyr-0-8-2/</link>
      <pubDate>Sat, 29 Jun 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/06/dplyr-0-8-2/</guid>
      <description>Introduction     We&amp;rsquo;re delighted to announce the release of dplyr 0.8.2 on CRAN 🍉 !
This is a minor maintenance release in the 0.8.* series, addressing a collection of issues since the 0.8.1 and 0.8.0 versions.
top_n() and top_frac()     top_n() has been around for a long time in dplyr, as a convenient wrapper around filter() and min_rank(), to select top (or bottom) entries in each group of a tibble.</description>
      <content>



&lt;h2 id=&#34;introduction&#34;&gt;Introduction
  &lt;a href=&#34;#introduction&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;re delighted to announce the release of dplyr 0.8.2 on CRAN 🍉 !&lt;/p&gt;
&lt;p&gt;This is a minor maintenance release in the &lt;code&gt;0.8.*&lt;/code&gt; series, addressing a collection of
issues since the &lt;a href=&#34;https://www.tidyverse.org/articles/2019/05/dplyr-0-8-1/&#34;&gt;0.8.1&lt;/a&gt; and
&lt;a href=&#34;https://www.tidyverse.org/articles/2019/02/dplyr-0-8-0/&#34;&gt;0.8.0&lt;/a&gt; versions.&lt;/p&gt;




&lt;h2 id=&#34;top_n-and-top_frac&#34;&gt;top_n() and top_frac()
  &lt;a href=&#34;#top_n-and-top_frac&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/top_n.html&#34;&gt;top_n()&lt;/a&gt; has been around for a long time in
&lt;a href=&#34;https://dplyr.tidyverse.org/index.html&#34;&gt;dplyr&lt;/a&gt;, as a convenient wrapper around
&lt;a href=&#34;https://dplyr.tidyverse.org/articles/dplyr.html?q=filter&#34;&gt;filter()&lt;/a&gt;
and &lt;a href=&#34;https://dplyr.tidyverse.org/reference/ranking.html&#34;&gt;min_rank()&lt;/a&gt;,
to select top (or bottom) entries in each group of a tibble.&lt;/p&gt;
&lt;p&gt;In this release, &lt;a href=&#34;https://dplyr.tidyverse.org/reference/top_n.html&#34;&gt;top_n()&lt;/a&gt; is no longer
limited to a constant number of entries per group, its &lt;code&gt;n&lt;/code&gt; argument is now quoted
to be evaluated later in the context of the group.&lt;/p&gt;
&lt;p&gt;Here are the top half countries, i.e. &lt;code&gt;n() / 2&lt;/code&gt;, in terms of life expectancy in 2007.&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;dplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Attaching package: &amp;#39;dplyr&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; The following objects are masked from &amp;#39;package:stats&amp;#39;:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     filter, lag&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; The following objects are masked from &amp;#39;package:base&amp;#39;:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     intersect, setdiff, setequal, union&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;gapminder&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gapminder&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2007&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;continent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;top_n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;lifeExp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 70 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   continent [5]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    country   continent  year lifeExp        pop gdpPercap&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;fct&amp;gt;     &amp;lt;fct&amp;gt;     &amp;lt;int&amp;gt;   &amp;lt;dbl&amp;gt;      &amp;lt;int&amp;gt;     &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 Algeria   Africa     2007    72.3   33333216     6223.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 Argentina Americas   2007    75.3   40301927    12779.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 Australia Oceania    2007    81.2   20434176    34435.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 Austria   Europe     2007    79.8    8199783    36126.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 Bahrain   Asia       2007    75.6     708573    29796.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 Belgium   Europe     2007    79.4   10392226    33693.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 Benin     Africa     2007    56.7    8078314     1441.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 Canada    Americas   2007    80.7   33390141    36319.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 Chile     Americas   2007    78.6   16284741    13172.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 China     Asia       2007    73.0 1318683096     4959.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 60 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/top_n.html&#34;&gt;top_frac()&lt;/a&gt; is new convenience shortcut for
the top n percent, i.e.&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;gapminder&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gapminder&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2007&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;continent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;top_frac&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;lifeExp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 70 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   continent [5]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    country   continent  year lifeExp        pop gdpPercap&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;fct&amp;gt;     &amp;lt;fct&amp;gt;     &amp;lt;int&amp;gt;   &amp;lt;dbl&amp;gt;      &amp;lt;int&amp;gt;     &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 Algeria   Africa     2007    72.3   33333216     6223.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 Argentina Americas   2007    75.3   40301927    12779.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 Australia Oceania    2007    81.2   20434176    34435.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 Austria   Europe     2007    79.8    8199783    36126.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 Bahrain   Asia       2007    75.6     708573    29796.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 Belgium   Europe     2007    79.4   10392226    33693.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 Benin     Africa     2007    56.7    8078314     1441.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 Canada    Americas   2007    80.7   33390141    36319.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 Chile     Americas   2007    78.6   16284741    13172.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 China     Asia       2007    73.0 1318683096     4959.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 60 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;tbl_vars-and-group_cols&#34;&gt;tbl_vars() and group_cols()
  &lt;a href=&#34;#tbl_vars-and-group_cols&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/tbl_vars.html&#34;&gt;tbl_vars()&lt;/a&gt; now returns a &lt;code&gt;dplyr_sel_vars&lt;/code&gt;
object that keeps track of the grouping variables. This information powers
&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_cols.html&#34;&gt;group_cols()&lt;/a&gt;, which can now be used
in every function that uses tidy selection of columns.&lt;/p&gt;
&lt;p&gt;Functions in the tidyverse and beyond may start to use the
&lt;a href=&#34;https://dplyr.tidyverse.org/reference/tbl_vars.html&#34;&gt;tbl_vars()&lt;/a&gt;/&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_cols.html&#34;&gt;group_cols()&lt;/a&gt; duo,
starting from &lt;a href=&#34;https://tidyr.tidyverse.org&#34;&gt;tidyr&lt;/a&gt; and this &lt;a href=&#34;https://github.com/tidyverse/tidyr/pull/668&#34;&gt;pull request&lt;/a&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;# pak::pkg_install(&amp;#34;tidyverse/tidyr#668&amp;#34;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Species&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;tidyr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;gather&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flower_att&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;measurement&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;group_cols&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 600 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   Species [3]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    Species flower_att   measurement&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;fct&amp;gt;   &amp;lt;chr&amp;gt;              &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 setosa  Sepal.Length         5.1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 setosa  Sepal.Length         4.9&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 setosa  Sepal.Length         4.7&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 setosa  Sepal.Length         4.6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 setosa  Sepal.Length         5  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 setosa  Sepal.Length         5.4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 setosa  Sepal.Length         4.6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 setosa  Sepal.Length         5  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 setosa  Sepal.Length         4.4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 setosa  Sepal.Length         4.9&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 590 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;group_split-group_map-group_modify&#34;&gt;group_split(), group_map(), group_modify()
  &lt;a href=&#34;#group_split-group_map-group_modify&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_split.html&#34;&gt;group_split()&lt;/a&gt; always keeps
a &lt;code&gt;ptype&lt;/code&gt; attribute to track the prototype of the splits.&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;mtcars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cyl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hp&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_split&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; list()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; attr(,&amp;#34;ptype&amp;#34;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 0 x 11&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 11 variables: mpg &amp;lt;dbl&amp;gt;, cyl &amp;lt;dbl&amp;gt;, disp &amp;lt;dbl&amp;gt;, hp &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   drat &amp;lt;dbl&amp;gt;, wt &amp;lt;dbl&amp;gt;, qsec &amp;lt;dbl&amp;gt;, vs &amp;lt;dbl&amp;gt;, am &amp;lt;dbl&amp;gt;, gear &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   carb &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_map.html&#34;&gt;group_map()&lt;/a&gt; and &lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_map.html&#34;&gt;group_modify()&lt;/a&gt;
benefit from this in the edge case where there are no groups.&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;mtcars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cyl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hp&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;~&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; list()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; attr(,&amp;#34;ptype&amp;#34;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 0 x 10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 10 variables: mpg &amp;lt;dbl&amp;gt;, disp &amp;lt;dbl&amp;gt;, hp &amp;lt;dbl&amp;gt;, drat &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   wt &amp;lt;dbl&amp;gt;, qsec &amp;lt;dbl&amp;gt;, vs &amp;lt;dbl&amp;gt;, am &amp;lt;dbl&amp;gt;, gear &amp;lt;dbl&amp;gt;, carb &amp;lt;dbl&amp;gt;&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cyl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hp&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_modify&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;~&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 0 x 11&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   cyl [0]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 11 variables: cyl &amp;lt;dbl&amp;gt;, mpg &amp;lt;dbl&amp;gt;, disp &amp;lt;dbl&amp;gt;, hp &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   drat &amp;lt;dbl&amp;gt;, wt &amp;lt;dbl&amp;gt;, qsec &amp;lt;dbl&amp;gt;, vs &amp;lt;dbl&amp;gt;, am &amp;lt;dbl&amp;gt;, gear &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   carb &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;thanks&#34;&gt;Thanks
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to all contributors for this release.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/abirasathiy&#34;&gt;@abirasathiy&lt;/a&gt;, &lt;a href=&#34;https://github.com/ajkroeg&#34;&gt;@ajkroeg&lt;/a&gt;, &lt;a href=&#34;https://github.com/alejandroschuler&#34;&gt;@alejandroschuler&lt;/a&gt;, &lt;a href=&#34;https://github.com/anuj2054&#34;&gt;@anuj2054&lt;/a&gt;, &lt;a href=&#34;https://github.com/arider2&#34;&gt;@arider2&lt;/a&gt;, &lt;a href=&#34;https://github.com/arielfuentes&#34;&gt;@arielfuentes&lt;/a&gt;, &lt;a href=&#34;https://github.com/artidata&#34;&gt;@artidata&lt;/a&gt;, &lt;a href=&#34;https://github.com/BenPVD&#34;&gt;@BenPVD&lt;/a&gt;, &lt;a href=&#34;https://github.com/bkmontgom&#34;&gt;@bkmontgom&lt;/a&gt;, &lt;a href=&#34;https://github.com/brodieG&#34;&gt;@brodieG&lt;/a&gt;, &lt;a href=&#34;https://github.com/cderv&#34;&gt;@cderv&lt;/a&gt;, &lt;a href=&#34;https://github.com/clanker&#34;&gt;@clanker&lt;/a&gt;, &lt;a href=&#34;https://github.com/clemenshug&#34;&gt;@clemenshug&lt;/a&gt;, &lt;a href=&#34;https://github.com/CSheehan1&#34;&gt;@CSheehan1&lt;/a&gt;, &lt;a href=&#34;https://github.com/danielecook&#34;&gt;@danielecook&lt;/a&gt;, &lt;a href=&#34;https://github.com/dannyparsons&#34;&gt;@dannyparsons&lt;/a&gt;, &lt;a href=&#34;https://github.com/daskandalis&#34;&gt;@daskandalis&lt;/a&gt;, &lt;a href=&#34;https://github.com/davidbaniadam&#34;&gt;@davidbaniadam&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/deliciouslytyped&#34;&gt;@deliciouslytyped&lt;/a&gt;, &lt;a href=&#34;https://github.com/earowang&#34;&gt;@earowang&lt;/a&gt;, &lt;a href=&#34;https://github.com/fkatharina&#34;&gt;@fkatharina&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/Hardervidertsie&#34;&gt;@Hardervidertsie&lt;/a&gt;, &lt;a href=&#34;https://github.com/iago-pssjd&#34;&gt;@iago-pssjd&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackdolgin&#34;&gt;@jackdolgin&lt;/a&gt;, &lt;a href=&#34;https://github.com/jangorecki&#34;&gt;@jangorecki&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jjesusfilho&#34;&gt;@jjesusfilho&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonjhitchcock&#34;&gt;@jonjhitchcock&lt;/a&gt;, &lt;a href=&#34;https://github.com/jxu&#34;&gt;@jxu&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/laresbernardo&#34;&gt;@laresbernardo&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/LukeGoodsell&#34;&gt;@LukeGoodsell&lt;/a&gt;, &lt;a href=&#34;https://github.com/madmark81&#34;&gt;@madmark81&lt;/a&gt;, &lt;a href=&#34;https://github.com/MarkusBerroth&#34;&gt;@MarkusBerroth&lt;/a&gt;, &lt;a href=&#34;https://github.com/matheus-donato&#34;&gt;@matheus-donato&lt;/a&gt;, &lt;a href=&#34;https://github.com/mattfidler&#34;&gt;@mattfidler&lt;/a&gt;, &lt;a href=&#34;https://github.com/MatthieuStigler&#34;&gt;@MatthieuStigler&lt;/a&gt;, &lt;a href=&#34;https://github.com/md0u80c9&#34;&gt;@md0u80c9&lt;/a&gt;, &lt;a href=&#34;https://github.com/michaelhogersosis&#34;&gt;@michaelhogersosis&lt;/a&gt;, &lt;a href=&#34;https://github.com/MikeJohnPage&#34;&gt;@MikeJohnPage&lt;/a&gt;, &lt;a href=&#34;https://github.com/MJL9588&#34;&gt;@MJL9588&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/mwillumz&#34;&gt;@mwillumz&lt;/a&gt;, &lt;a href=&#34;https://github.com/Nelson-Gon&#34;&gt;@Nelson-Gon&lt;/a&gt;, &lt;a href=&#34;https://github.com/qdread&#34;&gt;@qdread&lt;/a&gt;, &lt;a href=&#34;https://github.com/randomgambit&#34;&gt;@randomgambit&lt;/a&gt;, &lt;a href=&#34;https://github.com/rcorty&#34;&gt;@rcorty&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/romatik&#34;&gt;@romatik&lt;/a&gt;, &lt;a href=&#34;https://github.com/spressi&#34;&gt;@spressi&lt;/a&gt;, &lt;a href=&#34;https://github.com/sstoeckl&#34;&gt;@sstoeckl&lt;/a&gt;, &lt;a href=&#34;https://github.com/stephLH&#34;&gt;@stephLH&lt;/a&gt;, &lt;a href=&#34;https://github.com/urskalbitzer&#34;&gt;@urskalbitzer&lt;/a&gt;, &lt;a href=&#34;https://github.com/vpanfilov&#34;&gt;@vpanfilov&lt;/a&gt;, and &lt;a href=&#34;https://github.com/ZahraEconomist&#34;&gt;@ZahraEconomist&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>rlang 0.4.0</title>
      <link>https://www.tidyverse.org/blog/2019/06/rlang-0-4-0/</link>
      <pubDate>Thu, 27 Jun 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/06/rlang-0-4-0/</guid>
      <description>It is with great excitement that we announce the release of rlang 0.4.0 on CRAN. rlang is a toolkit for working with core R and Tidyverse features, and hosts the tidy evaluation framework. The full set of changes can be found in the changelog.
In this article, we introduce the most important of these, the new tidy evaluation operator {{. We will use a simple dplyr pipeline as a running example, let&amp;rsquo;s start by attaching the package:</description>
      <content>&lt;p&gt;It is with great excitement that we announce the release of &lt;a href=&#34;https://rlang.r-lib.org&#34;&gt;rlang 0.4.0&lt;/a&gt; on CRAN. rlang is a toolkit for working with core R and Tidyverse features, and hosts the tidy evaluation framework. The full set of changes can be found in the &lt;a href=&#34;https://rlang.r-lib.org/news/index.html#rlang-0-4-0&#34;&gt;changelog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this article, we introduce the most important of these, the new tidy evaluation operator &lt;code&gt;{{&lt;/code&gt;. We will use a simple dplyr pipeline as a running example, let&amp;rsquo;s start by attaching the package:&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;dplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;the-good-and-bad-of-tidy-evaluation&#34;&gt;The good and bad of tidy evaluation
  &lt;a href=&#34;#the-good-and-bad-of-tidy-evaluation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Tidy eval powers packages like dplyr and tidyr. It makes it possible to manipulate data frame columns as if they were defined in the workspace:&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;gender&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error in eval(expr, envir, enclos): object &amp;#39;gender&amp;#39; not found&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;mass&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error in eval(expr, envir, enclos): object &amp;#39;mass&amp;#39; not found&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;starwars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mass_maximum&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mass&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   gender        mass_maximum&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;                &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 &amp;lt;NA&amp;gt;                    75&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 female                  75&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 hermaphrodite         1358&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 male                   159&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 none                   140&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We call this syntax &lt;strong&gt;data masking&lt;/strong&gt;. This feature is unique to the R language and greatly streamlines the writing and reading of code in interactive scripts. Unfortunately, it also makes it more complex to reuse common patterns inside functions:&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;max_by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;maximum&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;starwars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mass&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Column `by` is unknown&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Technically, this is because data-masked code needs to be &lt;em&gt;delayed&lt;/em&gt; and &lt;em&gt;transported&lt;/em&gt; to the data context. Behind the scenes, dplyr verbs achieve this by capturing the blueprint of your code, and resuming its evaluation inside the data mask. The example above fails because &lt;code&gt;group_by()&lt;/code&gt; is capturing the wrong piece of blueprint. To solve this, tidy evaluation provides &lt;code&gt;enquo()&lt;/code&gt; to delay the interpretation of code and capture its blueprint, and the surgery operator &lt;code&gt;!!&lt;/code&gt; for modifying blueprints. The combination of using &lt;code&gt;enquo()&lt;/code&gt; and &lt;code&gt;!!&lt;/code&gt; is called the &lt;strong&gt;quote-and-unquote&lt;/strong&gt; pattern:&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;max_by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!!&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;enquo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;maximum&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!!&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;enquo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;starwars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mass&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   gender        maximum&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;           &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 &amp;lt;NA&amp;gt;               75&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 female             75&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 hermaphrodite    1358&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 male              159&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 none              140&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We have come to realise that this pattern is difficult to teach and to learn because it involves a new, unfamiliar syntax, and because it introduces two new programming concepts (quote and unquote) that are hard to understand intuitively. This complexity is not really justified because this pattern is overly flexible for basic programming needs.&lt;/p&gt;




&lt;h2 id=&#34;a-simpler-interpolation-pattern-with-&#34;&gt;A simpler interpolation pattern with &lt;code&gt;{{&lt;/code&gt;
  &lt;a href=&#34;#a-simpler-interpolation-pattern-with-&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;rlang 0.4.0 provides a new operator, &lt;code&gt;{{&lt;/code&gt; (read: curly curly), which abstracts quote-and-unquote into a single &lt;strong&gt;interpolation&lt;/strong&gt; step. The curly-curly operator should be straightforward to use. When you create a function around a tidyverse pipeline, wrap the function arguments containing data frame variables with &lt;code&gt;{{&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;n&#34;&gt;max_by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}})&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;maximum&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}},&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;starwars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 1 x 1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   maximum&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1     264&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;starwars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gender&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   gender        maximum&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;           &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 &amp;lt;NA&amp;gt;              167&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 female            213&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 hermaphrodite     175&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 male              264&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 none              200&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This syntax should be reminiscent of string interpolation in the &lt;a href=&#34;https://glue.tidyverse.org/&#34;&gt;glue&lt;/a&gt; package by Jim Hester:&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;var&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;sample&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;woof&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;meow&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;mooh&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&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;o&#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;Did you just say {var}?&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Did you just say mooh?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;other-simple-tidy-evaluation-patterns&#34;&gt;Other simple tidy evaluation patterns
  &lt;a href=&#34;#other-simple-tidy-evaluation-patterns&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;There are a few existing patterns that aren&amp;rsquo;t emphasised enough in the existing documentation. We are changing our teaching strategy to focus on these simpler patterns.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If you would like to pass multiple arguments to a data-masking verb, pass &lt;code&gt;...&lt;/code&gt; directly:&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;summarise_by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}})&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
  
&lt;span class=&#34;n&#34;&gt;starwars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;summarise_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;average&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;maximum&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gender&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   gender        average maximum&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;           &amp;lt;dbl&amp;gt;   &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 &amp;lt;NA&amp;gt;             120      167&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 female           165.     213&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 hermaphrodite    175      175&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 male             179.     264&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 none             200      200&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You only need quote-and-unquote (with the plural variants &lt;code&gt;enquos()&lt;/code&gt; and &lt;code&gt;!!!&lt;/code&gt;) when you need to modify the inputs or their names in some way.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you have string inputs, use the &lt;code&gt;.data&lt;/code&gt; pronoun:&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;max_by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.data[[by]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;maximum&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.data[[var]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
  
&lt;span class=&#34;n&#34;&gt;starwars&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;height&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;gender&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 5 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   gender        maximum&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;           &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 &amp;lt;NA&amp;gt;              167&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 female            213&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 hermaphrodite     175&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 male              264&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 none              200&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;.&lt;/code&gt; pronoun from magrittr is not appropriate here because it represents the whole data frame, whereas &lt;code&gt;.data&lt;/code&gt; represents the subset for the current group.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To learn more about the different ways of programming around tidyverse pipelines, we recommend reading the &lt;a href=&#34;https://ggplot2.tidyverse.org/dev/articles/ggplot2-in-packages.html#using-aes-and-vars-in-a-package-function&#34;&gt;new programming vignette in ggplot2&lt;/a&gt;, written by &lt;a href=&#34;https://github.com/paleolimbot&#34;&gt;Dewey Dunnington&lt;/a&gt; who is currently interning at RStudio.&lt;/p&gt;




&lt;h2 id=&#34;thanks&#34;&gt;Thanks!
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The following people have contributed to this release by posting issues and pull requests:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/001ben&#34;&gt;@001ben&lt;/a&gt;, &lt;a href=&#34;https://github.com/asardaes&#34;&gt;@asardaes&lt;/a&gt;, &lt;a href=&#34;https://github.com/BillDunlap&#34;&gt;@BillDunlap&lt;/a&gt;, &lt;a href=&#34;https://github.com/burchill&#34;&gt;@burchill&lt;/a&gt;, &lt;a href=&#34;https://github.com/cpsievert&#34;&gt;@cpsievert&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/egnha&#34;&gt;@egnha&lt;/a&gt;, &lt;a href=&#34;https://github.com/flying-sheep&#34;&gt;@flying-sheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/gaborcsardi&#34;&gt;@gaborcsardi&lt;/a&gt;, &lt;a href=&#34;https://github.com/gaelledoucet&#34;&gt;@gaelledoucet&lt;/a&gt;, &lt;a href=&#34;https://github.com/GaGaMan1101&#34;&gt;@GaGaMan1101&lt;/a&gt;, &lt;a href=&#34;https://github.com/grayskripko&#34;&gt;@grayskripko&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/harrysouthworth&#34;&gt;@harrysouthworth&lt;/a&gt;, &lt;a href=&#34;https://github.com/holgerbrandl&#34;&gt;@holgerbrandl&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/jazzmoe&#34;&gt;@jazzmoe&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jjesusfilho&#34;&gt;@jjesusfilho&lt;/a&gt;, &lt;a href=&#34;https://github.com/juangomezduaso&#34;&gt;@juangomezduaso&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/Marieag&#34;&gt;@Marieag&lt;/a&gt;, &lt;a href=&#34;https://github.com/mmuurr&#34;&gt;@mmuurr&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/paulponcet&#34;&gt;@paulponcet&lt;/a&gt;, &lt;a href=&#34;https://github.com/riccardopinosio&#34;&gt;@riccardopinosio&lt;/a&gt;, &lt;a href=&#34;https://github.com/richierocks&#34;&gt;@richierocks&lt;/a&gt;, &lt;a href=&#34;https://github.com/RolandASc&#34;&gt;@RolandASc&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/s-fleck&#34;&gt;@s-fleck&lt;/a&gt;, &lt;a href=&#34;https://github.com/siddharthprabhu&#34;&gt;@siddharthprabhu&lt;/a&gt;, &lt;a href=&#34;https://github.com/subratiter1&#34;&gt;@subratiter1&lt;/a&gt;, &lt;a href=&#34;https://github.com/wch&#34;&gt;@wch&lt;/a&gt;, &lt;a href=&#34;https://github.com/wetlandscapes&#34;&gt;@wetlandscapes&lt;/a&gt;, &lt;a href=&#34;https://github.com/wlandau&#34;&gt;@wlandau&lt;/a&gt;, &lt;a href=&#34;https://github.com/x1o&#34;&gt;@x1o&lt;/a&gt;, &lt;a href=&#34;https://github.com/XWeiZhou&#34;&gt;@XWeiZhou&lt;/a&gt;, &lt;a href=&#34;https://github.com/yenzichun&#34;&gt;@yenzichun&lt;/a&gt;, &lt;a href=&#34;https://github.com/yonicd&#34;&gt;@yonicd&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zachary-foster&#34;&gt;@zachary-foster&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>ggplot2 3.2.0</title>
      <link>https://www.tidyverse.org/blog/2019/06/ggplot2-3-2-0/</link>
      <pubDate>Sun, 16 Jun 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/06/ggplot2-3-2-0/</guid>
      <description>We&amp;rsquo;re thrilled to announce the release of ggplot2 3.2.0 on CRAN. ggplot2 is a system for declaratively creating graphics, based on The Grammar of Graphics. You provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.
The 3.2.0 release is a minor release which focuses on performance improvements, but also includes a few new features and a range of bug fixes.</description>
      <content>&lt;p&gt;We&amp;rsquo;re thrilled to announce the release of &lt;a href=&#34;https://ggplot2.tidyverse.org&#34;&gt;ggplot2 3.2.0&lt;/a&gt; on CRAN. ggplot2 is a system for declaratively creating graphics, based on The Grammar of Graphics. You provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.&lt;/p&gt;
&lt;p&gt;The 3.2.0 release is a minor release which focuses on performance improvements, but also includes a few new features and a range of bug fixes. There are no breaking changes in this release, though a few changes may affect the visual appearance of plots in minor ways, noted below. Further, there are a few changes that developers of extension packages may need to take into account, but which won&amp;rsquo;t affect regular users. For a full overview of the changes, please see the &lt;a href=&#34;https://ggplot2.tidyverse.org/news/index.html&#34;&gt;release notes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This release also includes a range of contributions made during our tidyverse developer day in Austin, many from first-time contributors. We hope these contributors have been inspired to continue taking part in the development of ggplot2.&lt;/p&gt;
&lt;p&gt;Lastly, this release also sees the entrance of Hiroaki Yutani (&lt;em&gt;yutannihilation&lt;/em&gt; on both &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;Github&lt;/a&gt; and &lt;a href=&#34;https://twitter.com/yutannihilat_en&#34;&gt;Twitter&lt;/a&gt;) into the core developer team. Hiroaki has been amazing in tackling large and small issues, and we are very lucky to have him.&lt;/p&gt;




&lt;h2 id=&#34;performance&#34;&gt;Performance
  &lt;a href=&#34;#performance&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A large part of this release relates to internal changes intended to speed up ggplot2. Most of these are general and will affect the rendering speed of all the plots you make, but there has also been a specific focus on &lt;a href=&#34;https://ggplot2.tidyverse.org/reference/ggsf.html&#34;&gt;&lt;code&gt;geom_sf()&lt;/code&gt;&lt;/a&gt;. This is all part of a larger effort to make plotting in R more performant, and also includes changes in &lt;a href=&#34;https://gtable.r-lib.org&#34;&gt;gtable&lt;/a&gt;, &lt;a href=&#34;http://r-spatial.github.io/sf/&#34;&gt;sf&lt;/a&gt;, and R itself. Make sure to use the latest version of all of these packages to get the full benefit of the improvements.&lt;/p&gt;




&lt;h3 id=&#34;geom_sf&#34;&gt;geom_sf
  &lt;a href=&#34;#geom_sf&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;While most changes are general, &lt;code&gt;geom_sf()&lt;/code&gt; has received special attention. Most of this comes down to how &lt;code&gt;geom_sf()&lt;/code&gt; converted its input to grobs, which was done row by row. This meant that plotting 10,000 &lt;code&gt;ST_POINT&lt;/code&gt; objects would create 10,000 point grobs instead of a single grob containing 10,000 points. The same was true for all other data types. With the new release, ggplot2 will try to pack all objects into a single grob, which is possible when all objects are of the same type (&lt;code&gt;MULTI*&lt;/code&gt; types can be mixed with scalar types). Packing polygons into a single grob is only possible with R 3.6.0 and upwards, but all other types are backwards compatible with older versions of R. If the data contains a mix of types, ggplot2 will fall back to creating a grob for each row, but this is a much less frequent situation, and can usually be remedied by creating multiple sf layers instead. The other big performance bottleneck in plotting sf data was the normalization of the coordinates. As sf stores its data in nested lists, the standard vectorization in R doesn&amp;rsquo;t apply, which led to much worse performance compared to normalizing data stored in standard data frame format. The latest release of sf includes optimized functions for these operations implemented in C which ggplot2 now uses, so plotting performance has improved immensely.&lt;/p&gt;




&lt;h2 id=&#34;new-features&#34;&gt;New features
  &lt;a href=&#34;#new-features&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;With this release, ggplot2 gains the ability to plot polygons with holes (only in R 3.6 and later). Rather than providing a new geom, the functionality is built into &lt;a href=&#34;https://ggplot2.tidyverse.org/reference/geom_polygon.html&#34;&gt;&lt;code&gt;geom_polygon()&lt;/code&gt;&lt;/a&gt; through a new &lt;code&gt;subgroup&lt;/code&gt; aesthetic. Much as the &lt;code&gt;group&lt;/code&gt; aesthetic separates polygons in the data, the &lt;code&gt;subgroup&lt;/code&gt; aesthetic separates parts of each polygon. The first occurring subgroup should always be the outer ring of the polygon and any subsequent subgroup will describe holes in this (or, potentially, polygons within the holes and so on). There will not be any checks performed on the position of the subgroups, so it is the responsibility of the user to make sure they are inside the outer ring.&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;ggplot2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;radians&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;seq&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;pi&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;length.out&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;101&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;-1&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;circle&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;cos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;radians&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;cos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;radians&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;sin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;radians&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;sin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;radians&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;subgroup&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;rep&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;each&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;100&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;circle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;geom_polygon&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;subgroup&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;subgroup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;fill&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;firebrick&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;colour&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;black&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-03-ggplot2-3-2-0_files/figure-html/unnamed-chunk-1-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The other bigger new feature is the ability to modify the guide representation
of a layer through a new &lt;code&gt;key_glyph&lt;/code&gt; argument in all geoms. While the defaults
are often fine, there are situations where a different look serves the
visualisation:&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;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;economics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;psavert&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;color&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;savings rate&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;geom_line&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;key_glyph&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;timeseries&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-03-ggplot2-3-2-0_files/figure-html/unnamed-chunk-2-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;geom_rug&lt;/code&gt; has seen a range of improvements to give users more control over the appearance of the rug lines. The length of the rug lines can now be controlled and it is further possible to specify that they should be placed outside of the plotting region:&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;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;wt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mpg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;geom_rug&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sides&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;tr&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;unit&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;mm&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;outside&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# Need to turn clipping off if rug is outside plot area&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;coord_cartesian&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;clip&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;off&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-03-ggplot2-3-2-0_files/figure-html/unnamed-chunk-3-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;Aesthetics will now accept a function returning &lt;code&gt;NULL&lt;/code&gt;, and treat it as setting the aesthetic to &lt;code&gt;NULL&lt;/code&gt;. This can make it easier to program with ggplot2 e.g. by catching errors from non-existing variables:&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;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;data.frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#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;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#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;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;wrap&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tryCatch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;error&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;colour&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;wrap&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;no_such_column&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-03-ggplot2-3-2-0_files/figure-html/unnamed-chunk-4-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;Lastly, &lt;a href=&#34;https://ggplot2.tidyverse.org/reference/stat_function.html&#34;&gt;&lt;code&gt;stat_function()&lt;/code&gt;&lt;/a&gt; gains the ability to accept purrr-style lambda functions. The use of the formula notation for creating lambda functions has become widespread, and it is only natural that ggplot2 accepts it as well:&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;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;data.frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#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;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&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;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;^2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;geom_point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;stat_function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fun&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.x^2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-03-ggplot2-3-2-0_files/figure-html/unnamed-chunk-5-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;




&lt;h2 id=&#34;minor-fixes-and-improvements&#34;&gt;Minor fixes and improvements
  &lt;a href=&#34;#minor-fixes-and-improvements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://ggplot2.tidyverse.org/reference/ggsf.html&#34;&gt;&lt;code&gt;coord_sf&lt;/code&gt;&lt;/a&gt; now behaves the same as the other coords in relation to how it draws grid lines. This means that the aesthetics of the grid matches that of the other coordinate systems, and that it can be turned off through the theming system. You may see slight visual changes when using &lt;code&gt;geom_sf()&lt;/code&gt; as the default grid lines were slightly thicker in &lt;code&gt;coord_sf()&lt;/code&gt; prior to this change.&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;sf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Linking to GEOS 3.6.1, GDAL 2.1.3, PROJ 4.9.3&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;nc&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;st_read&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;system.file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;gpkg/nc.gpkg&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;package&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;sf&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;quiet&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;ggplot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;nc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;geom_sf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;aes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fill&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;AREA&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;theme_void&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-03-ggplot2-3-2-0_files/figure-html/unnamed-chunk-6-1.png&#34; width=&#34;700px&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;The automatic naming of scales has been refined and no longer contains back-ticks when the scale name is based on a complex aesthetic expression (e.g. &lt;code&gt;aes(x = a + b)&lt;/code&gt;). Again, this may result in slight changes to the visual appearance of plots, but only on a very superficial level.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thank you to the 171 people who who contributed issues, code and comments to this release:
&lt;a href=&#34;https://github.com/abl0719&#34;&gt;@abl0719&lt;/a&gt;, &lt;a href=&#34;https://github.com/agila5&#34;&gt;@agila5&lt;/a&gt;, &lt;a href=&#34;https://github.com/ahmohamed&#34;&gt;@ahmohamed&lt;/a&gt;, &lt;a href=&#34;https://github.com/amysheep&#34;&gt;@amysheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/andhamel&#34;&gt;@andhamel&lt;/a&gt;, &lt;a href=&#34;https://github.com/anthonytw&#34;&gt;@anthonytw&lt;/a&gt;, &lt;a href=&#34;https://github.com/Atomizer15&#34;&gt;@Atomizer15&lt;/a&gt;, &lt;a href=&#34;https://github.com/atusy&#34;&gt;@atusy&lt;/a&gt;, &lt;a href=&#34;https://github.com/baderstine&#34;&gt;@baderstine&lt;/a&gt;, &lt;a href=&#34;https://github.com/bakaburg1&#34;&gt;@bakaburg1&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/bdschwartzkopf&#34;&gt;@bdschwartzkopf&lt;/a&gt;, &lt;a href=&#34;https://github.com/beckymaust&#34;&gt;@beckymaust&lt;/a&gt;, &lt;a href=&#34;https://github.com/behrman&#34;&gt;@behrman&lt;/a&gt;, &lt;a href=&#34;https://github.com/bfgray3&#34;&gt;@bfgray3&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/Bisaloo&#34;&gt;@Bisaloo&lt;/a&gt;, &lt;a href=&#34;https://github.com/bjreisman&#34;&gt;@bjreisman&lt;/a&gt;, &lt;a href=&#34;https://github.com/blueskypie&#34;&gt;@blueskypie&lt;/a&gt;, &lt;a href=&#34;https://github.com/brfitzpatrick&#34;&gt;@brfitzpatrick&lt;/a&gt;, &lt;a href=&#34;https://github.com/brianwdavis&#34;&gt;@brianwdavis&lt;/a&gt;, &lt;a href=&#34;https://github.com/brodieG&#34;&gt;@brodieG&lt;/a&gt;, &lt;a href=&#34;https://github.com/caayala&#34;&gt;@caayala&lt;/a&gt;, &lt;a href=&#34;https://github.com/cderv&#34;&gt;@cderv&lt;/a&gt;, &lt;a href=&#34;https://github.com/chambox&#34;&gt;@chambox&lt;/a&gt;, &lt;a href=&#34;https://github.com/clairemcwhite&#34;&gt;@clairemcwhite&lt;/a&gt;, &lt;a href=&#34;https://github.com/clauswilke&#34;&gt;@clauswilke&lt;/a&gt;, &lt;a href=&#34;https://github.com/codetrainee&#34;&gt;@codetrainee&lt;/a&gt;, &lt;a href=&#34;https://github.com/ColinFay&#34;&gt;@ColinFay&lt;/a&gt;, &lt;a href=&#34;https://github.com/connorlewis&#34;&gt;@connorlewis&lt;/a&gt;, &lt;a href=&#34;https://github.com/coolbutuseless&#34;&gt;@coolbutuseless&lt;/a&gt;, &lt;a href=&#34;https://github.com/courtiol&#34;&gt;@courtiol&lt;/a&gt;, &lt;a href=&#34;https://github.com/cschwarz-stat-sfu-ca&#34;&gt;@cschwarz-stat-sfu-ca&lt;/a&gt;, &lt;a href=&#34;https://github.com/cystein&#34;&gt;@cystein&lt;/a&gt;, &lt;a href=&#34;https://github.com/dan-booth&#34;&gt;@dan-booth&lt;/a&gt;, &lt;a href=&#34;https://github.com/daniel-wells&#34;&gt;@daniel-wells&lt;/a&gt;, &lt;a href=&#34;https://github.com/DanielReedOcean&#34;&gt;@DanielReedOcean&lt;/a&gt;, &lt;a href=&#34;https://github.com/danielsjf&#34;&gt;@danielsjf&lt;/a&gt;, &lt;a href=&#34;https://github.com/daranzolin&#34;&gt;@daranzolin&lt;/a&gt;, &lt;a href=&#34;https://github.com/dariyasydykova&#34;&gt;@dariyasydykova&lt;/a&gt;, &lt;a href=&#34;https://github.com/dempseynoel&#34;&gt;@dempseynoel&lt;/a&gt;, &lt;a href=&#34;https://github.com/dipterix&#34;&gt;@dipterix&lt;/a&gt;, &lt;a href=&#34;https://github.com/dirkschumacher&#34;&gt;@dirkschumacher&lt;/a&gt;, &lt;a href=&#34;https://github.com/dkahle&#34;&gt;@dkahle&lt;/a&gt;, &lt;a href=&#34;https://github.com/dominicroye&#34;&gt;@dominicroye&lt;/a&gt;, &lt;a href=&#34;https://github.com/dongzhuoer&#34;&gt;@dongzhuoer&lt;/a&gt;, &lt;a href=&#34;https://github.com/dpseidel&#34;&gt;@dpseidel&lt;/a&gt;, &lt;a href=&#34;https://github.com/dvcv&#34;&gt;@dvcv&lt;/a&gt;, &lt;a href=&#34;https://github.com/efehandanisman&#34;&gt;@efehandanisman&lt;/a&gt;, &lt;a href=&#34;https://github.com/Eisit&#34;&gt;@Eisit&lt;/a&gt;, &lt;a href=&#34;https://github.com/Eli-Berkow&#34;&gt;@Eli-Berkow&lt;/a&gt;, &lt;a href=&#34;https://github.com/eliocamp&#34;&gt;@eliocamp&lt;/a&gt;, &lt;a href=&#34;https://github.com/ellessenne&#34;&gt;@ellessenne&lt;/a&gt;, &lt;a href=&#34;https://github.com/eoppe1022&#34;&gt;@eoppe1022&lt;/a&gt;, &lt;a href=&#34;https://github.com/felipegerard&#34;&gt;@felipegerard&lt;/a&gt;, &lt;a href=&#34;https://github.com/fereshtehizadi&#34;&gt;@fereshtehizadi&lt;/a&gt;, &lt;a href=&#34;https://github.com/flying-sheep&#34;&gt;@flying-sheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/fmmattioni&#34;&gt;@fmmattioni&lt;/a&gt;, &lt;a href=&#34;https://github.com/foehnwind&#34;&gt;@foehnwind&lt;/a&gt;, &lt;a href=&#34;https://github.com/fostvedt&#34;&gt;@fostvedt&lt;/a&gt;, &lt;a href=&#34;https://github.com/gagnagaman&#34;&gt;@gagnagaman&lt;/a&gt;, &lt;a href=&#34;https://github.com/gangstertiny&#34;&gt;@gangstertiny&lt;/a&gt;, &lt;a href=&#34;https://github.com/GBuchanon&#34;&gt;@GBuchanon&lt;/a&gt;, &lt;a href=&#34;https://github.com/gdkrmr&#34;&gt;@gdkrmr&lt;/a&gt;, &lt;a href=&#34;https://github.com/gdmcdonald&#34;&gt;@gdmcdonald&lt;/a&gt;, &lt;a href=&#34;https://github.com/ghost&#34;&gt;@ghost&lt;/a&gt;, &lt;a href=&#34;https://github.com/gibran-ali&#34;&gt;@gibran-ali&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/HaoLi111&#34;&gt;@HaoLi111&lt;/a&gt;, &lt;a href=&#34;https://github.com/has2k1&#34;&gt;@has2k1&lt;/a&gt;, &lt;a href=&#34;https://github.com/heavywatal&#34;&gt;@heavywatal&lt;/a&gt;, &lt;a href=&#34;https://github.com/Henrik-P&#34;&gt;@Henrik-P&lt;/a&gt;, &lt;a href=&#34;https://github.com/HenrikBengtsson&#34;&gt;@HenrikBengtsson&lt;/a&gt;, &lt;a href=&#34;https://github.com/hlendway&#34;&gt;@hlendway&lt;/a&gt;, &lt;a href=&#34;https://github.com/hoasxyz&#34;&gt;@hoasxyz&lt;/a&gt;, &lt;a href=&#34;https://github.com/hwt&#34;&gt;@hwt&lt;/a&gt;, &lt;a href=&#34;https://github.com/hyiltiz&#34;&gt;@hyiltiz&lt;/a&gt;, &lt;a href=&#34;https://github.com/idavydov&#34;&gt;@idavydov&lt;/a&gt;, &lt;a href=&#34;https://github.com/Ilia-Kosenkov&#34;&gt;@Ilia-Kosenkov&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/ismayc&#34;&gt;@ismayc&lt;/a&gt;, &lt;a href=&#34;https://github.com/JamesCuster&#34;&gt;@JamesCuster&lt;/a&gt;, &lt;a href=&#34;https://github.com/jarauh&#34;&gt;@jarauh&lt;/a&gt;, &lt;a href=&#34;https://github.com/JayVii&#34;&gt;@JayVii&lt;/a&gt;, &lt;a href=&#34;https://github.com/jmarshallnz&#34;&gt;@jmarshallnz&lt;/a&gt;, &lt;a href=&#34;https://github.com/JohnMount&#34;&gt;@JohnMount&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonoyuan&#34;&gt;@jonoyuan&lt;/a&gt;, &lt;a href=&#34;https://github.com/jprice80&#34;&gt;@jprice80&lt;/a&gt;, &lt;a href=&#34;https://github.com/jpritikin&#34;&gt;@jpritikin&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrnold&#34;&gt;@jrnold&lt;/a&gt;, &lt;a href=&#34;https://github.com/jsekamane&#34;&gt;@jsekamane&lt;/a&gt;, &lt;a href=&#34;https://github.com/jtelleria&#34;&gt;@jtelleria&lt;/a&gt;, &lt;a href=&#34;https://github.com/jugularvein&#34;&gt;@jugularvein&lt;/a&gt;, &lt;a href=&#34;https://github.com/karawoo&#34;&gt;@karawoo&lt;/a&gt;, &lt;a href=&#34;https://github.com/Katiedaisey&#34;&gt;@Katiedaisey&lt;/a&gt;, &lt;a href=&#34;https://github.com/katossky&#34;&gt;@katossky&lt;/a&gt;, &lt;a href=&#34;https://github.com/kdarras&#34;&gt;@kdarras&lt;/a&gt;, &lt;a href=&#34;https://github.com/kendonB&#34;&gt;@kendonB&lt;/a&gt;, &lt;a href=&#34;https://github.com/kilterwind&#34;&gt;@kilterwind&lt;/a&gt;, &lt;a href=&#34;https://github.com/LDalby&#34;&gt;@LDalby&lt;/a&gt;, &lt;a href=&#34;https://github.com/linzi-sg&#34;&gt;@linzi-sg&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/llendway&#34;&gt;@llendway&lt;/a&gt;, &lt;a href=&#34;https://github.com/llrs&#34;&gt;@llrs&lt;/a&gt;, &lt;a href=&#34;https://github.com/lpantano&#34;&gt;@lpantano&lt;/a&gt;, &lt;a href=&#34;https://github.com/LuffyLuffy&#34;&gt;@LuffyLuffy&lt;/a&gt;, &lt;a href=&#34;https://github.com/lwjohnst86&#34;&gt;@lwjohnst86&lt;/a&gt;, &lt;a href=&#34;https://github.com/lz1nwm&#34;&gt;@lz1nwm&lt;/a&gt;, &lt;a href=&#34;https://github.com/m-macaskill&#34;&gt;@m-macaskill&lt;/a&gt;, &lt;a href=&#34;https://github.com/malcolmbarrett&#34;&gt;@malcolmbarrett&lt;/a&gt;, &lt;a href=&#34;https://github.com/martin-ueding&#34;&gt;@martin-ueding&lt;/a&gt;, &lt;a href=&#34;https://github.com/matthewParksViome&#34;&gt;@matthewParksViome&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxheld83&#34;&gt;@maxheld83&lt;/a&gt;, &lt;a href=&#34;https://github.com/MaximOtt&#34;&gt;@MaximOtt&lt;/a&gt;, &lt;a href=&#34;https://github.com/mbertolacci&#34;&gt;@mbertolacci&lt;/a&gt;, &lt;a href=&#34;https://github.com/mcguinlu&#34;&gt;@mcguinlu&lt;/a&gt;, &lt;a href=&#34;https://github.com/MCM-Math&#34;&gt;@MCM-Math&lt;/a&gt;, &lt;a href=&#34;https://github.com/miguelmorin&#34;&gt;@miguelmorin&lt;/a&gt;, &lt;a href=&#34;https://github.com/mine-cetinkaya-rundel&#34;&gt;@mine-cetinkaya-rundel&lt;/a&gt;, &lt;a href=&#34;https://github.com/mitchelloharawild&#34;&gt;@mitchelloharawild&lt;/a&gt;, &lt;a href=&#34;https://github.com/mluerig&#34;&gt;@mluerig&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/njtierney&#34;&gt;@njtierney&lt;/a&gt;, &lt;a href=&#34;https://github.com/noahmotion&#34;&gt;@noahmotion&lt;/a&gt;, &lt;a href=&#34;https://github.com/npjc&#34;&gt;@npjc&lt;/a&gt;, &lt;a href=&#34;https://github.com/oranwutang&#34;&gt;@oranwutang&lt;/a&gt;, &lt;a href=&#34;https://github.com/osorensen&#34;&gt;@osorensen&lt;/a&gt;, &lt;a href=&#34;https://github.com/pachamaltese&#34;&gt;@pachamaltese&lt;/a&gt;, &lt;a href=&#34;https://github.com/paleolimbot&#34;&gt;@paleolimbot&lt;/a&gt;, &lt;a href=&#34;https://github.com/PaulLantos&#34;&gt;@PaulLantos&lt;/a&gt;, &lt;a href=&#34;https://github.com/peterhurford&#34;&gt;@peterhurford&lt;/a&gt;, &lt;a href=&#34;https://github.com/phmarek&#34;&gt;@phmarek&lt;/a&gt;, &lt;a href=&#34;https://github.com/powerbilayeredmap&#34;&gt;@powerbilayeredmap&lt;/a&gt;, &lt;a href=&#34;https://github.com/ppanko&#34;&gt;@ppanko&lt;/a&gt;, &lt;a href=&#34;https://github.com/ptoche&#34;&gt;@ptoche&lt;/a&gt;, &lt;a href=&#34;https://github.com/puhachov&#34;&gt;@puhachov&lt;/a&gt;, &lt;a href=&#34;https://github.com/rajkstats&#34;&gt;@rajkstats&lt;/a&gt;, &lt;a href=&#34;https://github.com/richierocks&#34;&gt;@richierocks&lt;/a&gt;, &lt;a href=&#34;https://github.com/sabahzero&#34;&gt;@sabahzero&lt;/a&gt;, &lt;a href=&#34;https://github.com/sahilseth&#34;&gt;@sahilseth&lt;/a&gt;, &lt;a href=&#34;https://github.com/SavasAli&#34;&gt;@SavasAli&lt;/a&gt;, &lt;a href=&#34;https://github.com/sctyner&#34;&gt;@sctyner&lt;/a&gt;, &lt;a href=&#34;https://github.com/sebneus&#34;&gt;@sebneus&lt;/a&gt;, &lt;a href=&#34;https://github.com/shauyin520&#34;&gt;@shauyin520&lt;/a&gt;, &lt;a href=&#34;https://github.com/sjackman&#34;&gt;@sjackman&lt;/a&gt;, &lt;a href=&#34;https://github.com/skanskan&#34;&gt;@skanskan&lt;/a&gt;, &lt;a href=&#34;https://github.com/slowkow&#34;&gt;@slowkow&lt;/a&gt;, &lt;a href=&#34;https://github.com/smouksassi&#34;&gt;@smouksassi&lt;/a&gt;, &lt;a href=&#34;https://github.com/sn248&#34;&gt;@sn248&lt;/a&gt;, &lt;a href=&#34;https://github.com/sowla&#34;&gt;@sowla&lt;/a&gt;, &lt;a href=&#34;https://github.com/sschloss1&#34;&gt;@sschloss1&lt;/a&gt;, &lt;a href=&#34;https://github.com/StefanBRas&#34;&gt;@StefanBRas&lt;/a&gt;, &lt;a href=&#34;https://github.com/steffilazerte&#34;&gt;@steffilazerte&lt;/a&gt;, &lt;a href=&#34;https://github.com/tcastrosantos&#34;&gt;@tcastrosantos&lt;/a&gt;, &lt;a href=&#34;https://github.com/thomasp85&#34;&gt;@thomasp85&lt;/a&gt;, &lt;a href=&#34;https://github.com/topepo&#34;&gt;@topepo&lt;/a&gt;, &lt;a href=&#34;https://github.com/Torvaney&#34;&gt;@Torvaney&lt;/a&gt;, &lt;a href=&#34;https://github.com/touala&#34;&gt;@touala&lt;/a&gt;, &lt;a href=&#34;https://github.com/tungmilan&#34;&gt;@tungmilan&lt;/a&gt;, &lt;a href=&#34;https://github.com/vanzanden&#34;&gt;@vanzanden&lt;/a&gt;, &lt;a href=&#34;https://github.com/vbuchhold&#34;&gt;@vbuchhold&lt;/a&gt;, &lt;a href=&#34;https://github.com/W-L&#34;&gt;@W-L&lt;/a&gt;, &lt;a href=&#34;https://github.com/wongjingping&#34;&gt;@wongjingping&lt;/a&gt;, &lt;a href=&#34;https://github.com/wrightaprilm&#34;&gt;@wrightaprilm&lt;/a&gt;, &lt;a href=&#34;https://github.com/x1o&#34;&gt;@x1o&lt;/a&gt;, &lt;a href=&#34;https://github.com/yosukefk&#34;&gt;@yosukefk&lt;/a&gt;, &lt;a href=&#34;https://github.com/yudong862&#34;&gt;@yudong862&lt;/a&gt;, &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;, &lt;a href=&#34;https://github.com/zeehio&#34;&gt;@zeehio&lt;/a&gt;, &lt;a href=&#34;https://github.com/zlskidmore&#34;&gt;@zlskidmore&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zuccaval&#34;&gt;@zuccaval&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>It depends - A dialog about dependencies</title>
      <link>https://www.tidyverse.org/blog/2019/05/itdepends/</link>
      <pubDate>Wed, 29 May 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/05/itdepends/</guid>
      <description>It depends - A dialog about dependencies      This post paraphrases my talk with the same name at rstudio::conf 2019.
 Software dependencies can be a double-edged sword.
On one hand, they let you take advantage of others&amp;rsquo; work, giving your software marvelous new features and reducing bugs.
On the other hand, they can change over time, causing your software to break unexpectedly and (potentially) increasing your maintenance burden.</description>
      <content>



&lt;h1 id=&#34;it-depends---a-dialog-about-dependencies&#34;&gt;It depends - A dialog about dependencies
  &lt;a href=&#34;#it-depends---a-dialog-about-dependencies&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h1&gt;&lt;blockquote&gt;
&lt;p&gt;This post paraphrases my &lt;a href=&#34;https://resources.rstudio.com/rstudio-conf-2019/it-depends-a-dialog-about-dependencies&#34;&gt;talk with the same name&lt;/a&gt; at rstudio::conf 2019.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Software dependencies can be a double-edged sword.&lt;/p&gt;
&lt;p&gt;On one hand, they let you take advantage of others&amp;rsquo; work, giving your software
marvelous new features and reducing bugs.&lt;/p&gt;
&lt;p&gt;On the other hand, they can change over time, causing your software to break
unexpectedly and (potentially) increasing your maintenance burden. They can also
take additional disk space and installation time.&lt;/p&gt;
&lt;p&gt;These downsides have led some to suggest a &amp;lsquo;dependency zero&amp;rsquo; mindset.&lt;/p&gt;
&lt;p&gt;We feel that this is a major mistake for most projects, and will instead increase
maintenance burden, lower functionality and introduce additional bugs.&lt;/p&gt;




&lt;h2 id=&#34;dependencies-are-not-equal&#34;&gt;Dependencies are not equal
  &lt;a href=&#34;#dependencies-are-not-equal&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;One issue with striving for minimal dependencies is it treats all dependencies
as equivalent. However, in reality this is far from the case. There are many
axes upon which dependencies can differ, but some of the most important include:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The type of the dependency. Some dependencies come bundled with R
itself (e.g. base, utils, stats) or are part of the &amp;lsquo;Recommended&amp;rsquo; packages
(e.g. Matrix, survival). These packages are very low cost to depend on,
as they are (nearly) universally installed on all users systems, and change
generally only with new R versions. In contrast dependencies can also come
from &lt;a href=&#34;https://CRAN.r-project.org&#34;&gt;CRAN&lt;/a&gt; or even from non-CRAN repositories
such as &lt;a href=&#34;https://www.bioconductor.org/&#34;&gt;Bioconductor&lt;/a&gt;,
&lt;a href=&#34;http://www.omegahat.net/&#34;&gt;Omegahat&lt;/a&gt; or
&lt;a href=&#34;https://github.com/eddelbuettel/drat&#34;&gt;drat&lt;/a&gt; which require users to configure
additional repositories before installation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The number of upstream dependencies. For example, the
&lt;a href=&#34;https://github.com/r-lib/rlang&#34;&gt;rlang&lt;/a&gt; package has no upstream
dependencies apart from R; while the
&lt;a href=&#34;https://cran.r-project.org/package=CNVScope&#34;&gt;CNVscope&lt;/a&gt; package has 125 upstream
dependencies, on both CRAN and Bioconductor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Already fulfilled dependencies. If your package depends on dplyr then
taking an additional dependency on tibble comes at no additional cost, as
dplyr itself already depends on tibble. Additionally some of the most
popular packages (e.g. ggplot2) will already be installed on the majority
of users&amp;rsquo; machines. So adding a ggplot2 dependency is unlikely to incur additional
installation costs in most cases.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The time taken to compile the package from source. Packages containing R code
generally install in roughly the same amount of time, but those that contain
C, C++ or Fortran code can take very different amounts of time depending
on the complexity of the code. For example, the
&lt;a href=&#34;https://cran.r-project.org/package=glue&#34;&gt;glue&lt;/a&gt; package takes ~5 seconds to
compile on CRAN&amp;rsquo;s build machines, whereas the
&lt;a href=&#34;https://cran.r-project.org/package=readr&#34;&gt;readr&lt;/a&gt; package takes ~500
seconds to install on the same machines.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The size of the built binary package. Users installing binary packages need
to download them, so the size of the built binary is relevant, particularly
for those with slow internet connections. This also varies a great deal
across packages. The &lt;a href=&#34;https://cran.r-project.org/package=awspack&#34;&gt;awspack&lt;/a&gt;
binary is only 8.6 Kb in size, while the
&lt;a href=&#34;https://cran.r-project.org/package=h2o&#34;&gt;h2o&lt;/a&gt; package is 123 Mb, and the
largest binary on Bioconductor is over 4 Gb!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The system requirements to build and use the package. Some packages
require additional system dependencies in order to be used.
For instance, the &lt;a href=&#34;https://cran.r-project.org/package=rgdal&#34;&gt;rgdal&lt;/a&gt; package
requires the GDAL and PROJ.4 dependencies, each of which in turn have
additional system dependencies. Another example is
&lt;a href=&#34;https://cran.r-project.org/package=rJava&#34;&gt;rJava&lt;/a&gt; which requires a Java SDK
and also has additional steps needed to configure R for the proper Java
installation, which has caused &lt;a href=&#34;https://stackoverflow.com/questions/tagged/rjava&#34;&gt;installation issues for many
people&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I hope the above examples illustrate that not all package dependencies are
equal, and we should not treat them as such by using a simple count of
dependencies as our metric.&lt;/p&gt;




&lt;h2 id=&#34;prefer-a-holistic-balanced-and-quantitative-approach&#34;&gt;Prefer a holistic, balanced and quantitative approach
  &lt;a href=&#34;#prefer-a-holistic-balanced-and-quantitative-approach&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Instead of striving for a minimal number of dependencies, I would instead suggest
a more holistic, balanced, and quantitative approach.&lt;/p&gt;
&lt;p&gt;A holistic approach looks at the project as a whole and asks who is the primary
audience? If the audience is other package authors, then a leaner package with fewer
dependencies may be more appropriate. If instead it is primarily data scientists or
statisticians they will likely already have many popular dependencies installed and
a more feature-full package is preferred.&lt;/p&gt;
&lt;p&gt;A balanced approach understands that adding (or removing) dependencies
come with trade-offs. Adding a dependency gives you additional features,
bug fixes, and real-world testing, at the costs of increased installation time,
disk space and maintenance if the dependency has breaking changes. In some
cases it makes sense to &lt;em&gt;increase&lt;/em&gt; dependencies for a package, even if an
implementation already exists. For instance base R has a number of different
implementations of non-standard evaluation with varying semantics across its
functions. The same used to be true of tidyverse packages as well, but now they
all depend on the implementations in the tidyselect and rlang packages,
which improves consistency of the feature substantially.&lt;/p&gt;
&lt;p&gt;In contrast, removing a dependency lowers installation time, disk space and
avoids potential breaking changes. However it also removes potential features,
increases bugs and takes additional development time.&lt;/p&gt;
&lt;p&gt;A quantitative approach lets you more accurately measure your dependencies, and
see which are heavier or lighter along various axes. Measuring each of the
dependencies gives you more power to reason about which dependencies would be
most beneficial to remove (if any).&lt;/p&gt;
&lt;p&gt;How you weigh these costs and benefits varies by the skills and experience of
the maintainer and the goals of the project.&lt;/p&gt;




&lt;h2 id=&#34;beware-illusory-superiority&#34;&gt;Beware illusory superiority
  &lt;a href=&#34;#beware-illusory-superiority&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;When making these decisions it is important to consider the
psychological phenomenon of &lt;a href=&#34;https://en.wikipedia.org/wiki/Illusory_superiority&#34;&gt;Illusory
Superiority&lt;/a&gt;. Illusory
superiority is the idea that people (regardless of background) overestimate
(sometimes greatly) their own abilities in a given field. No one is truly
immune to this phenomenon, including the author of this post! This phenomenon
will cause you to overestimate your ability to re-implement features, and
underestimate the introduction of new bugs.&lt;/p&gt;
&lt;p&gt;However, even if you truly &lt;em&gt;are&lt;/em&gt; a more skilled programmer than the maintainer of
a dependency, we would still advise caution. The existing package has the
significant benefits of &lt;em&gt;time&lt;/em&gt; and &lt;em&gt;users&lt;/em&gt;. Users who have undoubtedly uncovered
numerous bugs using the package in the real world, which are now fixed.&lt;/p&gt;




&lt;h2 id=&#34;itdepends-a-package-to-help-with-dependencies&#34;&gt;itdepends, a package to help with dependencies
  &lt;a href=&#34;#itdepends-a-package-to-help-with-dependencies&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The &lt;a href=&#34;https://github.com/r-lib/itdepends&#34;&gt;itdepends&lt;/a&gt; package
aids you in having a holistic, balanced and quantitative approach. It provides tools to
assess usage, measure weights, visualize proportions and if needed, assist
removal of dependencies.&lt;/p&gt;




&lt;h2 id=&#34;assess-usage-with-itdependsdep_usage&#34;&gt;Assess usage with &lt;code&gt;itdepends::dep_usage()&lt;/code&gt;
  &lt;a href=&#34;#assess-usage-with-itdependsdep_usage&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;dep_usage_proj()&lt;/code&gt; and &lt;code&gt;dep_usage_pkg()&lt;/code&gt; return a tibble of
every function call in your project or package. This information can then be
used to do things like&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;show which packages you are using the most in a project&lt;/li&gt;
&lt;/ul&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;tidyverse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;itdepends&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dep_usage_pkg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;ggplot2&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pkg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sort&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 23 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    pkg           n&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;chr&amp;gt;     &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 base      10333&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 ggplot2    1225&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 grid        313&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 scales      118&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 gtable       78&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 rlang        68&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 plyr         53&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 stats        44&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 utils        24&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 grDevices    20&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 13 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;show the most frequently used &lt;em&gt;function&lt;/em&gt; from each package&lt;/li&gt;
&lt;/ul&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;itdepends&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dep_usage_pkg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;ggplot2&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pkg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fun&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;top_n&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;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;arrange&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;desc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;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;c1&#34;&gt;#&amp;gt; Selecting by n&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 6 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   pkg [6]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   pkg     fun                 n&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;   &amp;lt;chr&amp;gt;           &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 base    &amp;lt;-               1627&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 grid    unit              101&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 ggplot2 waiver             99&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 gtable  gtable_add_grob    30&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 scales  alpha              17&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 utils   head               12&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;measure-weights-with-itdependsdep_weight&#34;&gt;Measure weights with &lt;code&gt;itdepends::dep_weight()&lt;/code&gt;
  &lt;a href=&#34;#measure-weights-with-itdependsdep_weight&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;dep_weight()&lt;/code&gt; weighs the supplied packages and returns a tibble of 24
different metrics that can be used to compare them. The most important metric
varies by person, so it is useful to examine the full spectrum.&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;weights&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;itdepends&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dep_weight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;dplyr&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;data.table&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;weights&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 2 x 25&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   package num_user bin_self bin_user install_self install_user  funs&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;chr&amp;gt;      &amp;lt;int&amp;gt;    &amp;lt;int&amp;gt;    &amp;lt;dbl&amp;gt;        &amp;lt;dbl&amp;gt;        &amp;lt;dbl&amp;gt; &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 dplyr         21  1821891 23147844        272.         436.    260&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 data.t…        0  6222622  6222622         29.5         29.5   108&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 18 more variables: downloads &amp;lt;dbl&amp;gt;, last_release &amp;lt;dttm&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   open_issues &amp;lt;int&amp;gt;, last_updated &amp;lt;dttm&amp;gt;, stars &amp;lt;int&amp;gt;, forks &amp;lt;int&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   first_release &amp;lt;dttm&amp;gt;, total_releases &amp;lt;dbl&amp;gt;, releases_last_52 &amp;lt;int&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   num_dev &amp;lt;int&amp;gt;, install_dev &amp;lt;dbl&amp;gt;, bin_dev &amp;lt;dbl&amp;gt;, src_size &amp;lt;int&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   user_deps &amp;lt;list&amp;gt;, dev_deps &amp;lt;list&amp;gt;, self_timings &amp;lt;list&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   user_timings &amp;lt;list&amp;gt;, dev_timings &amp;lt;list&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The measures break down into a few rough categories:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;package and repository information (&lt;code&gt;package&lt;/code&gt;, &lt;code&gt;funs&lt;/code&gt;, &lt;code&gt;downloads&lt;/code&gt;, &lt;code&gt;open_issues&lt;/code&gt;, &lt;code&gt;last_updated&lt;/code&gt;, &lt;code&gt;forks&lt;/code&gt;, &lt;code&gt;stars&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;dependency information (&lt;code&gt;num_users&lt;/code&gt;, &lt;code&gt;num_dev&lt;/code&gt;, &lt;code&gt;user_deps&lt;/code&gt;, &lt;code&gt;dev_deps&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;compiled binary sizes (&lt;code&gt;bin_self&lt;/code&gt;, &lt;code&gt;bin_user&lt;/code&gt;, &lt;code&gt;bin_dev&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;time to compile dependencies, and the raw times (&lt;code&gt;install_self&lt;/code&gt;, &lt;code&gt;install_user&lt;/code&gt;, &lt;code&gt;install_dev&lt;/code&gt;, &lt;code&gt;self_timings&lt;/code&gt;, &lt;code&gt;user_timings&lt;/code&gt;, &lt;code&gt;dev_timings&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;CRAN release information (&lt;code&gt;downloads&lt;/code&gt;, &lt;code&gt;first_release&lt;/code&gt;, &lt;code&gt;last_release&lt;/code&gt;, &lt;code&gt;total_releases&lt;/code&gt;, &lt;code&gt;releases_last_52&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The total number of dependencies, binary sizes, and installation times give you
a good idea the magnitude of the dependency load.&lt;/p&gt;
&lt;p&gt;Equally important, however, are the downloads, release information and open
issues, which tell you how long the package has existed, how many people are
using it and how many open issues exist. Packages that have existed longer,
with more users and fewer issues should generally be more reliable.&lt;/p&gt;




&lt;h2 id=&#34;visualize-proportions-with-itdependsdep_plot&#34;&gt;Visualize proportions with &lt;code&gt;itdepends::dep_plot()&lt;/code&gt;
  &lt;a href=&#34;#visualize-proportions-with-itdependsdep_plot&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;There are two functions available to plot the relative weights of dependencies.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;dep_plot_time()&lt;/code&gt; plots the median compilation time on CRAN&amp;rsquo;s servers.&lt;/li&gt;
&lt;/ol&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;itdepends&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dep_plot_time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;dplyr&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-05-itdepends_files/figure-html/unnamed-chunk-4-1.png&#34; width=&#34;672&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;From the above plot we see that the installation time of dplyr for users is
mostly due to compiling dplyr itself. However, for development dependencies, the
readr, stringi and RSQLite packages also take significant time to install.&lt;/p&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;&lt;code&gt;dep_plot_size()&lt;/code&gt; plots the pre-compiled binary size, which is often the more
useful measure, as most users install pre-compiled binaries.&lt;/li&gt;
&lt;/ol&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;itdepends&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dep_plot_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;dplyr&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-05-itdepends_files/figure-html/unnamed-chunk-5-1.png&#34; width=&#34;672&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;From this we see the largest user dependencies are BH and Rcpp, and the largest
development dependencies are stringi, and two data packages, Lahman and
nycflights13.&lt;/p&gt;




&lt;h2 id=&#34;assist-removal-with-itdependsdep_locate&#34;&gt;Assist removal with &lt;code&gt;itdepends::dep_locate()&lt;/code&gt;
  &lt;a href=&#34;#assist-removal-with-itdependsdep_locate&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;If you do decide that a given dependency is too heavy or is too unstable to
keep, what are the best practices for removing it?&lt;/p&gt;
&lt;p&gt;First carefully review the operation of the function you are replacing. Many
functions in CRAN packages appear superficially similar to base equivalents,
but often handle edge cases (that you&amp;rsquo;ve likely never encountered) more
consistently. Next and most importantly, write &lt;em&gt;tests&lt;/em&gt; for the existing
behavior. This is an essential step which will greatly reduce the introduction
of new bugs. Only once you have written the tests should you start performing
the replacement. If you are porting a function with existing tests a good practice is
to port its tests as well.&lt;/p&gt;
&lt;p&gt;Then, use the &lt;code&gt;dep_locate()&lt;/code&gt; function to find all the instances when you use
functions from a given dependency in your code base. If &lt;code&gt;dep_locate()&lt;/code&gt; is run
in RStudio the function will add source markers for all the locations, which
can then be clicked individually to do the replacement.&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;itdepends&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dep_locate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;purrr&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;path&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;~/p/tidyversedashboard&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;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/itdepends/dep_locate.png&#34; width=&#34;100%&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;




&lt;h2 id=&#34;be-balanced-and-use-data&#34;&gt;Be balanced and use data
  &lt;a href=&#34;#be-balanced-and-use-data&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;In almost any area of life striving towards absolutes rarely provides the best
outcome. Package dependencies are no exception. Keep the expected users of your
package in mind, and use the tools provided in itdepends to
obtain data which can help you assess which dependencies to remove (if any).&lt;/p&gt;
&lt;p&gt;Donald Knuth has great advice about the importance of measurement during
performance optimization&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Programmers waste enormous amounts of time thinking about, or worrying about,
the speed of noncritical parts of their programs, and these attempts at
efficiency actually have a strong negative impact when debugging and
maintenance are considered. We should forget about small efficiencies, say
about 97% of the time: premature optimization is the root of all evil. Yet we
should not pass up our opportunities in that critical 3%.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Performance optimization &lt;em&gt;is&lt;/em&gt; important, but we should not seek to optimize
it until we have &lt;em&gt;measured&lt;/em&gt; our program to see where the this critical 3% lies.
The same is true of dependencies, lowering the dependencies &lt;em&gt;is&lt;/em&gt;
important for some packages, however we should not do so blindly without
identifying if it is truly necessary and measuring to discover what the most
critical dependencies are.&lt;/p&gt;
&lt;p&gt;Finally it is important to remember &lt;a href=&#34;https://en.wikipedia.org/wiki/Goodhart%27s_law&#34;&gt;Goodhart&amp;rsquo;s Law&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When a measure becomes a target, it ceases to be a good measure.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
    </item>
    
    <item>
      <title>Resource Cleanup in C and the R API</title>
      <link>https://www.tidyverse.org/blog/2019/05/resource-cleanup-in-c-and-the-r-api/</link>
      <pubDate>Wed, 22 May 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/05/resource-cleanup-in-c-and-the-r-api/</guid>
      <description>h1 code, h2 code { font-size: 0.8em; }  Introduction We have just released the cleancall package to CRAN. cleancall is a new package that helps avoiding resource leaks in the C code of your R package. In this blog post, we show some example resource leaks from base R and R packages, and also show three different ways to fix them, one of which uses the cleancall package.</description>
      <content>


&lt;style&gt;
h1 code, h2 code {
    font-size: 0.8em;
}
&lt;/style&gt;
&lt;div id=&#34;introduction&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;We have just released the &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; package to CRAN. &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; is a
new package that helps avoiding resource leaks in the C code of your
R package. In this blog post, we show some example resource leaks from
base R and R packages, and also show three different ways to fix them,
one of which uses the &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; package.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;the-problem&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;The problem&lt;/h1&gt;
&lt;p&gt;When writing C code in R packages, one non-trivial issue is to make
sure that resources acquired by a C function are correctly released
or wrapped before giving back control to R. The difficulties partially
arise from the many ways a C function can terminate and transfer control
back to R:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;regular termination,&lt;/li&gt;
&lt;li&gt;error,&lt;/li&gt;
&lt;li&gt;warning or other condition caught with &lt;code&gt;tryCatch()&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;debugger exit,&lt;/li&gt;
&lt;li&gt;keyboard interruption.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Resources that need to be released include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;memory areas,&lt;/li&gt;
&lt;li&gt;file handles,&lt;/li&gt;
&lt;li&gt;connections (sockets),&lt;/li&gt;
&lt;li&gt;database connections,&lt;/li&gt;
&lt;li&gt;Windows handles for threads, events, etc.,&lt;/li&gt;
&lt;li&gt;others.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&#34;regular-termination&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Regular termination&lt;/h2&gt;
&lt;p&gt;Most functions terminate successfully, most of the time. Releasing
resources is easy in this case, we can simply do it at the end of the
function, before returning.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;error&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Error&lt;/h2&gt;
&lt;p&gt;Errors may happen two ways. They can be thrown directly, or by the R API.
A function that reads a file will throw an error it if
fails to open the file for reading. These errors are easy to handle, we
can release all resources before throwing the error.&lt;/p&gt;
&lt;p&gt;Errors can also be thrown by the R API. The R C API functions do not
return on error, instead they perform an error (a &lt;code&gt;longjmp&lt;/code&gt; technically),
that can be caught by R or (recently) C code. Releasing resources is
trickier in this case, as our C function never gets back the control after
the failed R API call.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;warning-or-other-condition-caught-with-trycatch&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Warning or other condition caught with &lt;code&gt;tryCatch()&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Usually we assume that throwing a warning (or other non-error condition)
does not cause an early exit, but this is not always the case. Warnings can
be caught by an exiting &lt;code&gt;tryCatch()&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;debugger-exit&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Debugger exit&lt;/h2&gt;
&lt;p&gt;If the C function calls back to R to evaluate R expressions, then
these might invoke the debugger, see &lt;code&gt;?debug&lt;/code&gt; or &lt;code&gt;?trace&lt;/code&gt;. The &lt;code&gt;Q&lt;/code&gt; debugger
command invokes the &lt;code&gt;abort&lt;/code&gt; restart, to get back to the top-level prompt.
In this case most functions on the (R and C) stack are removed at once.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;keyboard-interruption&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Keyboard interruption&lt;/h2&gt;
&lt;p&gt;C code can call &lt;code&gt;R_CheckUserInterrupt()&lt;/code&gt;, and it is indeed suggested to do
so during long computation or I/O. If the user initiates an interrupt via
the keyboard or a signal, then &lt;code&gt;R_CheckUserInterrupt()&lt;/code&gt; never returns, and
the control goes back to top level.&lt;/p&gt;
&lt;p&gt;To illustrate the resource cleanup problem more, we’ll show some examples
from base R and CRAN packages that contain potential resource leaks.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;example-1-download.filemethod-internal&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Example 1: &lt;code&gt;download.file(method = &amp;quot;internal&amp;quot;)&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;The C implementation of &lt;code&gt;download.file()&lt;/code&gt; opens a file for saving the
downloaded data to, and it does not clean or even close this file on a
keyboard interrupt. The file is opened here:
&lt;a href=&#34;https://github.com/wch/r-source/blob/f3a67c36c5cf4c715dac374e33168cfc348106aa/src/modules/internet/internet.c#L553&#34; class=&#34;uri&#34;&gt;https://github.com/wch/r-source/blob/f3a67c36c5cf4c715dac374e33168cfc348106aa/src/modules/internet/internet.c#L553&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;    FILE *out;
    [...]
    out = R_fopen(R_ExpandFileName(file), mode);
    [...]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can easily show the problem in practice as well.
First, we create a handy function that interrupts the current process
one second after calling it. This allows us to simulate an interrupt from
the keyboard. It starts a background process that will send an interrupt
(SIGINT on Unix, CTRL+C on Windows) to our R process.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;interrupt &amp;lt;- function(expr, after = 1) {
  tryCatch({
    p &amp;lt;- callr::r_bg(function(pid, after) {
      Sys.sleep(after)
      ps::ps_interrupt(ps::ps_handle(pid))
    }, list(pid = Sys.getpid(), after = after))
    expr
    p$kill()
  }, interrupt = function(e) e)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;ps::ps_open_files()&lt;/code&gt; lists all open files of a process,&lt;code&gt;ps::ps_handle()&lt;/code&gt;
returns a handle for the current R process. You should see the three
file descriptors corresponding to standard input, output and error here,
and another file is used by the blogdown engine rendering this page. If you
run this code in your R session you’ll not see that file, but of course you
may see others.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;ps::ps_open_files(ps::ps_handle())
#&amp;gt; # A tibble: 4 x 2
#&amp;gt;      fd path
#&amp;gt;   &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt;
#&amp;gt; 1     0 /dev/ttys021
#&amp;gt; 2     1 /dev/ttys021
#&amp;gt; 3     2 /dev/ttys021
#&amp;gt; 4     7 /Users/gaborcsardi/R/blogdown/scripts/render_page.R&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we will start downloading a file, and while it is downloading, we’ll
send an interrupt to our R process, causing an early exit.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;interrupt(
  download.file(&amp;quot;http://httpbin.org/delay/3&amp;quot;, tempfile(), method = &amp;quot;internal&amp;quot;)
)
#&amp;gt; &amp;lt;interrupt: &amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The list of open files will now include the one opened by &lt;code&gt;download.file()&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;ps::ps_open_files(ps::ps_handle())
#&amp;gt; # A tibble: 5 x 2
#&amp;gt;      fd path
#&amp;gt;   &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt;
#&amp;gt; 1     0 /dev/ttys021
#&amp;gt; 2     1 /dev/ttys021
#&amp;gt; 3     2 /dev/ttys021
#&amp;gt; 4     7 /Users/gaborcsardi/R/blogdown/scripts/render_page.R
#&amp;gt; 5     9 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Because &lt;code&gt;download.file()&lt;/code&gt; fails to clean up this file handle, it is not
released until the R session quits. On Windows this file is probably locked,
and cannot be removed until R exits.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;example-2-download.filemethod-libcurl&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Example 2: &lt;code&gt;download.file(method = &amp;quot;libcurl&amp;quot;)&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;There is a very similar bug in the implementation of the &lt;code&gt;download.file()&lt;/code&gt;
libcurl method, which opens an output file here:
&lt;a href=&#34;https://github.com/wch/r-source/blob/def075db88ae87104c38437a57e9327b078bb804/src/modules/internet/libcurl.c#L566&#34; class=&#34;uri&#34;&gt;https://github.com/wch/r-source/blob/def075db88ae87104c38437a57e9327b078bb804/src/modules/internet/libcurl.c#L566&lt;/a&gt;
but it does not close it on error or interrupt. This method can download
many files in parallel, in which case multiple file handles may be lost:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;ps::ps_open_files(ps::ps_handle())
#&amp;gt; # A tibble: 5 x 2
#&amp;gt;      fd path
#&amp;gt;   &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt;
#&amp;gt; 1     0 /dev/ttys021
#&amp;gt; 2     1 /dev/ttys021
#&amp;gt; 3     2 /dev/ttys021
#&amp;gt; 4     7 /Users/gaborcsardi/R/blogdown/scripts/render_page.R
#&amp;gt; 5     9 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
interrupt(
  download.file(
    rep(&amp;quot;https://httpbin.org/delay/3&amp;quot;, 3), paste0(tempfile(), 1:3),
    method = &amp;quot;libcurl&amp;quot;)
)
#&amp;gt; &amp;lt;interrupt: &amp;gt;
ps::ps_open_files(ps::ps_handle())
#&amp;gt; # A tibble: 8 x 2
#&amp;gt;      fd path
#&amp;gt;   &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt;
#&amp;gt; 1     0 /dev/ttys021
#&amp;gt; 2     1 /dev/ttys021
#&amp;gt; 3     2 /dev/ttys021
#&amp;gt; 4     7 /Users/gaborcsardi/R/blogdown/scripts/render_page.R
#&amp;gt; 5     9 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 6    15 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 7    16 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 8    17 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;example-3-edit&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Example 3: &lt;code&gt;edit()&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;edit()&lt;/code&gt; invokes the text editor specified by the &lt;code&gt;editor&lt;/code&gt; option, with the
supplied object to be edited. &lt;code&gt;edit()&lt;/code&gt; can also write the edited version
to a file. It opens a file here to create its first version, before starting
the editor:
&lt;a href=&#34;https://github.com/wch/r-source/blob/019f16d3dec4f97c1b4e4f0ec905148e36979e37/src/main/edit.c#L121-L128&#34; class=&#34;uri&#34;&gt;https://github.com/wch/r-source/blob/019f16d3dec4f97c1b4e4f0ec905148e36979e37/src/main/edit.c#L121-L128&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;121    if((fp=R_fopen(R_ExpandFileName(filename), &amp;quot;w&amp;quot;)) == NULL)
122        errorcall(call, _(&amp;quot;unable to open file&amp;quot;));
123    if (LENGTH(STRING_ELT(fn, 0)) == 0) EdFileUsed++;
124    PROTECT(src = deparse1(x, 0, FORSOURCING)); /* deparse for sourcing, not for display */
125    for (i = 0; i &amp;lt; LENGTH(src); i++)
126        fprintf(fp, &amp;quot;%s\n&amp;quot;, translateChar(STRING_ELT(src, i)));
127    UNPROTECT(1); /* src */
128    fclose(fp);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If all goes well, then it will close it just 7 code lines later.
However, it also calls the R API a number of times before closing the file,
so if any of these API calls fail, the file is never closed. In particular,
it calls &lt;code&gt;deparse1()&lt;/code&gt; which is roughly equivalent to the R &lt;code&gt;deparse()&lt;/code&gt;
function, and &lt;code&gt;deparse&lt;/code&gt;()` fails on long vectors:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;ps::ps_open_files(ps::ps_handle())
#&amp;gt; # A tibble: 8 x 2
#&amp;gt;      fd path
#&amp;gt;   &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt;
#&amp;gt; 1     0 /dev/ttys021
#&amp;gt; 2     1 /dev/ttys021
#&amp;gt; 3     2 /dev/ttys021
#&amp;gt; 4     7 /Users/gaborcsardi/R/blogdown/scripts/render_page.R
#&amp;gt; 5     9 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 6    15 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 7    16 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 8    17 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
edit(1:10e10, file = tempfile())
#&amp;gt; Error in edit.default(1:1e+11, file = tempfile()): long vectors not supported yet: ../../../../R-3.5.3/src/include/Rinlinedfuns.h:519
ps::ps_open_files(ps::ps_handle())
#&amp;gt; # A tibble: 9 x 2
#&amp;gt;      fd path
#&amp;gt;   &amp;lt;int&amp;gt; &amp;lt;chr&amp;gt;
#&amp;gt; 1     0 /dev/ttys021
#&amp;gt; 2     1 /dev/ttys021
#&amp;gt; 3     2 /dev/ttys021
#&amp;gt; 4     7 /Users/gaborcsardi/R/blogdown/scripts/render_page.R
#&amp;gt; 5     8 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 6     9 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 7    15 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 8    16 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…
#&amp;gt; 9    17 /private/var/folders/59/0gkmw1yj2w7bf2dfc3jznv5w0000gn/T/Rtmp0Uww3…&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Notice that we have one more extra open file here.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;example-4-the-wait-method-in-processx&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Example 4: the wait() method in &lt;a href=&#34;https://github.com/r-lib/processx#readme&#34;&gt;processx&lt;/a&gt;:&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;processx::process&lt;/code&gt; is an R6 class for a subprocess. Its &lt;code&gt;$wait()&lt;/code&gt; method
waits for the subprocess to finish, with a timeout. To implement &lt;code&gt;$wait()&lt;/code&gt;
on Unix, &lt;a href=&#34;https://github.com/r-lib/processx#readme&#34;&gt;processx&lt;/a&gt; opens a pair of pipe file descriptors. These are
temporary and should be closed once the function exits. &lt;code&gt;$wait()&lt;/code&gt; is
interruptible, it calls &lt;code&gt;R_CheckUserInterrupt()&lt;/code&gt; periodically. However,
in the current, 3.3.0 version of &lt;a href=&#34;https://github.com/r-lib/processx#readme&#34;&gt;processx&lt;/a&gt; it does not close the pipe
file descriptors on an interrupt. Here is an illustration:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;ps::ps_num_fds(ps::ps_handle())
#&amp;gt; [1] 20

p &amp;lt;- processx::process$new(&amp;quot;sleep&amp;quot;, &amp;quot;10&amp;quot;)
interrupt(
  p$wait()
)
#&amp;gt; &amp;lt;interrupt: &amp;gt;
p$kill()
#&amp;gt; [1] TRUE
gc()
#&amp;gt;           used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
#&amp;gt; Ncells  626041 33.5    1203691 64.3         NA  1203691 64.3
#&amp;gt; Vcells 1188386  9.1    8388608 64.0      16384  2160124 16.5

ps::ps_num_fds(ps::ps_handle())
#&amp;gt; [1] 22&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;ps_num_fds()&lt;/code&gt; prints the number of open file descriptors of a process.
The two extra file descriptors that are open after garbage collection are
the two ends of the (supposedly) temporary pipe, just opened by &lt;code&gt;$wait()&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;fix-1-external-pointer-and-finalizer&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Fix 1: External pointer and finalizer&lt;/h1&gt;
&lt;p&gt;One generic solution to resource cleanup is to wrap all C resources into
one or more R external pointer objects, and add finalizers to them. We
show how this can fix the &lt;a href=&#34;https://github.com/r-lib/processx#readme&#34;&gt;processx&lt;/a&gt; problem in the previous example.&lt;/p&gt;
&lt;p&gt;This is how the &lt;code&gt;processx_wait()&lt;/code&gt; C function looks like before the fix:
&lt;a href=&#34;https://github.com/r-lib/processx/blob/a8f09d147fead78347a87fcf4e0fbd1c07de1c21/src/unix/processx.c#L507-L589&#34; class=&#34;uri&#34;&gt;https://github.com/r-lib/processx/blob/a8f09d147fead78347a87fcf4e0fbd1c07de1c21/src/unix/processx.c#L507-L589&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;First, we need to create a finalizer function, that will be called by
the R garbage collector, after &lt;code&gt;$wait()&lt;/code&gt; has finished, at the next
garbage collection:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;static void processx__wait_finalizer(SEXP xptr) {
  SEXP tag = R_ExternalPtrTag(xptr);
  if (INTEGER(tag)[0] &amp;gt;= 0) close(INTEGER(tag)[0]);
  if (INTEGER(tag)[1] &amp;gt;= 0) close(INTEGER(tag)[1]);
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;An external pointer can have a &lt;em&gt;tag&lt;/em&gt;, which is an R object that is kept
alive as long the pointer object itself is alive. In this case we can put
the file descriptors in the tag, in an integer vector of length two.
In more complicated cases the resources cannot easily be represented as
R objects, so you would use the actual C pointer, with a custom C
&lt;code&gt;struct&lt;/code&gt; to store them.&lt;/p&gt;
&lt;p&gt;Now we need to create the external pointer, before the pipes are opened:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;  SEXP tag = PROTECT(allocVector(INTSXP, 2));
  INTEGER(tag)[0] = INTEGER(tag)[1] = -1;
  SEXP xptr = PROTECT(R_MakeExternalPtr(NULL, tag, R_NilValue));
  R_RegisterCFinalizerEx(xptr, processx__wait_finalizer, 0);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We initialize the file descriptors to -1, which is guard value, meaning
that no cleanup is needed.&lt;/p&gt;
&lt;p&gt;We can now open the pipes and save their file descriptors in the tag of
the external pointer.&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;  if (pipe(handle-&amp;gt;waitpipe)) {
    processx__unblock_sigchld();
    error(&amp;quot;processx error: %s&amp;quot;, strerror(errno));
  }
  INTEGER(tag)[0] = handle-&amp;gt;waitpipe[0];
  INTEGER(tag)[1] = handle-&amp;gt;waitpipe[1];&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At the end of the function, we need to unprotect the external pointer,
and the tag:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;  UNPROTECT(2);
  return ScalarLogical(ret != 0);
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One potential problem with the external pointer fix is that the resources
will only be cleaned up at the next garbage collection, and sometimes this
is too late. For example, if an open file is locked by the operating system,
then we won’t be able to remove that file, or its directory, until the
garbage collector runs and closes it. It is easier to program if
resource cleanup is immediate, and luckily the other two fixes below are.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;fix-2-the-r_execwithcleanup-function&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Fix 2: the &lt;code&gt;R_ExecWithCleanup()&lt;/code&gt; function&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;R_ExecWithCleanup()&lt;/code&gt; is a function in the R API, that can add a cleanup
function to a regular C function call. The cleanup function is always
executed, even on early exit:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;SEXP R_ExecWithCleanup(SEXP (*fun)(void *), void *data,
               void (*cleanfun)(void *), void *cleandata);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;R_ExecWithCleanup()&lt;/code&gt; calls &lt;code&gt;fun&lt;/code&gt; with &lt;code&gt;data&lt;/code&gt;, and then calls
&lt;code&gt;cleanfun&lt;/code&gt; with &lt;code&gt;cleandata&lt;/code&gt;. If &lt;code&gt;fun&lt;/code&gt; calls the R API and exits early,
then it will still call &lt;code&gt;cleanfun&lt;/code&gt; with &lt;code&gt;cleandata&lt;/code&gt;, before throwing
the error up the stack.&lt;/p&gt;
&lt;p&gt;To fix &lt;code&gt;$wait()&lt;/code&gt; with &lt;code&gt;R_ExecWithCleanup()&lt;/code&gt;, we’ll need to define a
cleanup function first. The cleanup function receives the cleanup data
as a &lt;code&gt;void&lt;/code&gt; pointer, we’ll define a &lt;code&gt;struct&lt;/code&gt; for this. For simplicity,
this struct will also include the arguments to &lt;code&gt;processx_wait()&lt;/code&gt;, so
we can use the same struct for both &lt;code&gt;fun&lt;/code&gt; and &lt;code&gt;cleanupfun&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;struct processx_wait_data {
  SEXP status;
  SEXP timeout;
  int fds[2];
};

void processx_wait_cleanup(void *data) {
  struct processx_wait_data *pdata = data;
  if (pdata-&amp;gt;fds[0] &amp;gt;= 0) close(pdata-&amp;gt;fds[0]);
  if (pdata-&amp;gt;fds[1] &amp;gt;= 0) close(pdata-&amp;gt;fds[1]);
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The new &lt;code&gt;processx_wait()&lt;/code&gt; function will call &lt;code&gt;R_ExecWithCleanup()&lt;/code&gt;,
to call the original &lt;code&gt;processx_wait()&lt;/code&gt;, under a new name:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;SEXP processx_wait_internal(void *data);
SEXP processx_wait(SEXP status, SEXP timeout) {
  struct processx_wait_data pdata = { status, timeout, { -1, -1 } };
  SEXP result = R_ExecWithCleanup(processx_wait_internal, &amp;amp;pdata,
                                  processx_wait_cleanup, &amp;amp;pdata);
  return result;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;processx_wait_internal()&lt;/code&gt; is very much like &lt;code&gt;processx_wait()&lt;/code&gt; used to
be, but we need to extract the arguments from the struct at the beginning:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;SEXP processx_wait_internal(void *data) {
  struct processx_wait_data *pdata = data;
  SEXP status = pdata-&amp;gt;status;
  SEXP timeout = pdata-&amp;gt;timeout;
  int *fds = pdata-&amp;gt;fds;
  ...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now the only other thing we need to do is saving the file descriptors
in the data struct:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  if (pipe(handle-&amp;gt;waitpipe)) {
    processx__unblock_sigchld();
    error(&amp;quot;processx error: %s&amp;quot;, strerror(errno));
  }
  fds[0] = handle-&amp;gt;waitpipe[0];
  fds[1] = handle-&amp;gt;waitpipe[1];&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;fix-3-the-cleancall-package&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Fix 3: the &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; package&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;R_ExecWithCleanup()&lt;/code&gt; is a good fix to the resource cleanup problem,
but it can be verbose and error prone. It also requires that you
replace your original function with a wrapper that packs the original
function arguments into a &lt;code&gt;struct&lt;/code&gt; and an internal function that
only has a &lt;code&gt;void*&lt;/code&gt; argument.&lt;/p&gt;
&lt;p&gt;We created the &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; package to make resource cleanup easier.
This package automates wrapping your functions with &lt;code&gt;R_ExecWithCleanup()&lt;/code&gt;.
&lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; has been just published on CRAN. Here we show how to use it to
fix the &lt;a href=&#34;https://github.com/r-lib/processx#readme&#34;&gt;processx&lt;/a&gt; &lt;code&gt;$wait()&lt;/code&gt; method.&lt;/p&gt;
&lt;p&gt;To use it in your package, you need to specify &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; as a dependency,
both as &lt;code&gt;LinkingTo&lt;/code&gt; and &lt;code&gt;Imports&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;...
Imports: cleancall
LinkingTo: cleancall
...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; defines the &lt;code&gt;call_with_cleanup()&lt;/code&gt; R function and the
&lt;code&gt;r_call_on_exit()&lt;/code&gt; and &lt;code&gt;r_call_on_early_exit()&lt;/code&gt; C functions.&lt;/p&gt;
&lt;p&gt;You need to replace &lt;code&gt;.Call()&lt;/code&gt; with &lt;code&gt;call_with_cleanup()&lt;/code&gt; in your R code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cleancall::call_with_cleanup(c_processx_wait, private$status,
                               as.integer(timeout))&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In your C code, include the &lt;code&gt;cleancall.h&lt;/code&gt; header:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;#include &amp;lt;cleancall.h&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, create a cleanup function for the resource type:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;void processx__close_fd(void *ptr) {
  int *fd = ptr;
  if (*fd &amp;gt;= 0) close(*fd);
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This cleanup function closes a file descriptor. Once your resource type
has a cleanup function, you can call &lt;code&gt;r_call_on_exit()&lt;/code&gt; or
&lt;code&gt;r_call_on_early_exit()&lt;/code&gt; every time you acquire a resource of that type.
Use &lt;code&gt;r_call_on_exit()&lt;/code&gt; if the resource must be released on normal
termination as well, and &lt;code&gt;r_call_on_early_exit()&lt;/code&gt; if it must be released
on early termination only:&lt;/p&gt;
&lt;pre class=&#34;c&#34;&gt;&lt;code&gt;  if (pipe(handle-&amp;gt;waitpipe)) {
    processx__unblock_sigchld();
    error(&amp;quot;processx error: %s&amp;quot;, strerror(errno));
  }
  r_call_on_exit(processx__close_fd, handle-&amp;gt;waitpipe);
  r_call_on_exit(processx__close_fd, handle-&amp;gt;waitpipe + 1);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Typically &lt;code&gt;r_call_on_exit()&lt;/code&gt; is more convenient for temporary resources.
&lt;code&gt;r_call_on_early_exit()&lt;/code&gt; is more convenient if the C function returns a
handle (e.g. external pointer), for which it needs to allocate resources
gradually. If all resource allocations are successful, and the function
returns normally, then no cleanup is needed. However if an intermediate
step fails, you need to release the resources acquired before the failure.&lt;/p&gt;
&lt;p&gt;In does not matter much in this simple example, but it in important in
general that exit handlers are always executed in reverse order (last one in
is the first one out, LIFO). This makes it easy to build a resource
gradually. Exit handlers installed via &lt;code&gt;r_call_on_exit()&lt;/code&gt; and
&lt;code&gt;r_call_on_early_exit()&lt;/code&gt; share the same stack.&lt;/p&gt;
&lt;p&gt;We suggest that exit handlers are kept as simple and fast as possible.
In particular, errors (and other early exits) triggered from exit handlers
are not caught currently. If an exit handler exits early the others do not
run. If this is an issue, you can wrap the exit handler in &lt;code&gt;R_tryCatch()&lt;/code&gt;
(available for R 3.4.0 and later). But in general the best error handlers
do not call the R API at all.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;what-about-c&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;What about C++?&lt;/h1&gt;
&lt;p&gt;The resource cleanup problem is also present if you interface C++ code.
While &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; can be used with C++, it works best with C code,
since it follows C idioms.&lt;/p&gt;
&lt;p&gt;Using external pointers and finalizers works for C++ as well, as does
wrapping R API calls in &lt;code&gt;R_ExecWithCleanup()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Alternatively, you can wrap your R API calls in &lt;code&gt;R_tryCatch()&lt;/code&gt; (R 3.4.0
and later), or use &lt;code&gt;R_UnwindProtect()&lt;/code&gt; (R 3.5.0 and later).&lt;/p&gt;
&lt;p&gt;If your C++ code needs to support older R versions, that is more
challenging, and one possibility is to call back to R and call &lt;code&gt;tryCatch()&lt;/code&gt;
there.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;summary&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Summary&lt;/h1&gt;
&lt;p&gt;Resource cleanup in C code can be challenging, especially given that there
is not very much documentation on this topic.&lt;/p&gt;
&lt;p&gt;Hopefully this post and the &lt;a href=&#34;https://github.com/r-lib/cleancall#readme&#34;&gt;cleancall&lt;/a&gt; package will make resource
cleanup much simpler, and fewer R packages will suffer from resource
leaks in the future.&lt;/p&gt;
&lt;/div&gt;
</content>
    </item>
    
    <item>
      <title>dplyr 0.8.1</title>
      <link>https://www.tidyverse.org/blog/2019/05/dplyr-0-8-1/</link>
      <pubDate>Fri, 17 May 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/05/dplyr-0-8-1/</guid>
      <description>Introduction     We&amp;rsquo;re delighted to announce the release of dplyr 0.8.1 on CRAN 🎉 !
This is a minor release that address follow ups from the community after the release of the 0.8.0 version.
group_map() and group_modify()     Shortly after the release of 0.8.0, we were notified by several members of the community that group_map() was great, except it didn&amp;rsquo;t do what they had expected 😬.</description>
      <content>



&lt;h2 id=&#34;introduction&#34;&gt;Introduction
  &lt;a href=&#34;#introduction&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;re delighted to announce the release of dplyr 0.8.1 on CRAN 🎉 !&lt;/p&gt;
&lt;p&gt;This is a minor release that address follow ups from the community after the
release of the &lt;a href=&#34;https://www.tidyverse.org/articles/2019/02/dplyr-0-8-0/&#34;&gt;0.8.0 version&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;group_map-and-group_modify&#34;&gt;group_map() and group_modify()
  &lt;a href=&#34;#group_map-and-group_modify&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Shortly after the release of 0.8.0, we were notified by several members of the
community that &lt;code&gt;group_map()&lt;/code&gt; was great, except it didn&amp;rsquo;t do what they had expected 😬.&lt;/p&gt;
&lt;p&gt;Because the function was (and still is) marked as experimental, we allowed ourselves to
rectify the situation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The name &lt;code&gt;group_map()&lt;/code&gt; is now used for iterating on groups of grouped tibbles,
characterised by &lt;code&gt;.x&lt;/code&gt; and &lt;code&gt;.y&lt;/code&gt; as before, but making no assumptions about the return
type of each operation and combining the results in a &lt;em&gt;list&lt;/em&gt;. We can see this as
iterating, in the &lt;a href=&#34;https://purrr.tidyverse.org/reference/map.html&#34;&gt;purrr::map()&lt;/a&gt;
sense on the groups.&lt;/li&gt;
&lt;/ul&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;dplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;warn.conflicts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# a list of vectors&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Species&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;quantile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.x&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Petal.Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;probs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0.25&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.75&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [[1]]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   25%   50%   75% &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1.400 1.500 1.575 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [[2]]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  25%  50%  75% &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4.00 4.35 4.60 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [[3]]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   25%   50%   75% &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5.100 5.550 5.875&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;The behaviour we previously had was renamed &lt;code&gt;group_modify()&lt;/code&gt; to loosely echo
&lt;a href=&#34;https://purrr.tidyverse.org/reference/modify.html&#34;&gt;purrr::modify()&lt;/a&gt;. In particular,
&lt;code&gt;group_modify()&lt;/code&gt; always returns a grouped tibble, which combines the tibbles returned
by evaluating each operation with a reconstructed grouping structure.&lt;/li&gt;
&lt;/ul&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;# to use group_modify() the lambda must return a data frame&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Species&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_modify&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
     &lt;span class=&#34;nf&#34;&gt;quantile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.x&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Petal.Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;probs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0.25&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.75&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
     &lt;span class=&#34;n&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;enframe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;prob&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;quantile&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 9 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   Species [3]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   Species    prob  quantile&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt;      &amp;lt;chr&amp;gt;    &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 setosa     25%       1.4 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 setosa     50%       1.5 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 setosa     75%       1.58&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 versicolor 25%       4   &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 5 versicolor 50%       4.35&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 6 versicolor 75%       4.6 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 7 virginica  25%       5.1 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 8 virginica  50%       5.55&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 9 virginica  75%       5.88&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;attention-to-details-in-column-wise-functions&#34;&gt;Attention to details in column wise functions
  &lt;a href=&#34;#attention-to-details-in-column-wise-functions&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;As we are phasing &lt;code&gt;funs()&lt;/code&gt; out and prefer use of &lt;code&gt;purrr&lt;/code&gt;-style lambda functions
in column wise verbs, we missed a few subtleties.&lt;/p&gt;
&lt;p&gt;Specifically, lambdas can now refer to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;local variables (from the scope):&lt;/li&gt;
&lt;/ul&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;to_inch&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# the local variable `inch` can be used in the lambda&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;inch&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;0.393701&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;mutate_at&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;vars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;. &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;to_inch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Species&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 150 x 5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    Sepal.Length Sepal.Width Petal.Length Petal.Width Species&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;           &amp;lt;dbl&amp;gt;       &amp;lt;dbl&amp;gt;        &amp;lt;dbl&amp;gt;       &amp;lt;dbl&amp;gt; &amp;lt;fct&amp;gt;  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1         2.01        1.38        0.551      0.0787 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2         1.93        1.18        0.551      0.0787 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3         1.85        1.26        0.512      0.0787 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4         1.81        1.22        0.591      0.0787 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5         1.97        1.42        0.551      0.0787 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6         2.13        1.54        0.669      0.157  setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7         1.81        1.34        0.551      0.118  setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8         1.97        1.34        0.591      0.0787 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9         1.73        1.14        0.551      0.0787 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10         1.93        1.22        0.591      0.0394 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 140 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;other columns of the data (from the data mask):&lt;/li&gt;
&lt;/ul&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;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate_at&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;vars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;starts_with&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Sepal&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)),&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;. &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Petal.Width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 150 x 5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    Sepal.Length Sepal.Width Petal.Length Petal.Width Species&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;           &amp;lt;dbl&amp;gt;       &amp;lt;dbl&amp;gt;        &amp;lt;dbl&amp;gt;       &amp;lt;dbl&amp;gt; &amp;lt;fct&amp;gt;  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1         25.5       17.5           1.4         0.2 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2         24.5       15             1.4         0.2 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3         23.5       16             1.3         0.2 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4         23.0       15.5           1.5         0.2 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5         25         18             1.4         0.2 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6         13.5        9.75          1.7         0.4 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7         15.3       11.3           1.4         0.3 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8         25         17             1.5         0.2 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9         22         14.5           1.4         0.2 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10         49         31             1.5         0.1 setosa &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 140 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;thanks&#34;&gt;Thanks
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to all contributors for this release.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/abalter&#34;&gt;@abalter&lt;/a&gt;, &lt;a href=&#34;https://github.com/ambevill&#34;&gt;@ambevill&lt;/a&gt;, &lt;a href=&#34;https://github.com/amitusa17&#34;&gt;@amitusa17&lt;/a&gt;, &lt;a href=&#34;https://github.com/AntoineHffmnn&#34;&gt;@AntoineHffmnn&lt;/a&gt;, &lt;a href=&#34;https://github.com/anuj2054&#34;&gt;@anuj2054&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/behrman&#34;&gt;@behrman&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/burchill&#34;&gt;@burchill&lt;/a&gt;, &lt;a href=&#34;https://github.com/cgrandin&#34;&gt;@cgrandin&lt;/a&gt;, &lt;a href=&#34;https://github.com/clemenshug&#34;&gt;@clemenshug&lt;/a&gt;, &lt;a href=&#34;https://github.com/codetrainee&#34;&gt;@codetrainee&lt;/a&gt;, &lt;a href=&#34;https://github.com/ColinFay&#34;&gt;@ColinFay&lt;/a&gt;, &lt;a href=&#34;https://github.com/dan-reznik&#34;&gt;@dan-reznik&lt;/a&gt;, &lt;a href=&#34;https://github.com/davidsjoberg&#34;&gt;@davidsjoberg&lt;/a&gt;, &lt;a href=&#34;https://github.com/DesiQuintans&#34;&gt;@DesiQuintans&lt;/a&gt;, &lt;a href=&#34;https://github.com/dirkschumacher&#34;&gt;@dirkschumacher&lt;/a&gt;, &lt;a href=&#34;https://github.com/earowang&#34;&gt;@earowang&lt;/a&gt;, &lt;a href=&#34;https://github.com/echasnovski&#34;&gt;@echasnovski&lt;/a&gt;, &lt;a href=&#34;https://github.com/eipi10&#34;&gt;@eipi10&lt;/a&gt;, &lt;a href=&#34;https://github.com/grabear&#34;&gt;@grabear&lt;/a&gt;, &lt;a href=&#34;https://github.com/grandtiger&#34;&gt;@grandtiger&lt;/a&gt;, &lt;a href=&#34;https://github.com/gregorp&#34;&gt;@gregorp&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hanyroze&#34;&gt;@hanyroze&lt;/a&gt;, &lt;a href=&#34;https://github.com/hidekoji&#34;&gt;@hidekoji&lt;/a&gt;, &lt;a href=&#34;https://github.com/huftis&#34;&gt;@huftis&lt;/a&gt;, &lt;a href=&#34;https://github.com/iago-pssjd&#34;&gt;@iago-pssjd&lt;/a&gt;, &lt;a href=&#34;https://github.com/javierluraschi&#34;&gt;@javierluraschi&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jgellar&#34;&gt;@jgellar&lt;/a&gt;, &lt;a href=&#34;https://github.com/jhrcook&#34;&gt;@jhrcook&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/joel23888&#34;&gt;@joel23888&lt;/a&gt;, &lt;a href=&#34;https://github.com/JohnMount&#34;&gt;@JohnMount&lt;/a&gt;, &lt;a href=&#34;https://github.com/johnmous&#34;&gt;@johnmous&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonathan-g&#34;&gt;@jonathan-g&lt;/a&gt;, &lt;a href=&#34;https://github.com/jwbeck97&#34;&gt;@jwbeck97&lt;/a&gt;, &lt;a href=&#34;https://github.com/jzadra&#34;&gt;@jzadra&lt;/a&gt;, &lt;a href=&#34;https://github.com/karimn&#34;&gt;@karimn&lt;/a&gt;, &lt;a href=&#34;https://github.com/kendonB&#34;&gt;@kendonB&lt;/a&gt;, &lt;a href=&#34;https://github.com/koncina&#34;&gt;@koncina&lt;/a&gt;, &lt;a href=&#34;https://github.com/kperkins&#34;&gt;@kperkins&lt;/a&gt;, &lt;a href=&#34;https://github.com/kputschko&#34;&gt;@kputschko&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/kyzphong&#34;&gt;@kyzphong&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/llrs&#34;&gt;@llrs&lt;/a&gt;, &lt;a href=&#34;https://github.com/mariodejung&#34;&gt;@mariodejung&lt;/a&gt;, &lt;a href=&#34;https://github.com/MichaelAdolph&#34;&gt;@MichaelAdolph&lt;/a&gt;, &lt;a href=&#34;https://github.com/michaelwhammer&#34;&gt;@michaelwhammer&lt;/a&gt;, &lt;a href=&#34;https://github.com/MilesMcBain&#34;&gt;@MilesMcBain&lt;/a&gt;, &lt;a href=&#34;https://github.com/mjherold&#34;&gt;@mjherold&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/msberends&#34;&gt;@msberends&lt;/a&gt;, &lt;a href=&#34;https://github.com/mvkorpel&#34;&gt;@mvkorpel&lt;/a&gt;, &lt;a href=&#34;https://github.com/nathancday&#34;&gt;@nathancday&lt;/a&gt;, &lt;a href=&#34;https://github.com/nicokuz&#34;&gt;@nicokuz&lt;/a&gt;, &lt;a href=&#34;https://github.com/nolistic&#34;&gt;@nolistic&lt;/a&gt;, &lt;a href=&#34;https://github.com/oscci&#34;&gt;@oscci&lt;/a&gt;, &lt;a href=&#34;https://github.com/paulponcet&#34;&gt;@paulponcet&lt;/a&gt;, &lt;a href=&#34;https://github.com/PhilippRuchser&#34;&gt;@PhilippRuchser&lt;/a&gt;, &lt;a href=&#34;https://github.com/philstraforelli&#34;&gt;@philstraforelli&lt;/a&gt;, &lt;a href=&#34;https://github.com/psychometrician&#34;&gt;@psychometrician&lt;/a&gt;, &lt;a href=&#34;https://github.com/Ranonymous&#34;&gt;@Ranonymous&lt;/a&gt;, &lt;a href=&#34;https://github.com/rinebob&#34;&gt;@rinebob&lt;/a&gt;, &lt;a href=&#34;https://github.com/romagnolid&#34;&gt;@romagnolid&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/rvg02010&#34;&gt;@rvg02010&lt;/a&gt;, &lt;a href=&#34;https://github.com/slyrus&#34;&gt;@slyrus&lt;/a&gt;, &lt;a href=&#34;https://github.com/snp&#34;&gt;@snp&lt;/a&gt;, &lt;a href=&#34;https://github.com/sowla&#34;&gt;@sowla&lt;/a&gt;, &lt;a href=&#34;https://github.com/ThiAmm&#34;&gt;@ThiAmm&lt;/a&gt;, &lt;a href=&#34;https://github.com/thothal&#34;&gt;@thothal&lt;/a&gt;, &lt;a href=&#34;https://github.com/wfmackey&#34;&gt;@wfmackey&lt;/a&gt;, &lt;a href=&#34;https://github.com/will458&#34;&gt;@will458&lt;/a&gt;, &lt;a href=&#34;https://github.com/wkdavis&#34;&gt;@wkdavis&lt;/a&gt;, &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;, &lt;a href=&#34;https://github.com/ZahraEconomist&#34;&gt;@ZahraEconomist&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zooman&#34;&gt;@zooman&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>forcats 0.4.0</title>
      <link>https://www.tidyverse.org/blog/2019/05/forcats-0-4-0/</link>
      <pubDate>Fri, 10 May 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/05/forcats-0-4-0/</guid>
      <description>We are pleased to announce that forcats 0.4.0 is now on CRAN. The forcats package provides a suite of useful tools that solve common problems with factors in R. This version benefited from the hard work of contributors new and old at our first tidyverse dev day. For a complete set of changes, please see the release notes.
To install the latest version, run:
install.packages(&amp;#34;forcats&amp;#34;) As always, attach the package with:</description>
      <content>&lt;p&gt;We are pleased to announce that &lt;a href=&#34;http://forcats.tidyverse.org/&#34;&gt;forcats 0.4.0&lt;/a&gt; is now on CRAN.
The forcats package provides a suite of useful tools that solve common problems with factors in R. This version benefited from the hard work of contributors new and old at our first &lt;a href=&#34;https://www.tidyverse.org/articles/2018/11/tidyverse-developer-day-2019/&#34;&gt;tidyverse dev day&lt;/a&gt;.  For a complete set of changes, please see the &lt;a href=&#34;https://github.com/tidyverse/forcats/releases/tag/v0.4.0&#34;&gt;release notes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To install the latest version, run:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;forcats&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;p&gt;As always, attach the package with:&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;forcats&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;new-functions&#34;&gt;New functions
  &lt;a href=&#34;#new-functions&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://forcats.tidyverse.org/reference/fct_cross.html&#34;&gt;&lt;code&gt;fct_cross()&lt;/code&gt;&lt;/a&gt; creates a new factor containing the combined levels from two or more input factors, similar to &lt;code&gt;base::interaction()&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;n&#34;&gt;fruit&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;apple&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;kiwi&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;apple&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;apple&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;colour&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;green&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;green&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;red&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;green&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;fct_cross&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fruit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;colour&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] apple:green kiwi:green  apple:red   apple:green&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Levels: apple:green apple:red kiwi:green&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&#34;https://forcats.tidyverse.org/reference/fct_lump.html&#34;&gt;&lt;code&gt;fct_lump_min()&lt;/code&gt;&lt;/a&gt; preserves levels that appear at least &lt;code&gt;min&lt;/code&gt; times (can also be used with the &lt;code&gt;w&lt;/code&gt; weighted 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;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;letters&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;[rpois&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;50&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;fct_lump_min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;min&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [1] Other b     Other b     Other Other Other b     Other Other b    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [12] Other Other Other b     Other b     Other Other b     b     Other&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [23] Other Other b     b     Other Other Other Other Other b     Other&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [34] Other Other b     Other Other Other Other Other Other Other Other&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [45] Other b     Other b    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Levels: b Other&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&#34;https://forcats.tidyverse.org/reference/fct_match.html&#34;&gt;&lt;code&gt;fct_match()&lt;/code&gt;&lt;/a&gt; tests for the presence of levels in a factor, providing a safer alternative to &lt;code&gt;%in%&lt;/code&gt; by throwing an error when there are unexpected levels.&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;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;fct_match&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gss_cat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;marital&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Married&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Divorced&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FALSE  TRUE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7983 13500&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gss_cat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;marital&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%in%&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Maried&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Davorced&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FALSE &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 21483&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;table&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;fct_match&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gss_cat&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;marital&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Maried&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Davorced&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Levels not present in factor: &amp;#34;Maried&amp;#34;, &amp;#34;Davorced&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;other-improvements&#34;&gt;Other improvements
  &lt;a href=&#34;#other-improvements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://forcats.tidyverse.org/reference/fct_relevel.html&#34;&gt;&lt;code&gt;fct_relevel()&lt;/code&gt;&lt;/a&gt; can now relevel factors using a function that is passed the current levels.&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;f&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;c&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;d&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;levels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;c&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;d&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;fct_relevel&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sort&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] a b c d&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Levels: a b c d&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;fct_relevel&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rev&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] a b c d&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Levels: a d c b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://forcats.tidyverse.org/dev/reference/as_factor.html&#34;&gt;&lt;code&gt;as_factor()&lt;/code&gt;&lt;/a&gt; now has a numeric method which orders factors in numeric order, unlike the other methods which default to order of appearance.&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;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1.1&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;11&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;2.2&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;22&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;as_factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] 1.1 11  2.2 22 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Levels: 1.1 11 2.2 22&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;as.numeric&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;as_factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] 1.1 11  2.2 22 &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Levels: 1.1 2.2 11 22&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://forcats.tidyverse.org/dev/reference/fct_inorder.html&#34;&gt;&lt;code&gt;fct_inseq()&lt;/code&gt;&lt;/a&gt; reorders labels numerically, when possible.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks to Emily Robinson, forcats also has a new &lt;a href=&#34;https://forcats.tidyverse.org/articles/forcats.html&#34;&gt;introductory vignette&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;re grateful for the 35 people who contributed to this release: &lt;a href=&#34;https://github.com/ahaque-utd&#34;&gt;@ahaque-utd&lt;/a&gt;, &lt;a href=&#34;https://github.com/AmeliaMN&#34;&gt;@AmeliaMN&lt;/a&gt;, &lt;a href=&#34;https://github.com/ashiklom&#34;&gt;@ashiklom&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/brianwdavis&#34;&gt;@brianwdavis&lt;/a&gt;, &lt;a href=&#34;https://github.com/corybrunson&#34;&gt;@corybrunson&lt;/a&gt;, &lt;a href=&#34;https://github.com/dalewsteele&#34;&gt;@dalewsteele&lt;/a&gt;, &lt;a href=&#34;https://github.com/ewenharrison&#34;&gt;@ewenharrison&lt;/a&gt;, &lt;a href=&#34;https://github.com/grayskripko&#34;&gt;@grayskripko&lt;/a&gt;, &lt;a href=&#34;https://github.com/gtm19&#34;&gt;@gtm19&lt;/a&gt;, &lt;a href=&#34;https://github.com/hack-r&#34;&gt;@hack-r&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/huftis&#34;&gt;@huftis&lt;/a&gt;, &lt;a href=&#34;https://github.com/isteves&#34;&gt;@isteves&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonocarroll&#34;&gt;@jonocarroll&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrosen48&#34;&gt;@jrosen48&lt;/a&gt;, &lt;a href=&#34;https://github.com/jthomasmock&#34;&gt;@jthomasmock&lt;/a&gt;, &lt;a href=&#34;https://github.com/kbodwin&#34;&gt;@kbodwin&lt;/a&gt;, &lt;a href=&#34;https://github.com/mdjeric&#34;&gt;@mdjeric&lt;/a&gt;, &lt;a href=&#34;https://github.com/orchid00&#34;&gt;@orchid00&lt;/a&gt;, &lt;a href=&#34;https://github.com/richierocks&#34;&gt;@richierocks&lt;/a&gt;, &lt;a href=&#34;https://github.com/robinsones&#34;&gt;@robinsones&lt;/a&gt;, &lt;a href=&#34;https://github.com/rosedu1&#34;&gt;@rosedu1&lt;/a&gt;, &lt;a href=&#34;https://github.com/RoyalTS&#34;&gt;@RoyalTS&lt;/a&gt;, &lt;a href=&#34;https://github.com/russHyde&#34;&gt;@russHyde&lt;/a&gt;, &lt;a href=&#34;https://github.com/Ryo-N7&#34;&gt;@Ryo-N7&lt;/a&gt;, &lt;a href=&#34;https://github.com/s-fleck&#34;&gt;@s-fleck&lt;/a&gt;, &lt;a href=&#34;https://github.com/seaaan&#34;&gt;@seaaan&lt;/a&gt;, &lt;a href=&#34;https://github.com/spedygiorgio&#34;&gt;@spedygiorgio&lt;/a&gt;, &lt;a href=&#34;https://github.com/tslumley&#34;&gt;@tslumley&lt;/a&gt;, &lt;a href=&#34;https://github.com/xuhuizhang&#34;&gt;@xuhuizhang&lt;/a&gt;, &lt;a href=&#34;https://github.com/zhiiiyang&#34;&gt;@zhiiiyang&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zx8754&#34;&gt;@zx8754&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>vroom 1.0.0</title>
      <link>https://www.tidyverse.org/blog/2019/05/vroom-1-0-0/</link>
      <pubDate>Tue, 07 May 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/05/vroom-1-0-0/</guid>
      <description>h2 code { font-size: 1em; }   I&amp;rsquo;m excited to announce that vroom 1.0.0 is now available on CRAN!
vroom reads rectangular data, such as comma separated (csv), tab separated (tsv) or fixed width files (fwf) into R. It performs similar roles to functions like readr::read_csv(), data.table::fread() or read.csv(). But for many datasets vroom::vroom() can read them much, much faster (hence the name).
The main reason vroom can be faster is because character data is read from the file lazily; you only pay for the data you use.</description>
      <content>&lt;html&gt;
&lt;style&gt;
h2 code {
    font-size: 1em;
}
&lt;/style&gt;
&lt;/html&gt;
&lt;p&gt;I&amp;rsquo;m excited to announce that &lt;a href=&#34;http://vroom.r-lib.org&#34;&gt;vroom 1.0.0&lt;/a&gt; is now
available on CRAN!&lt;/p&gt;
&lt;p&gt;vroom reads rectangular data, such as comma separated
(csv), tab separated (tsv) or fixed width files (fwf) into R. It performs
similar roles to functions like &lt;a href=&#34;http://readr.r-lib.org&#34;&gt;&lt;code&gt;readr::read_csv()&lt;/code&gt;&lt;/a&gt;,
&lt;a href=&#34;http://r-datatable.com&#34;&gt;&lt;code&gt;data.table::fread()&lt;/code&gt;&lt;/a&gt; or &lt;code&gt;read.csv()&lt;/code&gt;. But for many
datasets &lt;code&gt;vroom::vroom()&lt;/code&gt; can read them much, much faster (hence the name).&lt;/p&gt;
&lt;p&gt;The main reason vroom can be faster is because character data is read from the
file lazily; you only pay for the data you use. This lazy access is done
automatically, so no changes to your R data-manipulation code are needed.&lt;/p&gt;
&lt;p&gt;vroom also provides efficient, multi-threaded writing that is multiple times
faster on most inputs than the &lt;code&gt;readr::write_*()&lt;/code&gt; functions.&lt;/p&gt;
&lt;p&gt;Install vroom with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;vroom&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;p&gt;The best way to get acquainted with the package is the &lt;a href=&#34;http://vroom.r-lib.org/articles/vroom.html&#34;&gt;getting
started&lt;/a&gt; vignette.&lt;/p&gt;




&lt;h2 id=&#34;vroom-vs-readr&#34;&gt;vroom vs readr
  &lt;a href=&#34;#vroom-vs-readr&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;What does the release of vroom mean for readr? For now we plan
to let the two packages evolve separately, but likely we will unite the
packages in the future. One disadvantage to vroom&amp;rsquo;s lazy reading is certain
data problems can&amp;rsquo;t be reported up front, so how best to unify them requires
some thought.&lt;/p&gt;




&lt;h2 id=&#34;reading-delimited-files&#34;&gt;Reading delimited files
  &lt;a href=&#34;#reading-delimited-files&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Compared to readr, the first difference you may note is you use only one
function to read the files,
&lt;a href=&#34;http://vroom.r-lib.org/reference/vroom.html&#34;&gt;&lt;code&gt;vroom()&lt;/code&gt;&lt;/a&gt;. This is because
&lt;code&gt;vroom()&lt;/code&gt; guesses the delimiter of the file automatically based on the first
few lines (this feature is inspired by a similar feature in
&lt;code&gt;data.table::fread()&lt;/code&gt;). This works well most of the time, but may fail to guess
properly in some cases. The &lt;code&gt;delim&lt;/code&gt; argument can be used to specify the
delimiter of the file explicitly.&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;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 336,776&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr  [ 4]: carrier, tailnum, origin, dest&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl  [14]: year, month, day, dep_time, sched_dep_time, dep_delay, arr_time, sched_arr...&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dttm [ 1]: time_hour&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The summary message after reading also differs from readr. We hope this output
gives a more informative indication as to whether the types of your columns are
being guessed properly. However you can still retrieve and print the full
column specification with &lt;a href=&#34;http://vroom.r-lib.org/reference/spec.html&#34;&gt;&lt;code&gt;spec()&lt;/code&gt;&lt;/a&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;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; cols(&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   year = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   month = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   day = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   dep_time = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   sched_dep_time = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   dep_delay = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   arr_time = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   sched_arr_time = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   arr_delay = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   carrier = col_character(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   flight = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   tailnum = col_character(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   origin = col_character(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   dest = col_character(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   air_time = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   distance = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   hour = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   minute = col_double(),&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   time_hour = col_datetime(format = &amp;#34;&amp;#34;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; )&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The message will be disabled if you supply a column specification to &lt;code&gt;col_types&lt;/code&gt; when reading.&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;s&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;spec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_types&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;reading-multiple-files&#34;&gt;Reading multiple files
  &lt;a href=&#34;#reading-multiple-files&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;One feature new to vroom is built-in support for reading sets of files with the
same columns into one table. Just pass the filenames to be read directly to
&lt;code&gt;vroom()&lt;/code&gt;. Imagine we have a directory of files containing the flights data, where
each file corresponds to a single airline.&lt;/p&gt;
&lt;p&gt;Then, we can efficiently read all of the files into one tibble by passing a
vector of the filenames directly to &lt;code&gt;vroom()&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;n&#34;&gt;files&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fs&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;dir_ls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;glob&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;flights_*tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;files&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; flights_9E.tsv flights_AA.tsv flights_AS.tsv flights_B6.tsv flights_DL.tsv &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; flights_EV.tsv flights_F9.tsv flights_FL.tsv flights_HA.tsv flights_MQ.tsv &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; flights_OO.tsv flights_UA.tsv flights_US.tsv flights_VX.tsv flights_WN.tsv &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; flights_YV.tsv&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;files&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 336,776&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr  [ 4]: carrier, tailnum, origin, dest&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl  [14]: year, month, day, dep_time, sched_dep_time, dep_delay, arr_time, sched_arr...&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dttm [ 1]: time_hour&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;reading-and-writing-compressed-files&#34;&gt;Reading and writing compressed files
  &lt;a href=&#34;#reading-and-writing-compressed-files&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Just like readr, vroom automatically reads and writes zip, gzip, bz2 and xz compressed
files with the standard file extensions.&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;vroom_write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;flights&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv.gz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Check file sizes to show file is compressed&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;fs&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;file_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv.gz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 29.62M  7.87M&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Read the file back in&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv.gz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 336,776&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr  [ 4]: carrier, tailnum, origin, dest&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl  [14]: year, month, day, dep_time, sched_dep_time, dep_delay, arr_time, sched_arr...&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dttm [ 1]: time_hour&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1 id=&#34;reading-remote-files&#34;&gt;Reading remote files
  &lt;a href=&#34;#reading-remote-files&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h1&gt;&lt;p&gt;vroom can also read files from the internet as well by passing the URL of the file to &lt;code&gt;vroom()&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;n&#34;&gt;file&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;https://raw.githubusercontent.com/r-lib/vroom/master/inst/extdata/mtcars.csv&amp;#34;&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 32&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 12&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr [ 1]: model&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl [11]: mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It can even read gzipped files from the internet (although currently not the other compressed formats).&lt;/p&gt;




&lt;h2 id=&#34;reading-and-writing-from-pipe-connections&#34;&gt;Reading and writing from pipe connections
  &lt;a href=&#34;#reading-and-writing-from-pipe-connections&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;vroom provides efficient input and output from &lt;code&gt;pipe()&lt;/code&gt; connections.&lt;/p&gt;
&lt;p&gt;This is useful for doing things like pre-filtering large inputs with command line tools like &lt;a href=&#34;https://en.wikipedia.org/wiki/Grep&#34;&gt;grep&lt;/a&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;# Return only flights on United Airlines&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;pipe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;grep -w UA flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_names&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&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;flights&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 58,665&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr  [ 4]: carrier, tailnum, origin, dest&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl  [14]: year, month, day, dep_time, sched_dep_time, dep_delay, arr_time, sched_arr...&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dttm [ 1]: time_hour&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or using multi-threaded compression programs like
&lt;a href=&#34;https://zlib.net/pigz/&#34;&gt;pigz&lt;/a&gt;, which can greatly reduce the time to write compressed
files.&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;bench&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;workout&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;vroom_write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;flights&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv.gz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;vroom_write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;flights&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;pipe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;pigz &amp;gt; flights.tsv.gz&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 2 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   exprs                                                process     real&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;bch:expr&amp;gt;                                          &amp;lt;bch:tm&amp;gt; &amp;lt;bch:tm&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 vroom_write(flights, &amp;#34;flights.tsv.gz&amp;#34;)                  3.5s    2.69s&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 vroom_write(flights, pipe(&amp;#34;pigz &amp;gt; flights.tsv.gz&amp;#34;))    1.54s 975.09ms&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;column-selection&#34;&gt;Column selection
  &lt;a href=&#34;#column-selection&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;code&gt;vroom&lt;/code&gt; introduces a new argument, &lt;code&gt;col_select&lt;/code&gt;, which makes selecting columns to
keep (or omit) more straightforward.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;col_select&lt;/code&gt; uses the same interface as &lt;code&gt;dplyr::select()&lt;/code&gt;, so you can do flexible selection operations.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select with the column names&lt;/li&gt;
&lt;/ul&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;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_select&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;year&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;flight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tailnum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 336,776&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr [1]: tailnum&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl [2]: year, flight&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Drop columns by name&lt;/li&gt;
&lt;/ul&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;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_select&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dep_time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;air_time&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;time_hour&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 336,776&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 13&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr [4]: carrier, tailnum, origin, dest&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl [9]: year, month, day, sched_dep_time, dep_delay, arr_time, sched_arr_time, arr...&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Use the selection helpers&lt;/li&gt;
&lt;/ul&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;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_select&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;ends_with&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;time&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 336,776&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl [5]: dep_time, sched_dep_time, arr_time, sched_arr_time, air_time&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Or rename columns&lt;/li&gt;
&lt;/ul&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;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_select&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;plane&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tailnum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;everything&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Observations: 336,776&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Variables: 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; chr  [ 4]: carrier, tailnum, origin, dest&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dbl  [14]: year, month, day, dep_time, sched_dep_time, dep_delay, arr_time, sched_arr...&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; dttm [ 1]: time_hour&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Call `spec()` for a copy-pastable column specification&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Specify the column types with `col_types` to quiet this message&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 336,776 x 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    plane  year month   day dep_time sched_dep_time dep_delay arr_time&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;chr&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;          &amp;lt;dbl&amp;gt;     &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 N142…  2013     1     1      517            515         2      830&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 N242…  2013     1     1      533            529         4      850&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 N619…  2013     1     1      542            540         2      923&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 N804…  2013     1     1      544            545        -1     1004&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 N668…  2013     1     1      554            600        -6      812&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 N394…  2013     1     1      554            558        -4      740&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 N516…  2013     1     1      555            600        -5      913&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 N829…  2013     1     1      557            600        -3      709&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 N593…  2013     1     1      557            600        -3      838&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 N3AL…  2013     1     1      558            600        -2      753&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 336,766 more rows, and 11 more variables: sched_arr_time &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   arr_delay &amp;lt;dbl&amp;gt;, carrier &amp;lt;chr&amp;gt;, flight &amp;lt;dbl&amp;gt;, origin &amp;lt;chr&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   dest &amp;lt;chr&amp;gt;, air_time &amp;lt;dbl&amp;gt;, distance &amp;lt;dbl&amp;gt;, hour &amp;lt;dbl&amp;gt;, minute &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   time_hour &amp;lt;dttm&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;name-repair&#34;&gt;Name repair
  &lt;a href=&#34;#name-repair&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Often the names of columns in the original dataset are not ideal to work with.
&lt;code&gt;vroom()&lt;/code&gt; uses the same &lt;a href=&#34;https://www.tidyverse.org/articles/2019/01/tibble-2.0.1/#name-repair&#34;&gt;.name_repair&lt;/a&gt;
argument as tibble, so you can use one of the default name repair strategies or
provide a custom function. A great approach is to use the
&lt;a href=&#34;http://sfirke.github.io/janitor/&#34;&gt;janitor&lt;/a&gt; &lt;code&gt;make_clean_names()&lt;/code&gt; function as the input.&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;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;janitor&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;make_clean_names&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 336,776 x 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     year month   day dep_time sched_dep_time dep_delay arr_time&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;          &amp;lt;dbl&amp;gt;     &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1  2013     1     1      517            515         2      830&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2  2013     1     1      533            529         4      850&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3  2013     1     1      542            540         2      923&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4  2013     1     1      544            545        -1     1004&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5  2013     1     1      554            600        -6      812&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6  2013     1     1      554            558        -4      740&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7  2013     1     1      555            600        -5      913&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8  2013     1     1      557            600        -3      709&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9  2013     1     1      557            600        -3      838&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10  2013     1     1      558            600        -2      753&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 336,766 more rows, and 12 more variables: sched_arr_time &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   arr_delay &amp;lt;dbl&amp;gt;, carrier &amp;lt;chr&amp;gt;, flight &amp;lt;dbl&amp;gt;, tailnum &amp;lt;chr&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   origin &amp;lt;chr&amp;gt;, dest &amp;lt;chr&amp;gt;, air_time &amp;lt;dbl&amp;gt;, distance &amp;lt;dbl&amp;gt;, hour &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   minute &amp;lt;dbl&amp;gt;, time_hour &amp;lt;dttm&amp;gt;&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;janitor&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;make_clean_names&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;.,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;lower_camel&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 336,776 x 19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;     year month   day depTime schedDepTime depDelay arrTime schedArrTime&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt; &amp;lt;dbl&amp;gt;   &amp;lt;dbl&amp;gt;        &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;   &amp;lt;dbl&amp;gt;        &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1  2013     1     1     517          515        2     830          819&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2  2013     1     1     533          529        4     850          830&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3  2013     1     1     542          540        2     923          850&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4  2013     1     1     544          545       -1    1004         1022&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5  2013     1     1     554          600       -6     812          837&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6  2013     1     1     554          558       -4     740          728&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7  2013     1     1     555          600       -5     913          854&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8  2013     1     1     557          600       -3     709          723&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9  2013     1     1     557          600       -3     838          846&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10  2013     1     1     558          600       -2     753          745&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 336,766 more rows, and 11 more variables: arrDelay &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   carrier &amp;lt;chr&amp;gt;, flight &amp;lt;dbl&amp;gt;, tailnum &amp;lt;chr&amp;gt;, origin &amp;lt;chr&amp;gt;, dest &amp;lt;chr&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   airTime &amp;lt;dbl&amp;gt;, distance &amp;lt;dbl&amp;gt;, hour &amp;lt;dbl&amp;gt;, minute &amp;lt;dbl&amp;gt;,&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; #   timeHour &amp;lt;dttm&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;column-types&#34;&gt;Column types
  &lt;a href=&#34;#column-types&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Like readr, vroom guesses the data types of columns as they are read. readr
simply used the first &lt;code&gt;n&lt;/code&gt; rows of data, vroom uses an improved heuristic of
looking at data throughout the file, which should improve guessing accuracy.
However if the guessing fails it can be necessary to change the type of one or
more columns.&lt;/p&gt;
&lt;p&gt;The available specifications are: (with single letter abbreviations in quotes)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;col_logical()&lt;/code&gt; &amp;lsquo;l&amp;rsquo;, containing only &lt;code&gt;T&lt;/code&gt;, &lt;code&gt;F&lt;/code&gt;, &lt;code&gt;TRUE&lt;/code&gt;, &lt;code&gt;FALSE&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt; or &lt;code&gt;0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_integer()&lt;/code&gt; &amp;lsquo;i&amp;rsquo;, integer values.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_double()&lt;/code&gt; &amp;lsquo;d&amp;rsquo;, floating point values.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_number()&lt;/code&gt; [n], numbers containing the &lt;code&gt;grouping_mark&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_date(format = &amp;quot;&amp;quot;)&lt;/code&gt; [D]: with the locale&amp;rsquo;s &lt;code&gt;date_format&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_time(format = &amp;quot;&amp;quot;)&lt;/code&gt; [t]: with the locale&amp;rsquo;s &lt;code&gt;time_format&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_datetime(format = &amp;quot;&amp;quot;)&lt;/code&gt; [T]: ISO8601 date times.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_factor(levels, ordered)&lt;/code&gt; &amp;lsquo;f&amp;rsquo;, a fixed set of values.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_character()&lt;/code&gt; &amp;lsquo;c&amp;rsquo;, everything else.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_skip()&lt;/code&gt; &amp;lsquo;_, -&#39;, don&amp;rsquo;t import this column.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;col_guess()&lt;/code&gt; &amp;lsquo;?&#39;, parse using the &amp;ldquo;best&amp;rdquo; type based on the input.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can tell vroom what columns to use with the &lt;code&gt;col_types()&lt;/code&gt; argument in a number of ways.&lt;/p&gt;
&lt;p&gt;If you only need to override a single column, the most concise way is to use a named vector.&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;# read the &amp;#39;year&amp;#39; column as an integer&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_types&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;i&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# also skip reading the &amp;#39;time_hour&amp;#39; column&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_types&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;i&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;time_hour&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;c1&#34;&gt;# also read the carrier as a factor&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;col_types&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;i&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;time_hour&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;carrier&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;f&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;p&gt;However, you can also use the &lt;code&gt;col_*()&lt;/code&gt; functions in a list.&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;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;col_types&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;col_integer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;time_hour&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;col_skip&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;carrier&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;col_factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is most useful when a column type needs additional information, such as
for categorical data when you know all of the levels of a factor.&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;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;vroom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;flights.tsv&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;col_types&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dest&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;col_factor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;levels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;EWR&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;JFK&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;LGA&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;speed&#34;&gt;Speed
  &lt;a href=&#34;#speed&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;vroom is fast, but how fast?
We benchmarked vroom using a real-world dataset of taxi-trip data, with
14.7 million rows, 11 columns. It contains a mix of numeric and text data, and has a
total file size of 1.55 GB.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#&amp;gt; Observations: 14,776,615
#&amp;gt; Variables: 11
#&amp;gt; $ medallion       &amp;lt;chr&amp;gt; &amp;quot;89D227B655E5C82AECF13C3F540D4CF4&amp;quot;, &amp;quot;0BD7C8F5B...
#&amp;gt; $ hack_license    &amp;lt;chr&amp;gt; &amp;quot;BA96DE419E711691B9445D6A6307C170&amp;quot;, &amp;quot;9FD8F69F0...
#&amp;gt; $ vendor_id       &amp;lt;chr&amp;gt; &amp;quot;CMT&amp;quot;, &amp;quot;CMT&amp;quot;, &amp;quot;CMT&amp;quot;, &amp;quot;CMT&amp;quot;, &amp;quot;CMT&amp;quot;, &amp;quot;CMT&amp;quot;, &amp;quot;CMT...
#&amp;gt; $ pickup_datetime &amp;lt;chr&amp;gt; &amp;quot;2013-01-01 15:11:48&amp;quot;, &amp;quot;2013-01-06 00:18:35&amp;quot;, ...
#&amp;gt; $ payment_type    &amp;lt;chr&amp;gt; &amp;quot;CSH&amp;quot;, &amp;quot;CSH&amp;quot;, &amp;quot;CSH&amp;quot;, &amp;quot;CSH&amp;quot;, &amp;quot;CSH&amp;quot;, &amp;quot;CSH&amp;quot;, &amp;quot;CSH...
#&amp;gt; $ fare_amount     &amp;lt;dbl&amp;gt; 6.5, 6.0, 5.5, 5.0, 9.5, 9.5, 6.0, 34.0, 5.5, ...
#&amp;gt; $ surcharge       &amp;lt;dbl&amp;gt; 0.0, 0.5, 1.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0, 0...
#&amp;gt; $ mta_tax         &amp;lt;dbl&amp;gt; 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0...
#&amp;gt; $ tip_amount      &amp;lt;int&amp;gt; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
#&amp;gt; $ tolls_amount    &amp;lt;dbl&amp;gt; 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.8, 0.0, 0...
#&amp;gt; $ total_amount    &amp;lt;dbl&amp;gt; 7.0, 7.0, 7.0, 6.0, 10.5, 10.0, 6.5, 39.3, 7.0...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We performed a series of simple manipulations with each approach.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reading the data&lt;/li&gt;
&lt;li&gt;&lt;code&gt;print()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;head()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tail()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Sampling 100 random rows&lt;/li&gt;
&lt;li&gt;Filtering for &amp;ldquo;UNK&amp;rdquo; payment, this is 6434 rows (0.0435% of total).&lt;/li&gt;
&lt;li&gt;Summarizing the mean fare amount per payment type.&lt;/li&gt;
&lt;/ul&gt;
&lt;style&gt;
td,th {
  padding: 0.4em;
}
thead {
border-top: 1px solid #aaa;
border-bottom: 1px solid #aaa;
}
table {
margin-left: auto;
margin-right: auto;
border-bottom: 1px solid #aaa;
}
&lt;/style&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/articles/2019-05-vroom-1-0-0_files/figure-html/benchmark_plot-1.png&#34; width=&#34;960&#34; /&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th align=&#34;right&#34;&gt;package&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;read&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;print&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;head&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;tail&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;sample&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;filter&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;summarise&lt;/th&gt;
&lt;th align=&#34;right&#34;&gt;total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td align=&#34;right&#34;&gt;read.delim&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1m 21.5s&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;6ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;315ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;764ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1m 22.6s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;right&#34;&gt;readr&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;33.1s&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;90ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;202ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;825ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;34.2s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;right&#34;&gt;data.table&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;15.7s&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;13ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;129ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;394ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;16.3s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align=&#34;right&#34;&gt;vroom&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;3.6s&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;86ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;2ms&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.4s&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;1.9s&lt;/td&gt;
&lt;td align=&#34;right&#34;&gt;7s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br/&gt;
&lt;p&gt;Some things to note in the results. The initial reading is much faster in vroom
than any other method, and most of the manipulations, such as &lt;code&gt;print()&lt;/code&gt;,
&lt;code&gt;head()&lt;/code&gt;, &lt;code&gt;tail()&lt;/code&gt; and &lt;code&gt;sample()&lt;/code&gt; are equally fast, so fast they can&amp;rsquo;t be seen
in the plots. However because the character data is read lazily, operations such
as &lt;code&gt;filter&lt;/code&gt; and &lt;code&gt;summarise&lt;/code&gt;, which need character values, require additional
time. However, this cost will only occur once. After the values have been read,
they will be stored in memory, and subsequent accesses will be equivalent to
other packages.&lt;/p&gt;
&lt;p&gt;For more details on how the benchmarks were performed and additional benchmarks
with other types of data see the &lt;a href=&#34;http://vroom.r-lib.org/articles/benchmarks.html&#34;&gt;benchmark
vignette&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;feedback-welcome&#34;&gt;Feedback welcome!
  &lt;a href=&#34;#feedback-welcome&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;vroom is a new package and, like any newborn, may fall down a few times before
learning to run. If you do run into a bug or think of a new feature that
would work well in vroom please &lt;a href=&#34;https://github.com/r-lib/vroom/issues&#34;&gt;open an
issue&lt;/a&gt; so we can discuss it!&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Even though this is a new release, a number of people have been testing out
pre-release versions on their datasets and opening issues, which has been a
huge help in making the package more robust.&lt;/p&gt;
&lt;p&gt;A big thanks to &lt;a href=&#34;https://github.com/alex-gable&#34;&gt;@alex-gable&lt;/a&gt;,
&lt;a href=&#34;https://github.com/andrie&#34;&gt;@andrie&lt;/a&gt;,
&lt;a href=&#34;https://github.com/dan-reznik&#34;&gt;@dan-reznik&lt;/a&gt;,
&lt;a href=&#34;https://github.com/Evgeniy-&#34;&gt;@Evgeniy-&lt;/a&gt;,
&lt;a href=&#34;https://github.com/ginolhac&#34;&gt;@ginolhac&lt;/a&gt;,
&lt;a href=&#34;https://github.com/ibarraespinosa&#34;&gt;@ibarraespinosa&lt;/a&gt;,
&lt;a href=&#34;https://github.com/KasperSkytte&#34;&gt;@KasperSkytte&lt;/a&gt;,
&lt;a href=&#34;https://github.com/ldecicco-USGS&#34;&gt;@ldecicco-USGS&lt;/a&gt;,
&lt;a href=&#34;https://github.com/LuisQ95&#34;&gt;@LuisQ95&lt;/a&gt;,
&lt;a href=&#34;https://github.com/matthieu-haudiquet&#34;&gt;@matthieu-haudiquet&lt;/a&gt;,
&lt;a href=&#34;https://github.com/md0u80c9&#34;&gt;@md0u80c9&lt;/a&gt;,
&lt;a href=&#34;https://github.com/mkiang&#34;&gt;@mkiang&lt;/a&gt;,
&lt;a href=&#34;https://github.com/R3myG&#34;&gt;@R3myG&lt;/a&gt;,
&lt;a href=&#34;https://github.com/randomgambit&#34;&gt;@randomgambit&lt;/a&gt;,
&lt;a href=&#34;https://github.com/slowkow&#34;&gt;@slowkow&lt;/a&gt;,
&lt;a href=&#34;https://github.com/telaroz&#34;&gt;@telaroz&lt;/a&gt;,
&lt;a href=&#34;https://github.com/thierrygosselin&#34;&gt;@thierrygosselin&lt;/a&gt;, and
&lt;a href=&#34;https://github.com/xiaodaigh&#34;&gt;@xiaodaigh&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;Also this package would not be possible without the following significant
contributions to the R ecosystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://twitter.com/groundwalkergmb&#34;&gt;Gabe Becker&lt;/a&gt;, &lt;a href=&#34;https://stat.uiowa.edu/~luke/&#34;&gt;Luke
Tierney&lt;/a&gt; and &lt;a href=&#34;https://github.com/kalibera&#34;&gt;Tomas
Kalibera&lt;/a&gt; for conceiving, implementing
and maintaining the &lt;a href=&#34;https://svn.r-project.org/R/branches/ALTREP/ALTREP.html&#34;&gt;Altrep
framework&lt;/a&gt; used extensively in vroom.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://twitter.com/romain_francois&#34;&gt;Romain François&lt;/a&gt;, whose
&lt;a href=&#34;https://purrple.cat/blog/2018/10/14/altrep-and-cpp/&#34;&gt;Altrepisode&lt;/a&gt;
package and &lt;a href=&#34;https://purrple.cat/blog/2018/10/14/altrep-and-cpp/&#34;&gt;related
blog-posts&lt;/a&gt;
were a great guide for creating new Altrep objects in C++.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://twitter.com/mattdowle&#34;&gt;Matt Dowle&lt;/a&gt; and the rest of the
&lt;a href=&#34;https://github.com/Rdatatable&#34;&gt;Rdatatable&lt;/a&gt; team,
&lt;code&gt;data.table::fread()&lt;/code&gt; is blazing fast and a great motivator to think about
how to read delimited files fast!&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
    <item>
      <title>dbplyr 1.4.0</title>
      <link>https://www.tidyverse.org/blog/2019/04/dbplyr-1-4-0/</link>
      <pubDate>Tue, 30 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/04/dbplyr-1-4-0/</guid>
      <description>We&amp;rsquo;re stoked to announce the release of dbplyr 1.4.0, the database backend for dplyr that translates R code into SQL. dbplyr allows you to use a remote database as if it was a collection of local data frames: you write ordinary dplyr code and dbplyr turns it into SQL for you.
You can install the released version from CRAN:
install.packages(&amp;#34;dbplyr&amp;#34;) While there are many small improvements and bug fixes (see the full full details in the changelog), the biggest improvements in this release are related to SQL generation.</description>
      <content>&lt;p&gt;We&amp;rsquo;re stoked to announce the release of &lt;a href=&#34;https://dbplyr.tidyverse.org&#34;&gt;dbplyr 1.4.0&lt;/a&gt;, the database backend for dplyr that translates R code into SQL. dbplyr allows you to use a remote database as if it was a collection of local data frames: you write ordinary dplyr code and dbplyr turns it into SQL for you.&lt;/p&gt;
&lt;p&gt;You can install the released version from CRAN:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;dbplyr&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;p&gt;While there are many small improvements and bug fixes (see the full full details in the &lt;a href=&#34;https://dbplyr.tidyverse.org/news/index.html&#34;&gt;changelog&lt;/a&gt;), the biggest improvements in this release are related to SQL generation. In this blog post, I&amp;rsquo;ll show you how find out what dplyr is doing behind the scenes, discuss some major simplifications to the SQL that dbplyr generates, and then show off a few of the new function translations.&lt;/p&gt;
&lt;p&gt;To get started, I&amp;rsquo;ll load dplyr and dbplyr:&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;dplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&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;dbplyr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;sql-simulation&#34;&gt;SQL simulation
  &lt;a href=&#34;#sql-simulation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;This version of dbplyr substantially improves the tools that allow you to see what SQL dbplyr generates without needing to connect to a live database. You won&amp;rsquo;t generally need these tools for real data, but they&amp;rsquo;re very useful for blog posts (like this one!), for generating reprexes (as discussed in the new &lt;a href=&#34;https://dbplyr.tidyverse.org/articles/reprex.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;reprex&amp;quot;)&lt;/code&gt;&lt;/a&gt;), and for dbplyr&amp;rsquo;s internal tests.&lt;/p&gt;
&lt;p&gt;The basic idea is that you can create a &amp;ldquo;lazy&amp;rdquo; frame:&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;df1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#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;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I call this tibble lazy because dplyr operations don&amp;rsquo;t do any work; instead they just record the action so it can later be turned in to a SQL query. You can see this query by printing the lazy tibble:&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;df1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT *&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is most useful when you add on a few steps:&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;df1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mean&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Warning: Missing values are always removed in SQL.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Use `mean(x, na.rm = TRUE)` to silence this warning&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; This warning is displayed only once per session.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `x`, AVG(`y`) AS `z`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; GROUP BY `x`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(This example also highlights another small improvement to dbplyr: it&amp;rsquo;ll only warn you about missing values being automatically removed in the database once per session.)&lt;/p&gt;
&lt;p&gt;Importantly, &lt;code&gt;lazy_frame()&lt;/code&gt; has a &lt;code&gt;con&lt;/code&gt; argument that allows you to specify which database should be used for the translation. This makes it easier to see the differences in SQL generation between databases:&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;df1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&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;item:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;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;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `x`, `y`, CONCAT_WS(&amp;#39; &amp;#39;, &amp;#39;item:&amp;#39;, `x`) AS `z`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; LIMIT 5&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;df2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;con&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;simulate_mssql&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&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;item:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;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;m&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT TOP(5) `x`, `y`, &amp;#39;item:&amp;#39; + &amp;#39; &amp;#39; + `x` AS `z`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When you don&amp;rsquo;t specify a connection, dplyr uses its standard translation, which tries to follow the ANSI SQL standard as closely as possible.&lt;/p&gt;




&lt;h2 id=&#34;simpler-sql&#34;&gt;Simpler SQL
  &lt;a href=&#34;#simpler-sql&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Two improvements have considerably reduced the number of subqueries that dbplyr needs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Joins, semi joins, and set operations no longer add additional unneeded
subqueries, and now generate the minimum set:&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;df1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    
&lt;span class=&#34;nf&#34;&gt;union&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;df2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; (SELECT `x`, `y`, `a`, NULL AS `b`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; UNION&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; (SELECT `x`, `y`, NULL AS `a`, `b`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`)&lt;/span&gt;
    
&lt;span class=&#34;nf&#34;&gt;left_join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;df2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;x&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;y&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `LHS`.`x` AS `x`, `LHS`.`y` AS `y`, `LHS`.`a` AS `a`, `RHS`.`b` AS `b`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df` AS `LHS`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; LEFT JOIN `df` AS `RHS`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ON (`LHS`.`x` = `RHS`.`x` AND `LHS`.`y` = `RHS`.`y`)&lt;/span&gt;
    
&lt;span class=&#34;nf&#34;&gt;semi_join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;df2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;x&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;y&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT * FROM `df` AS `LHS`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; WHERE EXISTS (&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   SELECT 1 FROM `df` AS `RHS`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   WHERE (`LHS`.`x` = `RHS`.`x` AND `LHS`.`y` = `RHS`.`y`)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; )&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Many sequences of &lt;code&gt;mutate()&lt;/code&gt;, &lt;code&gt;select()&lt;/code&gt;, &lt;code&gt;rename()&lt;/code&gt;, and &lt;code&gt;transmute()&lt;/code&gt;
steps are collapsed into a single query:&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;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `x` + `y` AS `z`, `y`, `x`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note that dbplyr will still generate multiple subqueries from a single mutate statement when needed. This resolves one of my biggest frustrations with SQL:&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;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;b1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;b2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;^&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b2&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `x`, `y`, `a`, `b1`, `b2`, `b1` / `b2` AS `c`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM (SELECT `x`, `y`, `a`, `a` * 3.0 AS `b1`, POWER(`a`, 2.0) AS `b2`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM (SELECT `x`, `y`, `x` + 1.0 AS `a`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`) `dbplyr_001`) `dbplyr_002`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I touch on this advantage of dbplyr over SQL in a new vignette, &lt;a href=&#34;https://dbplyr.tidyverse.org/dev/articles/sql.html&#34;&gt;&lt;code&gt;vignette(&amp;quot;sql&amp;quot;)&lt;/code&gt;&lt;/a&gt;, which also gives some advice about how to write literal SQL, when dbplyr&amp;rsquo;s built-in translations don&amp;rsquo;t work.&lt;/p&gt;




&lt;h2 id=&#34;sql-translation&#34;&gt;SQL translation
  &lt;a href=&#34;#sql-translation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;As well as improving the translation of high-level dplyr functions, we&amp;rsquo;ve also considerably added to the set of low-level vector functions that dbplyr can translate. Firstly, &lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/window-functions.html&#34;&gt;MySQL&lt;/a&gt; (&amp;gt;= 8.0), &lt;a href=&#34;https://mariadb.com/kb/en/library/window-functions/&#34;&gt;MariaDB&lt;/a&gt; (&amp;gt;= 10.2) and &lt;a href=&#34;https://www.sqlite.org/windowfunctions.html&#34;&gt;SQLite&lt;/a&gt; (&amp;gt;3.25) gain support for &lt;a href=&#34;https://dbplyr.tidyverse.org/dev/articles/translation-function.html#window-functions&#34;&gt;window functions&lt;/a&gt;. These allow you to use summary functions (like &lt;code&gt;mean()&lt;/code&gt; or &lt;code&gt;sum()&lt;/code&gt;) inside of &lt;code&gt;mutate()&lt;/code&gt;, as well as unlocking useful function like &lt;code&gt;min_rank()&lt;/code&gt;, &lt;code&gt;first()&lt;/code&gt;, and &lt;code&gt;lead()&lt;/code&gt;/&lt;code&gt;lag()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href=&#34;http://github.com/colearendt&#34;&gt;Cole Arendt&lt;/a&gt;, dbplyr now supports translations for a selection of useful functions from stringr (&lt;code&gt;str_c()&lt;/code&gt;, &lt;code&gt;str_sub()&lt;/code&gt;, &lt;code&gt;str_length()&lt;/code&gt;, &lt;code&gt;str_to_upper()&lt;/code&gt;, &lt;code&gt;str_to_lower()&lt;/code&gt;, and &lt;code&gt;str_to_title()&lt;/code&gt;), and lubridate ( &lt;code&gt;today()&lt;/code&gt;, &lt;code&gt;now()&lt;/code&gt;, &lt;code&gt;year()&lt;/code&gt;, &lt;code&gt;month()&lt;/code&gt; (numeric value only), &lt;code&gt;day()&lt;/code&gt;, &lt;code&gt;hour()&lt;/code&gt;, &lt;code&gt;minute()&lt;/code&gt;, &lt;code&gt;second()&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;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;birthday&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;transmute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;str_to_lower&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;month&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;month&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;birthday&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;mday&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;mday&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;birthday&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT LOWER(`name`) AS `name`, EXTRACT(month FROM `birthday`) AS `month`, EXTRACT(day FROM `birthday`) AS `mday`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Thanks to &lt;a href=&#34;http://github.com/davidchall&#34;&gt;David C Hall&lt;/a&gt; we have translations for bitwise operations (&lt;code&gt;bitwNot()&lt;/code&gt;, &lt;code&gt;bitwAnd()&lt;/code&gt;, &lt;code&gt;bitwOr()&lt;/code&gt;, &lt;code&gt;bitwXor()&lt;/code&gt;, &lt;code&gt;bitwShiftL()&lt;/code&gt;, and &lt;code&gt;bitwShiftR()&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;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;integer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;integer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;transmute&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;and&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;bitwAnd&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;or&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;bitwOr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `x` &amp;amp; `y` AS `and`, `x` | `y` AS `or`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Thanks to &lt;a href=&#34;http://github.com/edavidaja&#34;&gt;E. David Aja&lt;/a&gt;&amp;lsquo;s research on tidyverse developer day we have improved translations for &lt;code&gt;median()&lt;/code&gt; and &lt;code&gt;quantile()&lt;/code&gt; for all ANSI compliant databases (SQL Server, Postgres, MariaDB), along with custom translations for Hive and Teradata.&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;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;character&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;numeric&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;median&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `g`, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY `x`) AS `y`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; GROUP BY `g`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Finally, I have improved translation of &lt;code&gt;[&lt;/code&gt;, so that you can use expressions like &lt;code&gt;sum(a[b == 0])&lt;/code&gt; as you would in R:&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;tbl_lazy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cyl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mpg_vs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;sum&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mpg[vs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;na.rm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `cyl`, SUM(CASE WHEN (`vs` = 1.0) THEN (`mpg`) END) AS `mpg_vs`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; GROUP BY `cyl`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can also now use use &lt;code&gt;x$y&lt;/code&gt; to access nested fields:&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;lazy_frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;z&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &amp;lt;SQL&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; SELECT `x`, `x`.`y`.`z` AS `z`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; FROM `df`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;As always, a big thank goes to the entire community who helped make this release of dbplyr a reality - I really appreciated all your bug reports, helpful comments, SQL suggestions, and pull requests!&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/alex-gable&#34;&gt;@alex-gable&lt;/a&gt;, &lt;a href=&#34;https://github.com/blairj09&#34;&gt;@blairj09&lt;/a&gt;, &lt;a href=&#34;https://github.com/carvalhomb&#34;&gt;@carvalhomb&lt;/a&gt;, &lt;a href=&#34;https://github.com/cderv&#34;&gt;@cderv&lt;/a&gt;, &lt;a href=&#34;https://github.com/colearendt&#34;&gt;@colearendt&lt;/a&gt;, &lt;a href=&#34;https://github.com/DanielStay&#34;&gt;@DanielStay&lt;/a&gt;, &lt;a href=&#34;https://github.com/davidchall&#34;&gt;@davidchall&lt;/a&gt;, &lt;a href=&#34;https://github.com/dlindelof&#34;&gt;@dlindelof&lt;/a&gt;, &lt;a href=&#34;https://github.com/edgararuiz&#34;&gt;@edgararuiz&lt;/a&gt;, &lt;a href=&#34;https://github.com/FrancoisGuillem&#34;&gt;@FrancoisGuillem&lt;/a&gt;, &lt;a href=&#34;https://github.com/FranGoitia&#34;&gt;@FranGoitia&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/imanuelcostigan&#34;&gt;@imanuelcostigan&lt;/a&gt;, &lt;a href=&#34;https://github.com/JakeRuss&#34;&gt;@JakeRuss&lt;/a&gt;, &lt;a href=&#34;https://github.com/javierluraschi&#34;&gt;@javierluraschi&lt;/a&gt;, &lt;a href=&#34;https://github.com/jcfisher&#34;&gt;@jcfisher&lt;/a&gt;, &lt;a href=&#34;https://github.com/jkylearmstrong&#34;&gt;@jkylearmstrong&lt;/a&gt;, &lt;a href=&#34;https://github.com/JohnMount&#34;&gt;@JohnMount&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrisi256&#34;&gt;@jrisi256&lt;/a&gt;, &lt;a href=&#34;https://github.com/jsekamane&#34;&gt;@jsekamane&lt;/a&gt;, &lt;a href=&#34;https://github.com/klmedeiros&#34;&gt;@klmedeiros&lt;/a&gt;, &lt;a href=&#34;https://github.com/leungi&#34;&gt;@leungi&lt;/a&gt;, &lt;a href=&#34;https://github.com/Liubuntu&#34;&gt;@Liubuntu&lt;/a&gt;, &lt;a href=&#34;https://github.com/lpatruno&#34;&gt;@lpatruno&lt;/a&gt;, &lt;a href=&#34;https://github.com/lymanmark&#34;&gt;@lymanmark&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkearney&#34;&gt;@mkearney&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkirzon&#34;&gt;@mkirzon&lt;/a&gt;, &lt;a href=&#34;https://github.com/mpettis&#34;&gt;@mpettis&lt;/a&gt;, &lt;a href=&#34;https://github.com/mtoto&#34;&gt;@mtoto&lt;/a&gt;, &lt;a href=&#34;https://github.com/N1h1l1sT&#34;&gt;@N1h1l1sT&lt;/a&gt;, &lt;a href=&#34;https://github.com/nwstephens&#34;&gt;@nwstephens&lt;/a&gt;, &lt;a href=&#34;https://github.com/QuLogic&#34;&gt;@QuLogic&lt;/a&gt;, &lt;a href=&#34;https://github.com/r2evans&#34;&gt;@r2evans&lt;/a&gt;, &lt;a href=&#34;https://github.com/rlh1994&#34;&gt;@rlh1994&lt;/a&gt;, &lt;a href=&#34;https://github.com/shgoke&#34;&gt;@shgoke&lt;/a&gt;, &lt;a href=&#34;https://github.com/tomauer&#34;&gt;@tomauer&lt;/a&gt;, and &lt;a href=&#34;https://github.com/verajosemanuel&#34;&gt;@verajosemanuel&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>How parsnip works</title>
      <link>https://www.tidyverse.org/blog/2019/04/parsnip-internals/</link>
      <pubDate>Tue, 30 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/04/parsnip-internals/</guid>
      <description>parsnip was accepted to CRAN late last year. Our first blog post was a top-level introduction. Here, we will go into the design of some of the internals. If you end up looking at the package sources, there are going to be times that you might question our sanity. This post is intended to go over some design decisions and provide some context.
My first solution: caret     Having developed caret in early 2005, I was not prepared for what it would be like to maintain a package that wrapped more than 200 models.</description>
      <content>&lt;p&gt;&lt;a href=&#34;https://tidymodels.github.io/parsnip/&#34;&gt;&lt;code&gt;parsnip&lt;/code&gt;&lt;/a&gt; was accepted to CRAN late last year. Our &lt;a href=&#34;https://www.tidyverse.org/articles/2018/11/parsnip-0-0-1/&#34;&gt;first blog post&lt;/a&gt; was a top-level introduction. Here, we will go into the design of some of the internals. If you end up looking at the package sources, there are going to be times that you might question our sanity. This post is intended to go over some design decisions and provide some context.&lt;/p&gt;




&lt;h1 id=&#34;my-first-solution-caret&#34;&gt;My first solution: caret
  &lt;a href=&#34;#my-first-solution-caret&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h1&gt;&lt;p&gt;Having developed &lt;a href=&#34;https://topepo.github.io/caret/&#34;&gt;&lt;code&gt;caret&lt;/code&gt;&lt;/a&gt; in early 2005, I was not prepared for what it would be like to maintain a package that wrapped more than 200 models. What &lt;code&gt;caret&lt;/code&gt; does is to create code &lt;em&gt;modules&lt;/em&gt; that define the different aspects of modeling, such as model fitting, prediction, and so on. These code modules are contained in lists, one per specific model. For example, here is one of the simplest lists for &lt;a href=&#34;https://www.rdocumentation.org/packages/MASS/versions/7.3-51.1/topics/lda&#34;&gt;&lt;code&gt;MASS::lda&lt;/code&gt;&lt;/a&gt; (slightly abbreviated):&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;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;label&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Linear Discriminant Analysis&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;library&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;MASS&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Classification&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;fit&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;wts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;param&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;lev&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;classProbs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;MASS&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;lda&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;  &lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;predict&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;modelFit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;newdata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;submodels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;predict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;modelFit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;newdata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;prob&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;modelFit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;newdata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;submodels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;predict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;modelFit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;newdata&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;$&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;posterior&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Some notes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;✔ The modules are fairly well-defined and mutually exclusive.&lt;/li&gt;
&lt;li&gt;✔ The structure prevents &lt;em&gt;information leakage&lt;/em&gt;. The fitting parts are isolated from the prediction parts and the prediction modules only return predictions in a standard format. &lt;code&gt;caret&lt;/code&gt; compartmentalizes the modeling process and prevents people from &amp;ldquo;teaching to the test&amp;rdquo; unless they deliberately go out of their way to do so.&lt;/li&gt;
&lt;li&gt;✔ These modules cleanly document &lt;a href=&#34;https://stat.ethz.ch/pipermail/r-devel/2012-January/062935.html&#34;&gt;issues&lt;/a&gt; with using the packages. We&amp;rsquo;d like each model function to have a predictable interface for fitting and prediction, but that&amp;rsquo;s not the reality for many packages. If nothing else, these modules document the idiosyncratic nature of some packages.&lt;/li&gt;
&lt;li&gt;✔ The &lt;code&gt;lda&lt;/code&gt; code above is a fairly clean case. Others are not as nice to look at, especially if they can predict multiple sub-models at once or have problematic interfaces.&lt;/li&gt;
&lt;li&gt;✖ There is a lot of code duplication. For this reason, the directory containing the current set of 238 modules is about 1.3MB.&lt;/li&gt;
&lt;li&gt;✖ The system in &lt;code&gt;caret&lt;/code&gt; rigidly defines what parameters can be tuned. It is a bit of a walled garden in this respect.&lt;/li&gt;
&lt;li&gt;✔ Code like &lt;code&gt;MASS::lda&lt;/code&gt; would be exposed to &lt;code&gt;R CMD check&lt;/code&gt; if it is contained in a package&amp;rsquo;s &lt;code&gt;R&lt;/code&gt; directory. Because of this, there was a large number of package dependencies in early versions. &lt;code&gt;caret&lt;/code&gt; was almost intolerable when it came time for CRAN to check the package. One way that I fixed this was to compile these code modules in an R list object and treat that as &lt;em&gt;data&lt;/em&gt; in the package. In this way, the package R files do not contain much specific model code and, many formal dependencies are avoided.&lt;/li&gt;
&lt;li&gt;✔ The ellipses (&lt;code&gt;...&lt;/code&gt;) are heavily utilized here. This makes passing other arguments to the underlying fitting function trivial. This is probably still my favorite thing about the S language.&lt;/li&gt;
&lt;li&gt;✖ In some cases, &lt;code&gt;caret&lt;/code&gt; needs to grab an object that might be in the ellipses in order to  modify the value. For example, the main tuning parameters for &lt;a href=&#34;https://www.rdocumentation.org/packages/rpart/versions/4.1-13/topics/rpart&#34;&gt;&lt;code&gt;rpart&lt;/code&gt;&lt;/a&gt; models are in &lt;a href=&#34;https://www.rdocumentation.org/packages/rpart/versions/4.1-13/topics/rpart.control&#34;&gt;&lt;code&gt;rpart.control&lt;/code&gt;&lt;/a&gt;. If a user passes in an argument by the name of &lt;code&gt;control&lt;/code&gt;, it will need to be captured and the appropriate arguments (like &lt;code&gt;cp&lt;/code&gt;, &lt;code&gt;maxdepth&lt;/code&gt;, or &lt;code&gt;minsplit&lt;/code&gt;) are modified without changing the other arguments. That&amp;rsquo;s not hard to do but it eliminates the benefits you get by using the ellipses. In the end, &lt;code&gt;do.call(&amp;quot;rpart&amp;quot;, args)&lt;/code&gt; is used to fit the model. The downside of this is that the &lt;em&gt;data&lt;/em&gt; objects are embedded in &lt;code&gt;args&lt;/code&gt; and, as an unhappy side-effect, the &lt;em&gt;data set gets embedded in &lt;code&gt;rpart&lt;/code&gt;&#39;s call object&lt;/em&gt;. That&amp;rsquo;s really bad.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When I began at RStudio, I had already been thinking about a different and, hopefully more elegant, way to do this for &lt;code&gt;tidymodels&lt;/code&gt;.&lt;/p&gt;




&lt;h1 id=&#34;a-focus-on-calls-and-quosures&#34;&gt;A focus on calls and quosures
  &lt;a href=&#34;#a-focus-on-calls-and-quosures&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h1&gt;&lt;p&gt;When &lt;code&gt;parsnip&lt;/code&gt; fits a model, it constructs a call object that will be evaluated to create the model fit object (&lt;code&gt;rlang::call2&lt;/code&gt; and &lt;code&gt;rlang::call_modify&lt;/code&gt; are excellent). For example, if we were doing this &amp;ldquo;by-hand&amp;rdquo; for something simple like &lt;code&gt;glm&lt;/code&gt;, an initial function using &lt;code&gt;rlang&lt;/code&gt; could be:&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;rlang&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;glm_fit&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;formula&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;evaluate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# capture the specific arguments and ellipses as quosures:&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;formula&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;enquo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;formula&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rlang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;enquo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# capture any extra arguments&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;args&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rlang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;enquos&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# make the call&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;model_call&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rlang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;call2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;glm&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.ns&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;stats&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!!!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

  &lt;span class=&#34;nf&#34;&gt;if &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;evaluate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rlang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;eval_tidy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;model_call&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;model_call&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;glm_fit&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;#&amp;gt; stats::glm(formula = ~, data = ~)
&lt;/code&gt;&lt;/pre&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;glm_fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;family&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;stats&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;binomial&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;#&amp;gt; stats::glm(formula = ~, data = ~, family = ~stats::binomial)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When these are printed, the tilde indicates which values are  &lt;em&gt;quosures&lt;/em&gt;. A &lt;a href=&#34;https://adv-r.hadley.nz/evaluation.html&#34;&gt;quosure&lt;/a&gt; is a combination of an &lt;code&gt;rlang&lt;/code&gt; expression and a reference to the environment in which it originated. Since it is partly an expression, the value has not yet been evaluated inside of &lt;code&gt;glm_fit()&lt;/code&gt;. For this reason, when we pass &lt;code&gt;family = stats::binomial&lt;/code&gt;, the object &lt;a href=&#34;https://www.rdocumentation.org/packages/stats/versions/3.5.1/topics/family&#34;&gt;&lt;code&gt;stats::binomial&lt;/code&gt;&lt;/a&gt; is &lt;em&gt;not&lt;/em&gt; evaluated. If it were, the value of that object would be embedded into the call (type &lt;code&gt;unclass(binomial())&lt;/code&gt; at an R prompt to see what this looks like).&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a better example:&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;glm_fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mpg&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&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;#&amp;gt; stats::glm(formula = ~(mpg ~ .), data = ~mtcars, x = ~FALSE)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The &lt;a href=&#34;https://www.rdocumentation.org/packages/rlang/versions/0.2.2/topics/eval_tidy_&#34;&gt;&lt;code&gt;eval_tidy&lt;/code&gt;&lt;/a&gt; function can evaluate the quosure arguments when the call itself is evaluated. We get our model object as expected:&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;glm_fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mpg&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;evaluate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&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;#&amp;gt; 
#&amp;gt; Call:  stats::glm(formula = ~(mpg ~ .), data = ~mtcars, x = ~FALSE)
#&amp;gt; 
#&amp;gt; Coefficients:
#&amp;gt; (Intercept)          cyl         disp           hp         drat           wt  
#&amp;gt;     12.3034      -0.1114       0.0133      -0.0215       0.7871      -3.7153  
#&amp;gt;        qsec           vs           am         gear         carb  
#&amp;gt;      0.8210       0.3178       2.5202       0.6554      -0.1994  
#&amp;gt; 
#&amp;gt; Degrees of Freedom: 31 Total (i.e. Null);  21 Residual
#&amp;gt; Null Deviance:	    1130 
#&amp;gt; Residual Deviance: 147 	AIC: 164
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For &lt;code&gt;parsnip&lt;/code&gt;, there are utility functions that create the call and others to evaluate it. This means that the only model-related information needed to by the package to define the general &lt;code&gt;glm&lt;/code&gt; fitting function would be:&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;glm_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;glm&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;package&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;stats&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;required_args&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;formula&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;data&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;p&gt;All of the other arguments are assembled from the model specification object or extra arguments provided to &lt;a href=&#34;https://tidymodels.github.io/parsnip/reference/set_engine.html&#34;&gt;&lt;code&gt;set_engine()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://tidymodels.github.io/parsnip/reference/fit.html&#34;&gt;&lt;code&gt;fit()&lt;/code&gt;&lt;/a&gt;. This allows for a fairly compact representation of the information for the fitting module. Also, it does not expose the code in a way that requires a package dependency and doesn&amp;rsquo;t contaminate the model call with actual object values. The same strategy can be used to produce predictions and other quantities.&lt;/p&gt;
&lt;p&gt;There are some other niceties too. If a package, like &lt;a href=&#34;https://cran.r-project.org/package=glmnet&#34;&gt;&lt;code&gt;glmnet&lt;/code&gt;&lt;/a&gt; has a non-formula interface and requires the predictors to be in a matrix, that fitting function can just insert &lt;code&gt;x = as.matrix(x)&lt;/code&gt; into the &lt;code&gt;glmnet&lt;/code&gt; call instead of doing the matrix conversion prior to the model fit.&lt;/p&gt;
&lt;p&gt;Unsurprisingly, most model are more complex than our &lt;code&gt;glm&lt;/code&gt; example. There are some modeling packages, such as &lt;a href=&#34;https://keras.rstudio.com/&#34;&gt;&lt;code&gt;keras&lt;/code&gt;&lt;/a&gt; or &lt;a href=&#34;https://cran.r-project.org/package=xgboost&#34;&gt;&lt;code&gt;xgboost&lt;/code&gt;&lt;/a&gt;, that don&amp;rsquo;t have a one-line call to fit the model (see the &lt;code&gt;keras&lt;/code&gt; regression example &lt;a href=&#34;https://keras.rstudio.com/articles/tutorial_basic_regression.html&#34;&gt;here&lt;/a&gt;). In this case, a wrapper function is needed and this most likely results in an extra package dependency.&lt;/p&gt;
&lt;p&gt;Also, some prediction methods give back results that require post-processing. For example, class probability predictions for a multiclass &lt;code&gt;xgboost&lt;/code&gt; model come back as &lt;em&gt;a vector&lt;/em&gt;. For example, if you were to predict four samples of iris data, you would get a 12 element vector back that requires you to reshape the results into the appropriate 4x3 data frame. &lt;code&gt;parsnip&lt;/code&gt; handles these by having slots for pre-processing the data and/or post-processing the raw prediction results. More information can be found on the &lt;a href=&#34;https://tidymodels.github.io/parsnip/articles/articles/Scratch.html&#34;&gt;vignette for creating a model object&lt;/a&gt;. Keep in mind that, as we and other contributors work with the package more, these internals may slightly change in the first few versions.&lt;/p&gt;
&lt;p&gt;Also, a lot of the package code revolves around getting the arguments right. There are some default arguments set by the package, such as &lt;code&gt;family = binomial&lt;/code&gt; for logistic regression. These defaults can be overwritten but may also depend on the mode of the model (e.g. regression, classification, etc.). There are also some arguments that &lt;code&gt;parsnp&lt;/code&gt; &lt;em&gt;protects&lt;/em&gt; in case the user tries to modify them (e.g. &lt;code&gt;data&lt;/code&gt;). Finally, the main arguments to &lt;code&gt;parsnip&lt;/code&gt; model functions are standardized and need to eventually be converted back to their engine-specific names.&lt;/p&gt;




&lt;h1 id=&#34;the-down-side-to-using-calls&#34;&gt;The down-side to using calls
  &lt;a href=&#34;#the-down-side-to-using-calls&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h1&gt;&lt;p&gt;Suppose that you are fitting a random forest regression model and want to tune over &lt;code&gt;mtry&lt;/code&gt;, the number of randomly selected predictors to evaluate at each split of the tree. This is a function of the data since it depends on the number of predictors.  A simplistic version of the code that iterates over &lt;code&gt;mtry&lt;/code&gt; might look like:&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;tidymodels&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;rf_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;rand_forest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;regression&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;for &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;in&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;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;new_rf&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;rf_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;update&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtry&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;rf_fit&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;new_rf&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;set_engine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;ranger&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Sepal.Width&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;c1&#34;&gt;# now evaluate the model for performance&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# what is the current value of `mtry`? &lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;new_rf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;#&amp;gt; Random Forest Model Specification (regression)
#&amp;gt; 
#&amp;gt; Main Arguments:
#&amp;gt;   mtry = i
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The specification depends on &lt;code&gt;i&lt;/code&gt; and its value is not in &lt;code&gt;new_rf&lt;/code&gt;, only a reference to a symbol &lt;code&gt;i&lt;/code&gt; in the global environment. What if the value of &lt;code&gt;i&lt;/code&gt; changes?&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;i&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;300&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;new_rf&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;set_engine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;ranger&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Sepal.Width&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;iris&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;#&amp;gt; Error in ranger::ranger(formula = formula, data = data, mtry = ~i, num.threads = 1, : User interrupt or internal error.
&lt;/code&gt;&lt;/pre&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;# mtry should be between 1 and 4 for these data. &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In this context, using quosures for parameter values is problematic because (by default) their values are not frozen when the specification is created. However, we can fix this using &lt;a href=&#34;https://adv-r.hadley.nz/quasiquotation.html&#34;&gt;quasiquotiation&lt;/a&gt;. The value of &lt;code&gt;i&lt;/code&gt; can be embedded into the call using &lt;code&gt;!!&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;for &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;in&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;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;new_rf&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;rf_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;update&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtry&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# What is the current value of `mtry` now? &lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;new_rf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;#&amp;gt; Random Forest Model Specification (regression)
#&amp;gt; 
#&amp;gt; Main Arguments:
#&amp;gt;   mtry = 4
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;One other downside is related to the &lt;em&gt;data&lt;/em&gt; used in the call. In the random forest example above, the value of &lt;code&gt;mtry&lt;/code&gt; is dependent on the number of predictors. What if you don&amp;rsquo;t know how many predictors you have until the model is fit? How could you then specify &lt;code&gt;mtry&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;This could happen for a few reasons. For example, if you are using a &lt;code&gt;recipe&lt;/code&gt; that has a filter based on reducing correlation, the number of predictors may not be known until the recipe is prepped (and the number may vary inside of resampling). A more common example is related to dummy variables. If I use &lt;code&gt;fit_xy()&lt;/code&gt; instead of &lt;code&gt;fit()&lt;/code&gt; in the code above, the &lt;code&gt;Species&lt;/code&gt; predictor in the iris data is expanded from one column into two dummy variable columns just prior to the model fit. This could affect the possible range of &lt;code&gt;mtry&lt;/code&gt; values.&lt;/p&gt;
&lt;p&gt;There are a few ways to get around this. The first (and worst) is to use the data in an expression. Since &lt;code&gt;mtry&lt;/code&gt; isn&amp;rsquo;t evaluated until the model fit, you could try to use &lt;code&gt;mtry = floor(sqrt(ncol(data)))&lt;/code&gt;. That&amp;rsquo;s very brittle for a few different reasons. For one, &lt;em&gt;you&lt;/em&gt; may use the &lt;code&gt;parsnip&lt;/code&gt; interface &lt;code&gt;fit(formula, data)&lt;/code&gt;, but the underlying model may be &lt;code&gt;model_fn(x, y)&lt;/code&gt; and the &lt;code&gt;data&lt;/code&gt; object doesn&amp;rsquo;t exist when the model call is evaluated.&lt;/p&gt;
&lt;p&gt;For this reason, we added &lt;a href=&#34;https://tidymodels.github.io/parsnip/reference/descriptors.html&#34;&gt;data descriptors&lt;/a&gt; to &lt;code&gt;parsnip&lt;/code&gt;. These are small functions that only work when the model is being fit and they capture relevant aspects of the data at &lt;strong&gt;the time of fit&lt;/strong&gt;. For example, the function &lt;code&gt;.obs()&lt;/code&gt; can be used in an argument value to reference the number of rows in the data. To illustrate, the argument &lt;code&gt;min_n&lt;/code&gt; for a random forest model corresponds to how many data points are required to make further splits. For regression models, this defaults to 5 when using &lt;a href=&#34;https://cran.r-project.org/package=ranger&#34;&gt;&lt;code&gt;ranger&lt;/code&gt;&lt;/a&gt;. Suppose you want this to be one-tenth of the data but at least 8. If your data are being resampled, you might not know the training set size. You could use:&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;rf_model&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;update&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;min_n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;floor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;.obs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;set_engine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;ranger&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
    &lt;span class=&#34;nf&#34;&gt;fit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Sepal.Width&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;iris&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;#&amp;gt; parsnip model object
#&amp;gt; 
#&amp;gt; Ranger result
#&amp;gt; 
#&amp;gt; Call:
#&amp;gt;  ranger::ranger(formula = formula, data = data, min.node.size = ~max(8,      floor(.obs()/10)), num.threads = 1, verbose = FALSE, seed = sample.int(10^5,      1)) 
#&amp;gt; 
#&amp;gt; Type:                             Regression 
#&amp;gt; Number of trees:                  500 
#&amp;gt; Sample size:                      150 
#&amp;gt; Number of independent variables:  4 
#&amp;gt; Mtry:                             2 
#&amp;gt; Target node size:                 15 
#&amp;gt; Variable importance mode:         none 
#&amp;gt; Splitrule:                        variance 
#&amp;gt; OOB prediction error (MSE):       0.0827 
#&amp;gt; R squared (OOB):                  0.565
&lt;/code&gt;&lt;/pre&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;# The math checks out for the &amp;#34;Target node size&amp;#34; above:&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;floor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;nrow&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;10&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;#&amp;gt; [1] 15
&lt;/code&gt;&lt;/pre&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;# Does this work outside of the function call? &lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;floor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;.obs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;10&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;#&amp;gt; Descriptor context not set
&lt;/code&gt;&lt;/pre&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;# Nope!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The different descriptors should enable a wide variety of values for tuning parameters.&lt;/p&gt;




&lt;h1 id=&#34;why-not-just-evaluate-the-arguments&#34;&gt;Why not just evaluate the arguments?
  &lt;a href=&#34;#why-not-just-evaluate-the-arguments&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h1&gt;&lt;p&gt;In many cases, the model specification arguments (e.g. &lt;code&gt;mtry&lt;/code&gt; or &lt;code&gt;min_n&lt;/code&gt;) and engine arguments are simple objects or scalar values. It makes sense to quote &lt;code&gt;data&lt;/code&gt;, &lt;code&gt;x&lt;/code&gt; or &lt;code&gt;y&lt;/code&gt; but why not just evaluate the other arguments as usual?&lt;/p&gt;
&lt;p&gt;There are a few reasons. First, there are some arguments whose evaluation should be deferred. For example, &lt;code&gt;stan&lt;/code&gt; and &lt;code&gt;ranger&lt;/code&gt; models have their own random seed arguments. To enable reproducibility, &lt;code&gt;parsnip&lt;/code&gt; gives these function default values of &lt;code&gt;seed = sample.int(10^5, 1)&lt;/code&gt;. If this argument were unquoted, then the seed value would be fixed when the package was compiled. There are solutions for this simple example though.&lt;/p&gt;
&lt;p&gt;As seen above for data descriptors, there is the need to wait for some argument values to be evaluated at the same time that the call is evaluated. Originally, &lt;code&gt;parsnip&lt;/code&gt; immediately evaluated almost all of the arguments and our advice was to have users quote special arguments using &lt;code&gt;rlang::expr()&lt;/code&gt;. The feedback on this aspect of &lt;code&gt;parsnip&lt;/code&gt; was uniformity unfavorable since it would require many casual users to learn &lt;code&gt;rlang&lt;/code&gt; and metaprogramming techniques. For this reason, we moved the metaprogramming parts within the function to accomplish the same goals but without the user being required to understand the technical minutiae. When a user uses an argument like &lt;code&gt;min_n = max(8, floor(.obs()/10))&lt;/code&gt;, the use of quosures is hidden from view and it looks like they are using an ordinary function called &lt;code&gt;.obs()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;One final reason to leave arguments unevaluated in the model specification is related to &lt;em&gt;future plans&lt;/em&gt;. As previously mentioned, &lt;code&gt;caret&lt;/code&gt; rigidly defined which model parameters were available for performance tuning. The approach taken by &lt;code&gt;parsnip&lt;/code&gt; is very much the opposite. We want to enable users to tune any aspect of the model that they see fit, including some of the engine specific parameters.&lt;/p&gt;
&lt;p&gt;For example, when fitting a Bayesian regression model, a user might want to tune over how diffuse the prior distribution should be and so on. Rather than formally defining every possible tunable parameter, &lt;code&gt;parsnip&lt;/code&gt; allows the user to have a &lt;em&gt;placeholder&lt;/em&gt; for parameters in the model specification that declares, &amp;ldquo;I want to change this parameter, but I don&amp;rsquo;t know what the exact value should be.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;To do this, a special function called &lt;code&gt;varying()&lt;/code&gt; is used. A model cannot be fit if it has any varying parameters but future packages will be able to detect any of these parameters and construct tuning grids accordingly. The parameter values can be changed to specific candidate values, and these are then tested to see which value is the most appropriate. The code to do this is not ready at this point and will be part of another package. However, we can demonstrate how this happens inside of &lt;code&gt;parsnip&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;n&#34;&gt;lr_stan_spec&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;logistic_reg&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;set_engine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;s&#34;&gt;&amp;#34;stan&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;iter&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;5000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;prior_intercept&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rstanarm&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;student_t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;varying&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;seed&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2347&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Which, if any, arguments, should be tuned?&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;varying_args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lr_stan_spec&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;#&amp;gt; # A tibble: 5 x 4
#&amp;gt;   name            varying id           type      
#&amp;gt;   &amp;lt;chr&amp;gt;           &amp;lt;lgl&amp;gt;   &amp;lt;chr&amp;gt;        &amp;lt;chr&amp;gt;     
#&amp;gt; 1 penalty         FALSE   logistic_reg model_spec
#&amp;gt; 2 mixture         FALSE   logistic_reg model_spec
#&amp;gt; 3 iter            FALSE   logistic_reg model_spec
#&amp;gt; 4 prior_intercept TRUE    logistic_reg model_spec
#&amp;gt; 5 seed            FALSE   logistic_reg model_spec
&lt;/code&gt;&lt;/pre&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;nnet_spec&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;mlp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;hidden_units&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;varying&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;epochs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;varying&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;dropout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;varying&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;set_engine&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;s&#34;&gt;&amp;#34;keras&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;batch_size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;varying&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;callbacks&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;callback_early_stopping&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;monitor&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;loss&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;min_delta&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;varying&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;

&lt;span class=&#34;nf&#34;&gt;varying_args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;nnet_spec&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;#&amp;gt; # A tibble: 7 x 4
#&amp;gt;   name         varying id    type      
#&amp;gt;   &amp;lt;chr&amp;gt;        &amp;lt;lgl&amp;gt;   &amp;lt;chr&amp;gt; &amp;lt;chr&amp;gt;     
#&amp;gt; 1 hidden_units TRUE    mlp   model_spec
#&amp;gt; 2 penalty      FALSE   mlp   model_spec
#&amp;gt; 3 dropout      TRUE    mlp   model_spec
#&amp;gt; 4 epochs       TRUE    mlp   model_spec
#&amp;gt; 5 activation   FALSE   mlp   model_spec
#&amp;gt; 6 batch_size   TRUE    mlp   model_spec
#&amp;gt; 7 callbacks    TRUE    mlp   model_spec
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the &lt;code&gt;keras&lt;/code&gt; example, the argument names in &lt;code&gt;nnet_spec&lt;/code&gt; names match up with objects in the &lt;a href=&#34;https://tidymodels.github.io/dials/&#34;&gt;&lt;code&gt;dials&lt;/code&gt;&lt;/a&gt; package, and it will be possible to automatically create tuning grids for all of the parameters.&lt;/p&gt;
&lt;p&gt;By avoiding evaluation in the model specification, we are enabling some interesting upcoming features.&lt;/p&gt;
&lt;p&gt;Also, this feature will also be used with recipes and other future packages. This will enable joint optimization of parameters associated with pre-processing, model fitting, and post-processing activities.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>Tidyverse dev day at useR! 2019</title>
      <link>https://www.tidyverse.org/blog/2019/04/tidyverse-dev-day-at-user-2019/</link>
      <pubDate>Wed, 24 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/04/tidyverse-dev-day-at-user-2019/</guid>
      <description>Our first tidyverse developer day, held after rstudio::conf(2019), was a great success. We&amp;rsquo;re excited to announce that we&amp;rsquo;ll be holding another one &amp;ndash; this time the day before the start of useR! 2019 in Toulouse, France (Monday, July 8th).
 📆 When: 8 July, 9 am – 5 pm. 📍 Where: The same location as useR!, the congress centre &amp;ldquo;Pierre Baudis&amp;rdquo;. 👥 Who: Anyone who would like to get better at contributing to the tidyverse!</description>
      <content>&lt;p&gt;Our first &lt;a href=&#34;https://www.tidyverse.org/articles/2018/11/tidyverse-developer-day-2019/&#34;&gt;tidyverse developer day&lt;/a&gt;, held after rstudio::conf(2019), was a great success. We&amp;rsquo;re excited to announce that we&amp;rsquo;ll be holding another one &amp;ndash; this time the day before the start of useR! 2019 in Toulouse, France (&lt;strong&gt;Monday, July 8th&lt;/strong&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;📆 &lt;strong&gt;When:&lt;/strong&gt; 8 July, 9 am – 5 pm.&lt;/li&gt;
&lt;li&gt;📍 &lt;strong&gt;Where:&lt;/strong&gt; The same location as useR!, &lt;a href=&#34;https://www.centre-congres-toulouse.fr/fr&#34;&gt;the congress centre &amp;ldquo;Pierre Baudis&amp;rdquo;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;👥 &lt;strong&gt;Who:&lt;/strong&gt; Anyone who would like to get better at contributing to the tidyverse! Everyone is welcome regardless of whether you&amp;rsquo;ve never done a PR before, or if you&amp;rsquo;ve already made your 10th package.&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;What:&lt;/strong&gt; A day of learning and coding. We&amp;rsquo;ll provide
lunch, snacks, and coffee; you&amp;rsquo;ll bring your laptop and enthusiasm.
The tidyverse team will be on hand to help out and answer your questions.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;tickets-&#34;&gt;Tickets 🎫
  &lt;a href=&#34;#tickets-&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Tickets are &lt;a href=&#34;https://www.eventbrite.com/e/tidyverse-developer-day-tickets-51757053741&#34;&gt;&lt;strong&gt;on sale
now&lt;/strong&gt;!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Tickets cost €10; we&amp;rsquo;re charging a small fee because space is limited. All fees
will be donated to a non-profit (TBD).&lt;/p&gt;




&lt;h2 id=&#34;code-of-conduct&#34;&gt;Code of conduct
  &lt;a href=&#34;#code-of-conduct&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;All attendees will be expected to follow the &lt;a href=&#34;https://github.com/tidyverse/dev-day-2019/blob/master/CODE_OF_CONDUCT.md&#34;&gt;Code of Conduct&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>testthat 2.1.0</title>
      <link>https://www.tidyverse.org/blog/2019/04/testthat-2-1-0/</link>
      <pubDate>Tue, 23 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/04/testthat-2-1-0/</guid>
      <description>h2 code { font-size: 1em; }   We&amp;rsquo;re happy to announce that testthat 2.1.0 is now available on CRAN! testthat makes it easy to turn your existing informal tests into formal automated tests that you can rerun quickly and easily. testthat is the most popular unit-testing package for R, and is used by over 4,000 CRAN and Bioconductor packages. You can learn more about unit testing at https://r-pkgs.</description>
      <content>&lt;html&gt;
&lt;style&gt;
h2 code {
    font-size: 1em;
}
&lt;/style&gt;
&lt;/html&gt;
&lt;p&gt;We&amp;rsquo;re happy to announce that &lt;a href=&#34;http://testthat.r-lib.org&#34;&gt;testthat 2.1.0&lt;/a&gt; is now available on CRAN! testthat makes it easy to turn your existing informal tests into formal automated tests that you can rerun quickly and easily. testthat is the most popular unit-testing package for R, and is used by over 4,000 CRAN and Bioconductor packages. You can learn more about unit testing at &lt;a href=&#34;https://r-pkgs.org/tests.html&#34;&gt;https://r-pkgs.org/tests.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Install the latest version of testthat with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;testthat&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;p&gt;testthat 2.1.0 mostly contains a large number of minor improvements and bug fixes, as described in the &lt;a href=&#34;https://github.com/r-lib/testthat/releases/tag/v2.1.0&#34;&gt;release notes&lt;/a&gt;. This blog post discusses the bigger improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;context()&lt;/code&gt;s are now optional.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Two new expectations: &lt;code&gt;expect_invisible()&lt;/code&gt; and &lt;code&gt;expect_mapequal()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;context-is-now-optional&#34;&gt;&lt;code&gt;context()&lt;/code&gt; is now optional
  &lt;a href=&#34;#context-is-now-optional&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The biggest change in this version is that &lt;code&gt;context()&lt;/code&gt; is now optional, and in fact we recommend that you no longer use it. &lt;code&gt;context()&lt;/code&gt; made sense with the original design of testthat, which supported a very flexible mapping between your R code and the corresponding tests.&lt;/p&gt;
&lt;p&gt;Now, however, we have a stronger recommendation: organise the files in &lt;code&gt;tests/testthat&lt;/code&gt; in the same way that you organise the files in &lt;code&gt;R/&lt;/code&gt;, so that tests for code in &lt;code&gt;R/my-file.R&lt;/code&gt; live in &lt;code&gt;tests/testthat-my-file.R&lt;/code&gt;. (This begs the question of how you should organise your &lt;code&gt;R/&lt;/code&gt; directory, which we don&amp;rsquo;t have a good answer for yet, but at least you only need to struggle to organise one directory). With this convention, &lt;code&gt;context()&lt;/code&gt; tends to end up duplicating the file name, causing needless hassle if you reorganise your code structure.&lt;/p&gt;
&lt;p&gt;The convention that every file in &lt;code&gt;R/&lt;/code&gt; has a corresponding file in &lt;code&gt;tests/testthat&lt;/code&gt; (and vice versa) is used by two other helpful functions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;usethis::use_test()&lt;/code&gt;, which, if you use RStudio, will automatically
create and open a test file corresponding to the R file in the right
location. (If you&amp;rsquo;ve written the test file first, you can instead use
&lt;code&gt;usethis::use_r()&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;devtools::test_coverage_file()&lt;/code&gt;: again, if you use RStudio, this will look
at the active file, run just the tests for that file, and report the coverage
results. This is a great way to rapidly iterate to ensure that you have
tested all the branches of new code.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;new-expectations&#34;&gt;New expectations
  &lt;a href=&#34;#new-expectations&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&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;testthat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This version of testthat introduces two important new expectations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;expect_invisible()&lt;/code&gt; makes it easier to check if a function returns its
results invisibly. This is useful if you are testing a function that is
called primarily for its side-effects, which should (as a general rule)
invisibly return its first 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;greet&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;cat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Hello &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;!\n&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;span class=&#34;nf&#34;&gt;invisible&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
    
&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;expect_invisible&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;greet&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Hadley&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Hello Hadley!&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;expect_equal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Hadley&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;p&gt;For symmetry, &lt;code&gt;expect_visible()&lt;/code&gt; is also available, but you would not
generally test for it, as visible return values are the default.
Only use it if you find a bug related to visibilty and want to
programmatically verify that it&amp;rsquo;s fixed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;New &lt;code&gt;expect_mapequal(x, y)&lt;/code&gt; checks that &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; have the same names,
and the same value associated with each name (i.e. it compares the values
of the vector standardising the order of the names).&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;exp&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;expect_mapequal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;exp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;expect_mapequal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;exp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
    
&lt;span class=&#34;nf&#34;&gt;expect_mapequal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;exp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Names absent from `object`: &amp;#34;a&amp;#34;,&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;expect_mapequal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;exp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: act$val[exp_nms] not equal to exp$val.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Component &amp;#34;a&amp;#34;: Mean relative difference: 0.6666667&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;expect_mapequal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;exp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Names absent from `expected`: &amp;#34;c&amp;#34;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;expect_mapequal()&lt;/code&gt; is related to &lt;code&gt;expect_setequal()&lt;/code&gt;, which compares
values, ignoring order and count:&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;expect_setequal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;expect_setequal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;b&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;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;A big thanks to all 51 people who helped contribute to this release by reporting bugs, suggesting new features, or creating pull requests: &lt;a href=&#34;https://github.com/aabor&#34;&gt;@aabor&lt;/a&gt;, &lt;a href=&#34;https://github.com/AEBilgrau&#34;&gt;@AEBilgrau&lt;/a&gt;, &lt;a href=&#34;https://github.com/antaldaniel&#34;&gt;@antaldaniel&lt;/a&gt;, &lt;a href=&#34;https://github.com/bflammers&#34;&gt;@bflammers&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/BillDunlap&#34;&gt;@BillDunlap&lt;/a&gt;, &lt;a href=&#34;https://github.com/Bisaloo&#34;&gt;@Bisaloo&lt;/a&gt;, &lt;a href=&#34;https://github.com/burchill&#34;&gt;@burchill&lt;/a&gt;, &lt;a href=&#34;https://github.com/chasemc&#34;&gt;@chasemc&lt;/a&gt;, &lt;a href=&#34;https://github.com/colearendt&#34;&gt;@colearendt&lt;/a&gt;, &lt;a href=&#34;https://github.com/comicfans&#34;&gt;@comicfans&lt;/a&gt;, &lt;a href=&#34;https://github.com/dmenne&#34;&gt;@dmenne&lt;/a&gt;, &lt;a href=&#34;https://github.com/euklid321&#34;&gt;@euklid321&lt;/a&gt;, &lt;a href=&#34;https://github.com/flying-sheep&#34;&gt;@flying-sheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/gaborcsardi&#34;&gt;@gaborcsardi&lt;/a&gt;, &lt;a href=&#34;https://github.com/gabrielodom&#34;&gt;@gabrielodom&lt;/a&gt;, &lt;a href=&#34;https://github.com/gvwilson&#34;&gt;@gvwilson&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/harvey131&#34;&gt;@harvey131&lt;/a&gt;, &lt;a href=&#34;https://github.com/Hong-Revo&#34;&gt;@Hong-Revo&lt;/a&gt;, &lt;a href=&#34;https://github.com/HughParsonage&#34;&gt;@HughParsonage&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackhannah95&#34;&gt;@jackhannah95&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackwasey&#34;&gt;@jackwasey&lt;/a&gt;, &lt;a href=&#34;https://github.com/jarodmeng&#34;&gt;@jarodmeng&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jsilve24&#34;&gt;@jsilve24&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinushey&#34;&gt;@kevinushey&lt;/a&gt;, &lt;a href=&#34;https://github.com/kforner&#34;&gt;@kforner&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/maelle&#34;&gt;@maelle&lt;/a&gt;, &lt;a href=&#34;https://github.com/markvanderloo&#34;&gt;@markvanderloo&lt;/a&gt;, &lt;a href=&#34;https://github.com/masaha03&#34;&gt;@masaha03&lt;/a&gt;, &lt;a href=&#34;https://github.com/mb706&#34;&gt;@mb706&lt;/a&gt;, &lt;a href=&#34;https://github.com/mbjoseph&#34;&gt;@mbjoseph&lt;/a&gt;, &lt;a href=&#34;https://github.com/merliseclyde&#34;&gt;@merliseclyde&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikejiang&#34;&gt;@mikejiang&lt;/a&gt;, &lt;a href=&#34;https://github.com/Mooskey&#34;&gt;@Mooskey&lt;/a&gt;, &lt;a href=&#34;https://github.com/olsgaard&#34;&gt;@olsgaard&lt;/a&gt;, &lt;a href=&#34;https://github.com/patr1ckm&#34;&gt;@patr1ckm&lt;/a&gt;, &lt;a href=&#34;https://github.com/ramiromagno&#34;&gt;@ramiromagno&lt;/a&gt;, &lt;a href=&#34;https://github.com/randy3k&#34;&gt;@randy3k&lt;/a&gt;, &lt;a href=&#34;https://github.com/renkun-ken&#34;&gt;@renkun-ken&lt;/a&gt;, &lt;a href=&#34;https://github.com/smbache&#34;&gt;@smbache&lt;/a&gt;, &lt;a href=&#34;https://github.com/stevecondylios&#34;&gt;@stevecondylios&lt;/a&gt;, &lt;a href=&#34;https://github.com/topepo&#34;&gt;@topepo&lt;/a&gt;, &lt;a href=&#34;https://github.com/tramontini&#34;&gt;@tramontini&lt;/a&gt;, &lt;a href=&#34;https://github.com/wch&#34;&gt;@wch&lt;/a&gt;, &lt;a href=&#34;https://github.com/wsherwin&#34;&gt;@wsherwin&lt;/a&gt;, &lt;a href=&#34;https://github.com/Yuri-M-Dias&#34;&gt;@Yuri-M-Dias&lt;/a&gt;, &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zappingseb&#34;&gt;@zappingseb&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>usethis 1.5.0</title>
      <link>https://www.tidyverse.org/blog/2019/04/usethis-1.5.0/</link>
      <pubDate>Tue, 09 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/04/usethis-1.5.0/</guid>
      <description>We&amp;rsquo;re gratified to announce that usethis 1.5.0 is now available on CRAN. Learn more about usethis at https://usethis.r-lib.org. Detailed notes are always in the change log.
usethis is a package that facilitates interactive workflows for R project creation and development. It has broad coverage of package development tasks, but many of its functions are also applicable to non-package projects.
usethis is part of the package development toolkit whose main public face is the venerable devtools package.</description>
      <content>&lt;p&gt;We&amp;rsquo;re gratified to announce that &lt;a href=&#34;https://usethis.r-lib.org&#34;&gt;usethis&lt;/a&gt; 1.5.0 is now available on CRAN. Learn more about usethis at &lt;a href=&#34;https://usethis.r-lib.org&#34;&gt;https://usethis.r-lib.org&lt;/a&gt;. Detailed notes are always in the &lt;a href=&#34;https://usethis.r-lib.org/news/index.html&#34;&gt;change log&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;usethis is a package that facilitates interactive workflows for R project creation and development. It has broad coverage of package development tasks, but many of its functions are also applicable to non-package projects.&lt;/p&gt;
&lt;p&gt;usethis is part of the package development toolkit whose main public face is the venerable &lt;a href=&#34;https://devtools.r-lib.org&#34;&gt;devtools&lt;/a&gt; package. When devtools went through its &lt;a href=&#34;https://www.tidyverse.org/articles/2018/10/devtools-2-0-0/#conscious-uncoupling&#34;&gt;conscious uncoupling&lt;/a&gt;, the functionality related to package/project setup landed in usethis.&lt;/p&gt;
&lt;p&gt;Install the latest release of usethis like so:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;usethis&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;p&gt;devtools exposes all of usethis&amp;rsquo;s functions and most users should just use &lt;code&gt;library(devtools)&lt;/code&gt; to make usethis available in the session.&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;devtools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is also, of course, possible to just attach usethis specifically.&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;usethis&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;usethis::use_devtools()&lt;/code&gt; can help you put a code snippet in your &lt;code&gt;.Rprofile&lt;/code&gt; to do this automatically at startup for interactive sessions.&lt;/p&gt;




&lt;h2 id=&#34;overview-of-recent-developments&#34;&gt;Overview of recent developments
  &lt;a href=&#34;#overview-of-recent-developments&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We last blogged about usethis in February 2018, at the &lt;a href=&#34;https://www.tidyverse.org/articles/2018/02/usethis-1-3-0/&#34;&gt;release of v1.3.0&lt;/a&gt;, so there&amp;rsquo;s a lot to catch up on! We&amp;rsquo;ll cover cumulative developments in v1.4.0 and v1.5.0. The current release also marks the passing of the maintainership torch from Hadley Wickham to Jenny Bryan.&lt;/p&gt;
&lt;p&gt;Main themes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Improve support for the Git/GitHub aspects of project initiation and development.&lt;/li&gt;
&lt;li&gt;Make it possible for others to extend usethis, i.e. to implement specialized workflows or organization-specific standards.&lt;/li&gt;
&lt;li&gt;Implement what the tidyverse/r-lib team regards as best practices, often in functions that feature the word &amp;ldquo;tidy&amp;rdquo;. These are mostly for our use and are, honestly, occasionally aspirational, but others may find it interesting or useful.&lt;/li&gt;
&lt;li&gt;Embrace the &lt;a href=&#34;https://fs.r-lib.org&#34;&gt;fs package&lt;/a&gt; internally for everything related to filepath management. We&amp;rsquo;re also gradually adding better tooling for programmatic management of specific files or for specific parts of a file, such as the badge section of &lt;code&gt;README.Rmd&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Below we highlight specific changes or new features that are of special interest to users. Again, detailed notes are in the &lt;a href=&#34;https://usethis.r-lib.org/news/index.html&#34;&gt;change log&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;options-to-set-in-rprofile&#34;&gt;Options to set in &lt;code&gt;.Rprofile&lt;/code&gt;
  &lt;a href=&#34;#options-to-set-in-rprofile&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;usethis consults certain options when it creates a new package and, if found, it favors this info over built-in defaults when populating the DESCRIPTION fields. devtools has long had this feature, but it&amp;rsquo;s a good time to open your &lt;code&gt;.Rprofile&lt;/code&gt; (maybe via &lt;code&gt;usethis::edit_r_profile()&lt;/code&gt;) and refresh your settings to look more like so:&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;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;usethis.full_name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Jane Doe&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;usethis.description&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;`Authors@R`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#39;person(&amp;#34;Jane&amp;#34;, &amp;#34;Doe&amp;#34;, email = &amp;#34;jane@example.com&amp;#34;, role = c(&amp;#34;aut&amp;#34;, &amp;#34;cre&amp;#34;), 
&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;    comment = c(ORCID = &amp;#34;YOUR-ORCID-ID&amp;#34;))&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;License&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;MIT + file LICENSE&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
    &lt;span class=&#34;n&#34;&gt;Version&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;0.0.0.9000&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;usethis.protocol&lt;/span&gt;  &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;ssh&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;p&gt;Note the &lt;code&gt;usethis.*&lt;/code&gt; name prefixes and that field-specific options like &lt;code&gt;devtools.desc.author&lt;/code&gt; and &lt;code&gt;devtools.desc.license&lt;/code&gt; have been replaced with a single named list, &lt;code&gt;usethis.description&lt;/code&gt;. If you are firmly an &amp;ldquo;SSH person&amp;rdquo; or an &amp;ldquo;HTTPS person&amp;rdquo;, in terms of your preferred Git transport protocol, this is a great place to express that. It affects remote URLs created by usethis.&lt;/p&gt;
&lt;p&gt;More setup tips can be found in the &lt;a href=&#34;https://usethis.r-lib.org/articles/articles/usethis-setup.html&#34;&gt;usethis setup article&lt;/a&gt;. For example, you will unlock a lot of usethis&amp;rsquo;s GitHub functionality by setting up a personal access token. &lt;code&gt;usethis::browse_github_token()&lt;/code&gt; walks you through that process.&lt;/p&gt;




&lt;h2 id=&#34;git-and-github&#34;&gt;Git and GitHub
  &lt;a href=&#34;#git-and-github&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;git_sitrep()&lt;/code&gt; function gives a &lt;strong&gt;rep&lt;/strong&gt;ort on your current &lt;strong&gt;sit&lt;/strong&gt;uation as a Git and GitHub user and specifics on the current repo&amp;rsquo;s remotes and branches. Here&amp;rsquo;s an example where Jane Doe is working in a local copy of OWNER&amp;rsquo;s package, maybe preparing to contribute a bug fix or new feature:&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;usethis&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;git_sitrep&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Git user&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Name: &amp;#39;Jane Doe&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Email: &amp;#39;jane.doe@example.com&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Vaccinated: TRUE&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; usethis + git2r&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Default usethis protocol: &amp;#39;ssh&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * git2r supports SSH: TRUE&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Credentials: &amp;#39;&amp;lt;usethis + git2r default behaviour&amp;gt;&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; GitHub&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Personal access token: &amp;#39;&amp;lt;found in env var&amp;gt;&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * User: &amp;#39;janedoe&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Name: &amp;#39;Jane Doe&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Repo&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Path: &amp;#39;/Users/jane/tmp/REPO/.git&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Local branch -&amp;gt; remote tracking branch: &amp;#39;master&amp;#39; -&amp;gt; &amp;#39;origin/master&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; GitHub pull request readiness&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * origin: janedoe/REPO, can push, forked from OWNER/REPO&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * upstream: OWNER/REPO, read only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;git_vaccinate()&lt;/code&gt; makes sure your global, i.e. user-level, gitignore file contains entries relevant to useRs. You are less likely to push confidential or unnecessary and semi-embarrassing information to GitHub if you gitignore files like &lt;code&gt;.Rhistory&lt;/code&gt; and &lt;code&gt;.Rdata&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Several other new functions are mostly for internal use but can also be used for troubleshooting and taking greater control of the Git side of usethis: &lt;code&gt;git_remotes()&lt;/code&gt;, &lt;code&gt;use_git_remote()&lt;/code&gt;, &lt;code&gt;git_protocol()&lt;/code&gt;, &lt;code&gt;use_git_protocol()&lt;/code&gt;, &lt;code&gt;git_credentials()&lt;/code&gt;, &lt;code&gt;use_git_credentials()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Two existing functions keep improving and deserve a mention:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;create_from_github(&amp;quot;OWNER/REPO)&lt;/code&gt; creates a local project from a GitHub repository. It&amp;rsquo;s pretty smart about when it should clone vs fork-and-clone (or you can specify this) and, when it forks, it sets up the &lt;code&gt;origin&lt;/code&gt; and &lt;code&gt;upstream&lt;/code&gt; remotes correctly.&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;usethis&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;create_from_github&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;OWNER/REPO&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;protocol&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;ssh&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ Creating &amp;#39;/Users/jane/rrr/REPO/&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ Forking &amp;#39;OWNER/REPO&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ Cloning repo from &amp;#39;git@github.com:janedoe/REPO.git&amp;#39; into &amp;#39;/Users/jane/rrr/REPO&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ Setting active project to &amp;#39;/Users/jane/rrr/REPO&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ Adding &amp;#39;upstream&amp;#39; remote: &amp;#39;git@github.com:OWNER/REPO.git&amp;#39;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; ✔ Pulling changes from GitHub source repo &amp;#39;upstream/master&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;use_github()&lt;/code&gt; connects an existing local repo to GitHub &lt;em&gt;post hoc&lt;/em&gt;. It is more robust and, when it fails, it does so early and with actionable messages about what you can fix.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A new experimental family of &lt;code&gt;pr_*()&lt;/code&gt; functions makes GitHub pull requests (PR) easier, both for maintainers and contributors. We&amp;rsquo;re quite excited about these, as we handle an extraordinary number of pull requests across the tidyverse, r-lib, and tidymodels organizations. For maintainers, &lt;code&gt;pr_fetch(&amp;lt;PR_NUMBER&amp;gt;)&lt;/code&gt; allows you to check out a PR locally, explore it, check/test it, or even fix or extend it. &lt;code&gt;pr_push()&lt;/code&gt; &lt;a href=&#34;https://help.github.com/en/articles/committing-changes-to-a-pull-request-branch-created-from-a-fork&#34;&gt;pushes &lt;em&gt;back into the actual PR&lt;/em&gt;&lt;/a&gt;, where it can now be merged or receive more work from the original author. For contributors, &lt;code&gt;pr_init()&lt;/code&gt; and &lt;code&gt;pr_push()&lt;/code&gt; help to initiate a PR. In all cases, &lt;code&gt;pr_finish()&lt;/code&gt; does the necessary local clean up when the PR is no longer in play.&lt;/p&gt;




&lt;h2 id=&#34;extending-usethis&#34;&gt;Extending usethis
  &lt;a href=&#34;#extending-usethis&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;ve made usethis easier for others to wrap and extend:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;usethis is very chatty and this is now under the control of the option &lt;code&gt;usethis.quiet&lt;/code&gt;. This makes it easier for a wrapper to muffle usethis&amp;rsquo;s messaging or to temporarily toggle it with functions like &lt;code&gt;withr::with_options()&lt;/code&gt; or &lt;code&gt;withr::local_options()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Project-related helpers &lt;code&gt;proj_path()&lt;/code&gt;, &lt;code&gt;with_project()&lt;/code&gt;, &lt;code&gt;local_project()&lt;/code&gt;, and &lt;code&gt;proj_activate()&lt;/code&gt; are exported.&lt;/li&gt;
&lt;li&gt;File editing helpers &lt;code&gt;edit_file()&lt;/code&gt;, &lt;code&gt;write_over()&lt;/code&gt;, and &lt;code&gt;write_union()&lt;/code&gt; are exported.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;use_template()&lt;/code&gt; can use a template file stored in any package, not just usethis.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&amp;rsquo;ve also exported the &lt;code&gt;ui_*()&lt;/code&gt; functions that implement usethis&amp;rsquo;s messaging, conditions, and interactive menus. This is in response to repeated community requests. These functions benefit greatly from the &lt;a href=&#34;https://glue.tidyverse.org&#34;&gt;glue&lt;/a&gt; and &lt;a href=&#34;https://github.com/r-lib/crayon#readme&#34;&gt;crayon&lt;/a&gt; packages to provide nifty features like string interpolation and formatting.&lt;/p&gt;
&lt;p&gt;There are inline styles (&lt;code&gt;ui_field()&lt;/code&gt;, &lt;code&gt;ui_value()&lt;/code&gt;, &lt;code&gt;ui_path()&lt;/code&gt;, &lt;code&gt;ui_code()&lt;/code&gt;), which can be used within the block styles (&lt;code&gt;ui_line()&lt;/code&gt;, &lt;code&gt;ui_done()&lt;/code&gt;, &lt;code&gt;ui_todo()&lt;/code&gt;, &lt;code&gt;ui_oops()&lt;/code&gt;, &lt;code&gt;ui_info()&lt;/code&gt;). Some example usage (flanking newlines added for readability):&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/usethis-1.5.0/ui-done-todo-oops-info.png&#34;/&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ui_stop()&lt;/code&gt; and &lt;code&gt;ui_warn()&lt;/code&gt; raise the associated condition, but with the same features for the message:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/usethis-1.5.0/ui-stop-warn.png&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Finally, &lt;code&gt;ui_yeah()&lt;/code&gt; and &lt;code&gt;ui_nope()&lt;/code&gt; facilitate control flow based on user input:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/usethis-1.5.0/ui-nope-yeah.png&#34;/&gt;&lt;/p&gt;
&lt;p&gt;These functions may ultimately move to a more appropriate home, so we can use them to create a more consistent UI across a broad set of tidyverse, r-lib, and tidymodels packages.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;!-- use_tidy_thanks(from = &#34;v1.3.0&#34;, to = &#34;v1.5.0&#34;) --&gt;
&lt;p&gt;We give a tremendous thanks to the 108 useRs who contributed to the v1.4.0 and v1.5.0 releases, especially those who joined us at the inaugural &lt;a href=&#34;https://www.tidyverse.org/articles/2018/11/tidyverse-developer-day-2019/&#34;&gt;Tidyverse Developer Day&lt;/a&gt; following &lt;a href=&#34;https://www.rstudio.com/conference/&#34;&gt;rstudio::conf 2019&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/Aariq&#34;&gt;@Aariq&lt;/a&gt;, &lt;a href=&#34;https://github.com/adam-gruer&#34;&gt;@adam-gruer&lt;/a&gt;, &lt;a href=&#34;https://github.com/akgold&#34;&gt;@akgold&lt;/a&gt;, &lt;a href=&#34;https://github.com/alandipert&#34;&gt;@alandipert&lt;/a&gt;, &lt;a href=&#34;https://github.com/alexpghayes&#34;&gt;@alexpghayes&lt;/a&gt;, &lt;a href=&#34;https://github.com/andrie&#34;&gt;@andrie&lt;/a&gt;, &lt;a href=&#34;https://github.com/angela-li&#34;&gt;@angela-li&lt;/a&gt;, &lt;a href=&#34;https://github.com/apreshill&#34;&gt;@apreshill&lt;/a&gt;, &lt;a href=&#34;https://github.com/atheriel&#34;&gt;@atheriel&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/beanumber&#34;&gt;@beanumber&lt;/a&gt;, &lt;a href=&#34;https://github.com/behrman&#34;&gt;@behrman&lt;/a&gt;, &lt;a href=&#34;https://github.com/benmarwick&#34;&gt;@benmarwick&lt;/a&gt;, &lt;a href=&#34;https://github.com/bestdan&#34;&gt;@bestdan&lt;/a&gt;, &lt;a href=&#34;https://github.com/bfgray3&#34;&gt;@bfgray3&lt;/a&gt;, &lt;a href=&#34;https://github.com/boshek&#34;&gt;@boshek&lt;/a&gt;, &lt;a href=&#34;https://github.com/cboettig&#34;&gt;@cboettig&lt;/a&gt;, &lt;a href=&#34;https://github.com/cderv&#34;&gt;@cderv&lt;/a&gt;, &lt;a href=&#34;https://github.com/chris-billingham&#34;&gt;@chris-billingham&lt;/a&gt;, &lt;a href=&#34;https://github.com/Chris-Engelhardt&#34;&gt;@Chris-Engelhardt&lt;/a&gt;, &lt;a href=&#34;https://github.com/chris-prener&#34;&gt;@chris-prener&lt;/a&gt;, &lt;a href=&#34;https://github.com/coatless&#34;&gt;@coatless&lt;/a&gt;, &lt;a href=&#34;https://github.com/colearendt&#34;&gt;@colearendt&lt;/a&gt;, &lt;a href=&#34;https://github.com/cwickham&#34;&gt;@cwickham&lt;/a&gt;, &lt;a href=&#34;https://github.com/dirkschumacher&#34;&gt;@dirkschumacher&lt;/a&gt;, &lt;a href=&#34;https://github.com/dpprdan&#34;&gt;@dpprdan&lt;/a&gt;, &lt;a href=&#34;https://github.com/dragosmg&#34;&gt;@dragosmg&lt;/a&gt;, &lt;a href=&#34;https://github.com/duckmayr&#34;&gt;@duckmayr&lt;/a&gt;, &lt;a href=&#34;https://github.com/echasnovski&#34;&gt;@echasnovski&lt;/a&gt;, &lt;a href=&#34;https://github.com/EmilHvitfeldt&#34;&gt;@EmilHvitfeldt&lt;/a&gt;, &lt;a href=&#34;https://github.com/erictleung&#34;&gt;@erictleung&lt;/a&gt;, &lt;a href=&#34;https://github.com/etiennebr&#34;&gt;@etiennebr&lt;/a&gt;, &lt;a href=&#34;https://github.com/Fazendaaa&#34;&gt;@Fazendaaa&lt;/a&gt;, &lt;a href=&#34;https://github.com/friendly&#34;&gt;@friendly&lt;/a&gt;, &lt;a href=&#34;https://github.com/gaborcsardi&#34;&gt;@gaborcsardi&lt;/a&gt;, &lt;a href=&#34;https://github.com/gadenbuie&#34;&gt;@gadenbuie&lt;/a&gt;, &lt;a href=&#34;https://github.com/GregorDeCillia&#34;&gt;@GregorDeCillia&lt;/a&gt;, &lt;a href=&#34;https://github.com/GShotwell&#34;&gt;@GShotwell&lt;/a&gt;, &lt;a href=&#34;https://github.com/gvelasq&#34;&gt;@gvelasq&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hafen&#34;&gt;@hafen&lt;/a&gt;, &lt;a href=&#34;https://github.com/HanjoStudy&#34;&gt;@HanjoStudy&lt;/a&gt;, &lt;a href=&#34;https://github.com/haozhu233&#34;&gt;@haozhu233&lt;/a&gt;, &lt;a href=&#34;https://github.com/heavywatal&#34;&gt;@heavywatal&lt;/a&gt;, &lt;a href=&#34;https://github.com/ijlyttle&#34;&gt;@ijlyttle&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/jackwasey&#34;&gt;@jackwasey&lt;/a&gt;, &lt;a href=&#34;https://github.com/Jadamso&#34;&gt;@Jadamso&lt;/a&gt;, &lt;a href=&#34;https://github.com/jayhesselberth&#34;&gt;@jayhesselberth&lt;/a&gt;, &lt;a href=&#34;https://github.com/JBGruber&#34;&gt;@JBGruber&lt;/a&gt;, &lt;a href=&#34;https://github.com/jdblischak&#34;&gt;@jdblischak&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jjchern&#34;&gt;@jjchern&lt;/a&gt;, &lt;a href=&#34;https://github.com/jmgirard&#34;&gt;@jmgirard&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonocarroll&#34;&gt;@jonocarroll&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;@jonthegeek&lt;/a&gt;, &lt;a href=&#34;https://github.com/jooyoungseo&#34;&gt;@jooyoungseo&lt;/a&gt;, &lt;a href=&#34;https://github.com/jsta&#34;&gt;@jsta&lt;/a&gt;, &lt;a href=&#34;https://github.com/jtr13&#34;&gt;@jtr13&lt;/a&gt;, &lt;a href=&#34;https://github.com/karawoo&#34;&gt;@karawoo&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinushey&#34;&gt;@kevinushey&lt;/a&gt;, &lt;a href=&#34;https://github.com/khailper&#34;&gt;@khailper&lt;/a&gt;, &lt;a href=&#34;https://github.com/kiwiroy&#34;&gt;@kiwiroy&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/lbusett&#34;&gt;@lbusett&lt;/a&gt;, &lt;a href=&#34;https://github.com/leonawicz&#34;&gt;@leonawicz&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/llrs&#34;&gt;@llrs&lt;/a&gt;, &lt;a href=&#34;https://github.com/lorenzwalthert&#34;&gt;@lorenzwalthert&lt;/a&gt;, &lt;a href=&#34;https://github.com/lwjohnst86&#34;&gt;@lwjohnst86&lt;/a&gt;, &lt;a href=&#34;https://github.com/maelle&#34;&gt;@maelle&lt;/a&gt;, &lt;a href=&#34;https://github.com/maislind&#34;&gt;@maislind&lt;/a&gt;, &lt;a href=&#34;https://github.com/markdly&#34;&gt;@markdly&lt;/a&gt;, &lt;a href=&#34;https://github.com/martinjhnhadley&#34;&gt;@martinjhnhadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/MatthieuStigler&#34;&gt;@MatthieuStigler&lt;/a&gt;, &lt;a href=&#34;https://github.com/maurolepore&#34;&gt;@maurolepore&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxheld83&#34;&gt;@maxheld83&lt;/a&gt;, &lt;a href=&#34;https://github.com/mdlincoln&#34;&gt;@mdlincoln&lt;/a&gt;, &lt;a href=&#34;https://github.com/mine-cetinkaya-rundel&#34;&gt;@mine-cetinkaya-rundel&lt;/a&gt;, &lt;a href=&#34;https://github.com/MishaCivey&#34;&gt;@MishaCivey&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkearney&#34;&gt;@mkearney&lt;/a&gt;, &lt;a href=&#34;https://github.com/move%5Bbot%5D&#34;&gt;@move[bot]&lt;/a&gt;, &lt;a href=&#34;https://github.com/muschellij2&#34;&gt;@muschellij2&lt;/a&gt;, &lt;a href=&#34;https://github.com/nbrgraphs&#34;&gt;@nbrgraphs&lt;/a&gt;, &lt;a href=&#34;https://github.com/nijibabulu&#34;&gt;@nijibabulu&lt;/a&gt;, &lt;a href=&#34;https://github.com/njtierney&#34;&gt;@njtierney&lt;/a&gt;, &lt;a href=&#34;https://github.com/noamross&#34;&gt;@noamross&lt;/a&gt;, &lt;a href=&#34;https://github.com/overmar&#34;&gt;@overmar&lt;/a&gt;, &lt;a href=&#34;https://github.com/pat-s&#34;&gt;@pat-s&lt;/a&gt;, &lt;a href=&#34;https://github.com/petermeissner&#34;&gt;@petermeissner&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/rorynolan&#34;&gt;@rorynolan&lt;/a&gt;, &lt;a href=&#34;https://github.com/ryapric&#34;&gt;@ryapric&lt;/a&gt;, &lt;a href=&#34;https://github.com/sriharitn&#34;&gt;@sriharitn&lt;/a&gt;, &lt;a href=&#34;https://github.com/statquant&#34;&gt;@statquant&lt;/a&gt;, &lt;a href=&#34;https://github.com/statwonk&#34;&gt;@statwonk&lt;/a&gt;, &lt;a href=&#34;https://github.com/strboul&#34;&gt;@strboul&lt;/a&gt;, &lt;a href=&#34;https://github.com/stufield&#34;&gt;@stufield&lt;/a&gt;, &lt;a href=&#34;https://github.com/tgerke&#34;&gt;@tgerke&lt;/a&gt;, &lt;a href=&#34;https://github.com/thomasp85&#34;&gt;@thomasp85&lt;/a&gt;, &lt;a href=&#34;https://github.com/topepo&#34;&gt;@topepo&lt;/a&gt;, &lt;a href=&#34;https://github.com/trestletech&#34;&gt;@trestletech&lt;/a&gt;, &lt;a href=&#34;https://github.com/VerenaHeld&#34;&gt;@VerenaHeld&lt;/a&gt;, &lt;a href=&#34;https://github.com/VincentGuyader&#34;&gt;@VincentGuyader&lt;/a&gt;, &lt;a href=&#34;https://github.com/vnijs&#34;&gt;@vnijs&lt;/a&gt;, &lt;a href=&#34;https://github.com/webbedfeet&#34;&gt;@webbedfeet&lt;/a&gt;, and &lt;a href=&#34;https://github.com/wlandau&#34;&gt;@wlandau&lt;/a&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>R version support</title>
      <link>https://www.tidyverse.org/blog/2019/04/r-version-support/</link>
      <pubDate>Mon, 01 Apr 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/04/r-version-support/</guid>
      <description>Which versions of R do tidyverse packages support?     Though package-specific minimum versions of R are given in the Depends fields of individual DESCRIPTION files, our general policy is to support the current version, the devel version, and four previous versions of R.
With the prerelease of R version 3.6.0 (Planting of a Tree) already available, and its final release slated for 2019-04-26, you can expect tidyverse packages to drop support for R 3.</description>
      <content>



&lt;h2 id=&#34;which-versions-of-r-do-tidyverse-packages-support&#34;&gt;Which versions of R do tidyverse packages support?
  &lt;a href=&#34;#which-versions-of-r-do-tidyverse-packages-support&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Though package-specific minimum versions of R are given in the &lt;code&gt;Depends&lt;/code&gt; fields of individual &lt;code&gt;DESCRIPTION&lt;/code&gt; files, our general policy is to support the &lt;strong&gt;current version&lt;/strong&gt;, the &lt;strong&gt;devel version&lt;/strong&gt;, and &lt;strong&gt;four previous versions&lt;/strong&gt; of R.&lt;/p&gt;
&lt;p&gt;With the &lt;a href=&#34;https://cran.r-project.org/src/base-prerelease/&#34;&gt;prerelease of R version 3.6.0 (Planting of a Tree)&lt;/a&gt; already available, and its final release slated for 2019-04-26, you can expect tidyverse packages to drop support for R 3.1 in the coming weeks. This aligns R version support in the tidyverse with &lt;a href=&#34;https://rmarkdown.rstudio.com/&#34;&gt;RMarkdown&lt;/a&gt;, which as of the latest release requires R 3.2.3 (due to an update to the &lt;a href=&#34;https://CRAN.R-project.org/package=highr&#34;&gt;highr&lt;/a&gt; package).&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>tibble 2.1.1</title>
      <link>https://www.tidyverse.org/blog/2019/03/tibble-2.1.1/</link>
      <pubDate>Tue, 19 Mar 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/03/tibble-2.1.1/</guid>
      <description>PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};  Version 2.1.1 of the tibble package is on CRAN now. Tibbles are a modern reimagining of the data frame, keeping what time has shown to be effective, and throwing out what is not, with nicer default output too! Grab the latest version with:
install.packages(&amp;#34;tibble&amp;#34;) This release mostly focuses on the name repair introduced in tibble 2.0.1. We have specific regrets about one aspect of name repair and we think the pros of fixing it outweigh the cons: when a column name is completely absent, the numbered suffix we add becomes the entire name.</description>
      <content>&lt;STYLE type=&#39;text/css&#39; scoped&gt;
PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};
&lt;/STYLE&gt;
&lt;p&gt;Version 2.1.1 of the &lt;em&gt;tibble&lt;/em&gt; package is on CRAN now. Tibbles are a modern reimagining of the data frame, keeping what time has shown to be effective, and throwing out what is not, with nicer default output too! Grab the latest version with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tibble&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;p&gt;This release mostly focuses on the name repair introduced in &lt;em&gt;tibble&lt;/em&gt; 2.0.1.
We have specific regrets about one aspect of name repair and we think the pros of fixing it outweigh the cons:
when a column name is completely absent, the numbered suffix we add becomes the entire name.
Originally, we chose &lt;code&gt;..j&lt;/code&gt; (two dots and a number).
However, that produces names that require special handling, because names of the form &lt;code&gt;..j&lt;/code&gt; have a special meaning: they are reserved words, you can assign them a value but not query them.&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;kc&#34;&gt;..2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;5&lt;/span&gt;
&lt;span class=&#34;kc&#34;&gt;..2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error in eval(expr, envir, enclos): ..2 used in an incorrect context, no ... to look in&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The ability to query a value by name is very important for data frames in general and especially for the tidy evaluation framework:&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;df&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;`..1`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;not ok&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;minimal&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;with&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`..1`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error in eval(substitute(expr), data, enclos = parent.frame()): ..1 used in an incorrect context, no ... to look in&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;dplyr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;df&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`..1`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error in .f(.x[[i]], ...): ..1 used in an incorrect context, no ... to look in&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Since name repair is often something that happens automatically, we think it&amp;rsquo;s best to suffix with &lt;code&gt;...j&lt;/code&gt; (three dots and a number) and leave people with names that are easier to work with.&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;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;unique&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; New names:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `` -&amp;gt; ...1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `` -&amp;gt; ...2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `` -&amp;gt; ...3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 3&lt;/span&gt;
#&amp;gt;    .​.​.1  .​.​.2  .​.​.3
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;     1     2     3&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;p&gt;Existing names of the form &lt;code&gt;..j&lt;/code&gt; (and also &lt;code&gt;...&lt;/code&gt;) are repaired too:&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;..1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;unique&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; New names:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `...` -&amp;gt; ...1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `..1` -&amp;gt; ...2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 2&lt;/span&gt;
#&amp;gt;   .​.​.1  .​.​.2 
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt; a     b&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;p&gt;By extension, this means that names of this form are rejected unless you specify a name repair strategy:&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;..1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Column 1 must not have names of the form ... or ..j.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Use .name_repair to specify repair.&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;..1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;minimal&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 class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 1&lt;/span&gt;
#&amp;gt;   ..1  
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt; a&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;p&gt;For consistency, three dots are used for all disambiguating suffixes, not only for empty names.&lt;/p&gt;
&lt;p&gt;This might affect you if you use &lt;em&gt;readxl&lt;/em&gt; or another package that uses the new name repair, and we&amp;rsquo;re sorry for the disruption.
We&amp;rsquo;re confident that a bit of short-term pain now is better than the agony that would have come from the existent behavior.
Also, name repair currently is in the &amp;ldquo;maturing&amp;rdquo; lifecycle,
Read more about name repair in the &lt;a href=&#34;https://principles.tidyverse.org/names-attribute.html#the-names-attribute-of-an-object&#34;&gt;tidyverse design principles&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.tidyverse.org/images/tibble-2.1.1/dots.jpg&#34;/&gt;&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>stringr 1.4.0</title>
      <link>https://www.tidyverse.org/blog/2019/02/stringr-1-4-0/</link>
      <pubDate>Thu, 21 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/02/stringr-1-4-0/</guid>
      <description>h2 code { font-size: 1em; } 
 We are happy to announce that stringr 1.4.0 is now on CRAN. stringr provides a cohesive set of functions designed to make working with strings as easy as possible. For a full list of changes, please see the release notes.
You can install the released version from CRAN:
install.packages(&amp;#34;stringr&amp;#34;) library(stringr)  New functions     Thanks to the hard work of John Harmon at Tidyverse Developer Day, stringr has three new functions.</description>
      <content>&lt;html&gt;
&lt;style&gt;
h2 code {
    font-size: 1em;
&lt;p&gt;}
&lt;/style&gt;&lt;/p&gt;
&lt;/html&gt;
&lt;p&gt;We are happy to announce that &lt;a href=&#34;http://stringr.tidyverse.org/&#34;&gt;stringr&lt;/a&gt; 1.4.0
is now on CRAN. stringr provides a cohesive set of functions designed to make
working with strings as easy as possible. For a full list of changes, please see the &lt;a href=&#34;https://stringr.tidyverse.org/news/index.html#stringr-1-4-0&#34;&gt;release notes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can install the released version from CRAN:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;stringr&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;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;stringr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;new-functions&#34;&gt;New functions
  &lt;a href=&#34;#new-functions&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to the hard work of &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;John Harmon&lt;/a&gt; at &lt;a href=&#34;https://github.com/tidyverse/dev-day-2019&#34;&gt;Tidyverse Developer Day&lt;/a&gt;, stringr has three new functions.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://stringr.tidyverse.org/reference/str_starts.html&#34;&gt;&lt;code&gt;str_starts()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://stringr.tidyverse.org/reference/str_starts.html&#34;&gt;&lt;code&gt;str_ends()&lt;/code&gt;&lt;/a&gt; detect the presence or absence of patterns at the beginning or end of strings.&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;fruit&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;apple&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;banana&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;pear&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;pineapple&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;str_starts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fruit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;p&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] FALSE FALSE  TRUE  TRUE&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;str_starts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fruit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;p&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;negate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1]  TRUE  TRUE FALSE FALSE&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;str_ends&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fruit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;e&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1]  TRUE FALSE FALSE  TRUE&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;str_ends&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fruit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;e&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;negate&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] FALSE  TRUE  TRUE FALSE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The new &lt;a href=&#34;https://stringr.tidyverse.org/reference/case.html&#34;&gt;&lt;code&gt;str_to_sentence()&lt;/code&gt;&lt;/a&gt; function capitalizes strings with sentence case, like so:&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;str_to_sentence&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;the quick brown dog&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [1] &amp;#34;The quick brown dog&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;support-for-negate&#34;&gt;Support for &lt;code&gt;negate&lt;/code&gt;
  &lt;a href=&#34;#support-for-negate&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://stringr.tidyverse.org/reference/str_subset.html&#34;&gt;&lt;code&gt;str_subset()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://stringr.tidyverse.org/reference/str_detect.html&#34;&gt;&lt;code&gt;str_detect()&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&#34;https://stringr.tidyverse.org/reference/str_subset.html&#34;&gt;&lt;code&gt;str_which()&lt;/code&gt;&lt;/a&gt; now have the &lt;code&gt;negate&lt;/code&gt; argument, which is used to find the elements that do &lt;em&gt;not&lt;/em&gt; match a pattern (as seen above in the &lt;code&gt;str_starts()&lt;/code&gt; and &lt;code&gt;str_ends()&lt;/code&gt; examples).&lt;/p&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thank you to everyone who contributed to this release: &lt;a href=&#34;https://github.com/AmeliaMN&#34;&gt;@AmeliaMN&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/beckymaust&#34;&gt;@beckymaust&lt;/a&gt;, &lt;a href=&#34;https://github.com/BenjaminLouis&#34;&gt;@BenjaminLouis&lt;/a&gt;, &lt;a href=&#34;https://github.com/blablablerg&#34;&gt;@blablablerg&lt;/a&gt;, &lt;a href=&#34;https://github.com/bschneidr&#34;&gt;@bschneidr&lt;/a&gt;, &lt;a href=&#34;https://github.com/bwiernik&#34;&gt;@bwiernik&lt;/a&gt;, &lt;a href=&#34;https://github.com/ctmann&#34;&gt;@ctmann&lt;/a&gt;, &lt;a href=&#34;https://github.com/damianooldoni&#34;&gt;@damianooldoni&lt;/a&gt;, &lt;a href=&#34;https://github.com/dan-reznik&#34;&gt;@dan-reznik&lt;/a&gt;, &lt;a href=&#34;https://github.com/denrou&#34;&gt;@denrou&lt;/a&gt;, &lt;a href=&#34;https://github.com/diegogarcilazo&#34;&gt;@diegogarcilazo&lt;/a&gt;, &lt;a href=&#34;https://github.com/DieselAnalytics&#34;&gt;@DieselAnalytics&lt;/a&gt;, &lt;a href=&#34;https://github.com/elisakreiss&#34;&gt;@elisakreiss&lt;/a&gt;, &lt;a href=&#34;https://github.com/giovannikraushaar&#34;&gt;@giovannikraushaar&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hammer&#34;&gt;@hammer&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonocarroll&#34;&gt;@jonocarroll&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;@jonthegeek&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrnold&#34;&gt;@jrnold&lt;/a&gt;, &lt;a href=&#34;https://github.com/juanrocha&#34;&gt;@juanrocha&lt;/a&gt;, &lt;a href=&#34;https://github.com/kmace&#34;&gt;@kmace&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/osorensen&#34;&gt;@osorensen&lt;/a&gt;, &lt;a href=&#34;https://github.com/paleolimbot&#34;&gt;@paleolimbot&lt;/a&gt;, &lt;a href=&#34;https://github.com/pdelboca&#34;&gt;@pdelboca&lt;/a&gt;, &lt;a href=&#34;https://github.com/pgrandinetti&#34;&gt;@pgrandinetti&lt;/a&gt;, &lt;a href=&#34;https://github.com/PirateGrunt&#34;&gt;@PirateGrunt&lt;/a&gt;, &lt;a href=&#34;https://github.com/samhinshaw&#34;&gt;@samhinshaw&lt;/a&gt;, &lt;a href=&#34;https://github.com/sastoudt&#34;&gt;@sastoudt&lt;/a&gt;, &lt;a href=&#34;https://github.com/seanpor&#34;&gt;@seanpor&lt;/a&gt;, &lt;a href=&#34;https://github.com/yj-danielyang&#34;&gt;@yj-danielyang&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>haven 2.1.0</title>
      <link>https://www.tidyverse.org/blog/2019/02/haven-2-1-0/</link>
      <pubDate>Tue, 19 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/02/haven-2-1-0/</guid>
      <description>We&amp;rsquo;re delighted to announce that haven 2.1.0 is now on CRAN. haven enables R to read and write various data formats used by other statistical packages by wrapping the ReadStat C library written by Evan Miller. For a full account of updates in this release, see the Changelog.
Improved labelling     Both labelled() and labelled_spss() now allow NULL labels. This makes both classes more flexible, allowing you to use them for their other attributes.</description>
      <content>&lt;p&gt;We&amp;rsquo;re delighted to announce that &lt;a href=&#34;https://haven.tidyverse.org/&#34;&gt;haven 2.1.0&lt;/a&gt; is now on CRAN. haven enables R to read and write various data formats used by other statistical packages by wrapping the &lt;a href=&#34;https://github.com/WizardMac/ReadStat&#34;&gt;ReadStat&lt;/a&gt; C library written by &lt;a href=&#34;https://www.evanmiller.org/&#34;&gt;Evan Miller&lt;/a&gt;. For a full account of updates in this release, see the &lt;a href=&#34;https://haven.tidyverse.org/news/index.html&#34;&gt;Changelog&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;improved-labelling&#34;&gt;Improved labelling
  &lt;a href=&#34;#improved-labelling&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Both &lt;a href=&#34;https://haven.tidyverse.org/reference/labelled.html&#34;&gt;&lt;code&gt;labelled()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://haven.tidyverse.org/reference/labelled_spss.html&#34;&gt;&lt;code&gt;labelled_spss()&lt;/code&gt;&lt;/a&gt; now allow &lt;code&gt;NULL&lt;/code&gt; labels. This makes both classes more flexible, allowing you to use them for their other attributes.&lt;code&gt;labelled()&lt;/code&gt; also now tests that value labels are unique.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;labelled&lt;/code&gt; objects now get pretty printing that shows the labels and &lt;code&gt;NA&lt;/code&gt; values when inside of a &lt;code&gt;tbl_df&lt;/code&gt;. You can turn this behaviour off by using &lt;code&gt;option(haven.show_pillar_labels = FALSE)&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;n&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;haven&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;labelled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;c&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;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;labels&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;A&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;B&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 2 x 1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;           s&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;dbl+lbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1     1 [A]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2    10 [B]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;minor-improvements-and-fixes&#34;&gt;Minor improvements and fixes
  &lt;a href=&#34;#minor-improvements-and-fixes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;This release is updated to the latest version of Evan Miller&amp;rsquo;s &lt;a href=&#34;https://github.com/WizardMac/ReadStat&#34;&gt;ReadStat&lt;/a&gt;, which includes the following changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://haven.tidyverse.org/reference/read_spss.html&#34;&gt;&lt;code&gt;read_por()&lt;/code&gt;&lt;/a&gt; can now read files from SPSS 25.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://haven.tidyverse.org/reference/read_spss.html&#34;&gt;&lt;code&gt;read_por()&lt;/code&gt;&lt;/a&gt; uses base-10 instead of base-30 for the exponent.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://haven.tidyverse.org/reference/read_sas.html&#34;&gt;&lt;code&gt;read_sas()&lt;/code&gt;&lt;/a&gt; can read zero-column files.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://haven.tidyverse.org/reference/read_spss.html&#34;&gt;&lt;code&gt;read_sav()&lt;/code&gt;&lt;/a&gt; now reads long strings, and has greater memory limit, allowing it to read more labels.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://haven.tidyverse.org/reference/read_spss.html&#34;&gt;&lt;code&gt;read_spss()&lt;/code&gt;&lt;/a&gt; reads long variable labels.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://haven.tidyverse.org/reference/read_spss.html&#34;&gt;&lt;code&gt;write_sav()&lt;/code&gt;&lt;/a&gt; no longer creates incorrect column names when &amp;gt;10k columns.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://haven.tidyverse.org/reference/read_spss.html&#34;&gt;&lt;code&gt;write_sav()&lt;/code&gt;&lt;/a&gt; no longer crashes when writing long label names.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thank you to Evan Miller, as well as
&lt;a href=&#34;https://github.com/armenic&#34;&gt;@armenic&lt;/a&gt;,  &lt;a href=&#34;https://github.com/beckerbenj&#34;&gt;@beckerbenj&lt;/a&gt;, &lt;a href=&#34;https://github.com/caayala&#34;&gt;@caayala&lt;/a&gt;, &lt;a href=&#34;https://github.com/gergness&#34;&gt;@gergness&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeffeaton&#34;&gt;@jeffeaton&lt;/a&gt;,  &lt;a href=&#34;https://github.com/philstraforelli&#34;&gt;@philstraforelli&lt;/a&gt;, &lt;a href=&#34;https://github.com/thays42&#34;&gt;@thays42&lt;/a&gt;, and &lt;a href=&#34;https://github.com/visseho&#34;&gt;@visseho&lt;/a&gt; for their contributions to this release.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>bigrquery 1.1.0</title>
      <link>https://www.tidyverse.org/blog/2019/02/bigrquery-1-1-0/</link>
      <pubDate>Fri, 15 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/02/bigrquery-1-1-0/</guid>
      <description>We&amp;rsquo;re delighted to announce that bigrquery 1.1.0 is now on CRAN. bigrquery makes it easy to work with data stored in Google BigQuery, a hosted database for big data. This is a minor release, with some improved type support, and SQL translation. For a complete list of updates, please see the Changelog.
Improved type support     bq_table_download() and the DBI::dbConnect method now have a bigint argument, which governs how BigQuery integer columns are imported into R.</description>
      <content>&lt;p&gt;We&amp;rsquo;re delighted to announce that &lt;a href=&#34;https://bigrquery.r-dbi.org/&#34;&gt;bigrquery&lt;/a&gt; 1.1.0 is now on CRAN. bigrquery makes it easy to work with data stored in &lt;a href=&#34;https://developers.google.com/bigquery/&#34;&gt;Google BigQuery&lt;/a&gt;, a hosted database for big data. This is a minor release, with some improved type support, and SQL translation. For a complete list of updates, please see the &lt;a href=&#34;https://bigrquery.r-dbi.org/news/index.html#bigrquery-1-1-0&#34;&gt;Changelog&lt;/a&gt;.&lt;/p&gt;




&lt;h2 id=&#34;improved-type-support&#34;&gt;Improved type support
  &lt;a href=&#34;#improved-type-support&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://bigrquery.r-dbi.org/reference/bq_table_download.html&#34;&gt;&lt;code&gt;bq_table_download()&lt;/code&gt;&lt;/a&gt; and the &lt;a href=&#34;https://www.rdocumentation.org/packages/DBI/versions/0.5-1/topics/dbConnect&#34;&gt;&lt;code&gt;DBI::dbConnect&lt;/code&gt;&lt;/a&gt; method now have a &lt;code&gt;bigint&lt;/code&gt; argument, which governs how BigQuery integer columns are imported into R. As before, the default will be &lt;code&gt;bigint = &amp;quot;integer&amp;quot;&lt;/code&gt;. However, you can now set &lt;code&gt;bigint = &amp;quot;integer64&amp;quot;&lt;/code&gt; to import BigQuery integer columns as &lt;code&gt;bit64::integer64&lt;/code&gt; columns in R. This allows for values outside the range of integer (&lt;code&gt;-2147483647&lt;/code&gt; to &lt;code&gt;2147483647&lt;/code&gt;). Thanks to &lt;a href=&#34;https://github.com/rasmusab&#34;&gt;Rasmus Bååth&lt;/a&gt; for implementing these changes.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bq_table_download()&lt;/code&gt; now treats &lt;code&gt;NUMERIC&lt;/code&gt; columns in the same way as &lt;code&gt;FLOAT&lt;/code&gt; columns.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;bq_table_upload()&lt;/code&gt; now works with date-time (&lt;code&gt;POSIXct&lt;/code&gt;) variables. Unparseable date times return &lt;code&gt;NA&lt;/code&gt;.&lt;/p&gt;




&lt;h2 id=&#34;sql-translation&#34;&gt;SQL translation
  &lt;a href=&#34;#sql-translation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;as.character()&lt;/code&gt; now translates to &lt;code&gt;SAFE_CAST(x AS STRING)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;median()&lt;/code&gt; now translates to &lt;code&gt;APPROX_QUANTILES(x, 2)[SAFE_ORDINAL(2)]&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;minor-fixes&#34;&gt;Minor fixes
  &lt;a href=&#34;#minor-fixes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://bigrquery.r-dbi.org/reference/bq_refs.html&#34;&gt;&lt;code&gt;bq_job()&lt;/code&gt;&lt;/a&gt; tracks location, so bigrquery now works painlessly with non-US/EU locations.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thank you to everyone who contributed to this release: &lt;a href=&#34;https://github.com/414theodore&#34;&gt;@414theodore&lt;/a&gt;, &lt;a href=&#34;https://github.com/ajh3000&#34;&gt;@ajh3000&lt;/a&gt;, &lt;a href=&#34;https://github.com/AlekseyBuzmakov&#34;&gt;@AlekseyBuzmakov&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/byapparov&#34;&gt;@byapparov&lt;/a&gt;, &lt;a href=&#34;https://github.com/ChrisJohnsonUMG&#34;&gt;@ChrisJohnsonUMG&lt;/a&gt;, &lt;a href=&#34;https://github.com/cpcgoogle&#34;&gt;@cpcgoogle&lt;/a&gt;, &lt;a href=&#34;https://github.com/dujm&#34;&gt;@dujm&lt;/a&gt;, &lt;a href=&#34;https://github.com/eddelbuettel&#34;&gt;@eddelbuettel&lt;/a&gt;, &lt;a href=&#34;https://github.com/edgararuiz&#34;&gt;@edgararuiz&lt;/a&gt;, &lt;a href=&#34;https://github.com/everron&#34;&gt;@everron&lt;/a&gt;, &lt;a href=&#34;https://github.com/guillaumed90&#34;&gt;@guillaumed90&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/Iuiu1234&#34;&gt;@Iuiu1234&lt;/a&gt;, &lt;a href=&#34;https://github.com/izzetagoren&#34;&gt;@izzetagoren&lt;/a&gt;, &lt;a href=&#34;https://github.com/j450h1&#34;&gt;@j450h1&lt;/a&gt;, &lt;a href=&#34;https://github.com/jberninger&#34;&gt;@jberninger&lt;/a&gt;, &lt;a href=&#34;https://github.com/jordanwebb10&#34;&gt;@jordanwebb10&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrecasens&#34;&gt;@jrecasens&lt;/a&gt;, &lt;a href=&#34;https://github.com/KarimZaoui&#34;&gt;@KarimZaoui&lt;/a&gt;, &lt;a href=&#34;https://github.com/ldanai&#34;&gt;@ldanai&lt;/a&gt;, &lt;a href=&#34;https://github.com/paulsendavidjay&#34;&gt;@paulsendavidjay&lt;/a&gt;, &lt;a href=&#34;https://github.com/ras44&#34;&gt;@ras44&lt;/a&gt;, &lt;a href=&#34;https://github.com/rasmusab&#34;&gt;@rasmusab&lt;/a&gt;, &lt;a href=&#34;https://github.com/Saikri5hna&#34;&gt;@Saikri5hna&lt;/a&gt;, &lt;a href=&#34;https://github.com/selcukakbas&#34;&gt;@selcukakbas&lt;/a&gt;, &lt;a href=&#34;https://github.com/SergeiMakarovWeb&#34;&gt;@SergeiMakarovWeb&lt;/a&gt;, &lt;a href=&#34;https://github.com/skydavis435&#34;&gt;@skydavis435&lt;/a&gt;, &lt;a href=&#34;https://github.com/tdsmith&#34;&gt;@tdsmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/tinoater&#34;&gt;@tinoater&lt;/a&gt;, &lt;a href=&#34;https://github.com/tortorellij1&#34;&gt;@tortorellij1&lt;/a&gt;, &lt;a href=&#34;https://github.com/valentinumbach&#34;&gt;@valentinumbach&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zacdav&#34;&gt;@zacdav&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>dplyr 0.8.0</title>
      <link>https://www.tidyverse.org/blog/2019/02/dplyr-0-8-0/</link>
      <pubDate>Fri, 15 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/02/dplyr-0-8-0/</guid>
      <description>We&amp;rsquo;re tickled pink to announce the release of version 0.8.0 of dplyr, the grammar of data manipulation in the tidyverse. This is a major update that has kept us busy for almost a year. We take the coincidence of a Valentine&amp;rsquo;s day release as a sign of continuous ❤️ for dplyr&#39;s approach to tidy data manipulation.
Important changes are discussed in detail in the pre-release post, we are grateful to members of the community for their feedback in the last couple of months, this has been tremendously useful in making the release process smoother.</description>
      <content>&lt;p&gt;We&amp;rsquo;re tickled pink to announce the release of version 0.8.0 of &lt;a href=&#34;https://dplyr.tidyverse.org&#34;&gt;dplyr&lt;/a&gt;, the grammar of data manipulation in the tidyverse.
This is a major update that has kept us busy for almost a year. We take the coincidence of a Valentine&amp;rsquo;s day release as a sign
of continuous ❤️ for &lt;code&gt;dplyr&lt;/code&gt;&#39;s approach to tidy data manipulation.&lt;/p&gt;
&lt;p&gt;Important changes are discussed in detail in the &lt;a href=&#34;https://www.tidyverse.org/articles/2018/12/dplyr-0-8-0-release-candidate/&#34;&gt;pre-release post&lt;/a&gt;,
we are grateful to members of the community for their feedback in the last couple of months, this
has been tremendously useful in making the release process smoother.&lt;/p&gt;
&lt;p&gt;The bulk of the changes are internal, and part of an ongoing effort to make the codebase more robust and
less surprising. This is an investment that will continue to pay off for years, and serve as a foundation for
more innovations in the future.&lt;/p&gt;
&lt;p&gt;For a comprehensive list of changes, please see &lt;a href=&#34;https://dplyr.tidyverse.org/news/index.html#dplyr-0-8-0&#34;&gt;the NEWS&lt;/a&gt;
for the 0.8.0 release, the sections below discusses the main changes.&lt;/p&gt;




&lt;h2 id=&#34;group-hug&#34;&gt;Group hug
  &lt;a href=&#34;#group-hug&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Grouping has always been at the center of what &lt;code&gt;dplyr&lt;/code&gt; is about, this release expands on the
existing &lt;code&gt;group_by()&lt;/code&gt; with a set of &lt;em&gt;experimental&lt;/em&gt; functions with a variety of
perspectives on the notion of grouping.&lt;/p&gt;
&lt;p&gt;We believe they offer new unique possibilities, but we welcome community feedback and use cases
before we put a 💍 on them. Let&amp;rsquo;s illustrate them with a subset from the
well-known &lt;code&gt;gapminder&lt;/code&gt; data.&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;oceania&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gapminder&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gapminder&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;continent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Oceania&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;yr1952&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1952&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;continent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;country&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;oceania&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 24 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   country [2]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    country    year lifeExp      pop gdpPercap yr1952&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;fct&amp;gt;     &amp;lt;int&amp;gt;   &amp;lt;dbl&amp;gt;    &amp;lt;int&amp;gt;     &amp;lt;dbl&amp;gt;  &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 Australia  1952    69.1  8691212    10040.      0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 Australia  1957    70.3  9712569    10950.      5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 Australia  1962    70.9 10794968    12217.     10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 Australia  1967    71.1 11872264    14526.     15&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 Australia  1972    71.9 13177000    16789.     20&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 Australia  1977    73.5 14074100    18334.     25&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 Australia  1982    74.7 15184200    19477.     30&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 Australia  1987    76.3 16257249    21889.     35&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 Australia  1992    77.6 17481977    23425.     40&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 Australia  1997    78.8 18565243    26998.     45&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # … with 14 more rows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_nest.html&#34;&gt;group_nest()&lt;/a&gt; is similar to
&lt;code&gt;tidyr::nest()&lt;/code&gt;, but focuses on the variables to &lt;em&gt;nest by&lt;/em&gt; instead of the nested columns.&lt;/li&gt;
&lt;/ul&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;oceania&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_nest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 2 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   country     data             &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt;       &amp;lt;list&amp;gt;           &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Australia   &amp;lt;tibble [12 × 5]&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 New Zealand &amp;lt;tibble [12 × 5]&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_split.html&#34;&gt;group_split()&lt;/a&gt; is a tidy version
of &lt;code&gt;base::split()&lt;/code&gt;. In particular, it respects a &lt;code&gt;group_by()&lt;/code&gt;-like grouping specification,
and refuses to name its result.&lt;/li&gt;
&lt;/ul&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;oceania&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_split&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [[1]]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 12 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    country    year lifeExp      pop gdpPercap yr1952&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;fct&amp;gt;     &amp;lt;int&amp;gt;   &amp;lt;dbl&amp;gt;    &amp;lt;int&amp;gt;     &amp;lt;dbl&amp;gt;  &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 Australia  1952    69.1  8691212    10040.      0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 Australia  1957    70.3  9712569    10950.      5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 Australia  1962    70.9 10794968    12217.     10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 Australia  1967    71.1 11872264    14526.     15&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 Australia  1972    71.9 13177000    16789.     20&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 Australia  1977    73.5 14074100    18334.     25&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 Australia  1982    74.7 15184200    19477.     30&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 Australia  1987    76.3 16257249    21889.     35&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 Australia  1992    77.6 17481977    23425.     40&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 Australia  1997    78.8 18565243    26998.     45&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 11 Australia  2002    80.4 19546792    30688.     50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 12 Australia  2007    81.2 20434176    34435.     55&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [[2]]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 12 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    country      year lifeExp     pop gdpPercap yr1952&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;fct&amp;gt;       &amp;lt;int&amp;gt;   &amp;lt;dbl&amp;gt;   &amp;lt;int&amp;gt;     &amp;lt;dbl&amp;gt;  &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1 New Zealand  1952    69.4 1994794    10557.      0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2 New Zealand  1957    70.3 2229407    12247.      5&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3 New Zealand  1962    71.2 2488550    13176.     10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4 New Zealand  1967    71.5 2728150    14464.     15&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5 New Zealand  1972    71.9 2929100    16046.     20&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6 New Zealand  1977    72.2 3164900    16234.     25&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7 New Zealand  1982    73.8 3210650    17632.     30&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8 New Zealand  1987    74.3 3317166    19007.     35&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9 New Zealand  1992    76.3 3437674    18363.     40&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10 New Zealand  1997    77.6 3676187    21050.     45&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 11 New Zealand  2002    79.1 3908037    23190.     50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 12 New Zealand  2007    80.2 4115771    25185.     55&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_map.html&#34;&gt;group_map()&lt;/a&gt; and &lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_map.html&#34;&gt;group_walk()&lt;/a&gt; offer
a way to iterate on groups of a grouped data frame.&lt;/li&gt;
&lt;/ul&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;oceania&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;yr1952&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;year&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1952&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;~&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;broom&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;tidy&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;stats&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;lm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lifeExp&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;yr1952&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 4 x 6&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # Groups:   country [2]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   country     term        estimate std.error statistic  p.value&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt;       &amp;lt;chr&amp;gt;          &amp;lt;dbl&amp;gt;     &amp;lt;dbl&amp;gt;     &amp;lt;dbl&amp;gt;    &amp;lt;dbl&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Australia   (Intercept)   68.4      0.337      203.  2.07e-19&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 Australia   yr1952         0.228    0.0104      21.9 8.67e-10&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 3 New Zealand (Intercept)   68.7      0.437      157.  2.66e-18&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 4 New Zealand yr1952         0.193    0.0135      14.3 5.41e- 8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_data.html&#34;&gt;group_data()&lt;/a&gt;, &lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_data.html&#34;&gt;group_rows()&lt;/a&gt;, and
&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_split.html&#34;&gt;group_keys()&lt;/a&gt; expose the grouping information, that has
been restructured in a tibble.&lt;/li&gt;
&lt;/ul&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;oceania&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 2 x 2&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   country     .rows     &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt;       &amp;lt;list&amp;gt;    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Australia   &amp;lt;int [12]&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 New Zealand &amp;lt;int [12]&amp;gt;&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;oceania&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_keys&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 2 x 1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   country    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   &amp;lt;fct&amp;gt;      &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1 Australia  &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 2 New Zealand&lt;/span&gt;

&lt;span class=&#34;n&#34;&gt;oceania&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;group_rows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [[1]]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [1]  1  2  3  4  5  6  7  8  9 10 11 12&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [[2]]&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [1] 13 14 15 16 17 18 19 20 21 22 23 24&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_by.html&#34;&gt;group_by()&lt;/a&gt; gains a &lt;code&gt;.drop&lt;/code&gt; argument
which you can set to &lt;code&gt;FALSE&lt;/code&gt; to respect empty groups associated with factors (more on this below).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;give-factors-some-love&#34;&gt;Give factors some love
  &lt;a href=&#34;#give-factors-some-love&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;The internal grouping algorithm has been redesigned to make it possible to
better respect factor levels and empty groups. To limit the disruption, we have not made
this the default behaviour. To keep empty groups,
you have to set &lt;a href=&#34;https://dplyr.tidyverse.org/reference/group_by.html&#34;&gt;group_by()&lt;/a&gt;&amp;lsquo;s
&lt;code&gt;.drop&lt;/code&gt; argument to &lt;code&gt;FALSE&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This can make data manipulation more predictable and reliable, because when factors are
involved, the groups are based on the levels of the factors, rather than which levels
have data points.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s illustrate this with our favourite flowers 💐,
and a function, &lt;code&gt;species_count()&lt;/code&gt;, that counts the number of each species after
a &lt;code&gt;filter()&lt;/code&gt;, and structures it as a tibble with one column per species.&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;species_count&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Species&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.drop&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;FALSE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;nf&#34;&gt;summarise&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
    &lt;span class=&#34;n&#34;&gt;tidyr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;spread&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Species&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Because we use &lt;code&gt;.drop = FALSE&lt;/code&gt; we get one column per level of the factor,
even when there&amp;rsquo;s no data associated with a level:&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;species_count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Petal.Length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 1 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   setosa versicolor virginica&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;int&amp;gt;      &amp;lt;int&amp;gt;     &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1      0         49        50&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;species_count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Petal.Length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;6.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 1 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   setosa versicolor virginica&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;int&amp;gt;      &amp;lt;int&amp;gt;     &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1      0          0         4&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;species_count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Petal.Length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 1 x 3&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;   setosa versicolor virginica&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    &amp;lt;int&amp;gt;      &amp;lt;int&amp;gt;     &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 1      0          0         0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These 0 instead of missing columns make the experience easier when you want to combine multiple results:&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;limits&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;seq&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;by&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;n&#34;&gt;limits&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;n&#34;&gt;purrr&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;map_dfr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;species_count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Petal.Length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;mutate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Sepal.Length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;limits&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt; 
  &lt;span class=&#34;nf&#34;&gt;select&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Sepal.Length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;everything&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; # A tibble: 17 x 4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;    Sepal.Length setosa versicolor virginica&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;           &amp;lt;dbl&amp;gt;  &amp;lt;int&amp;gt;      &amp;lt;int&amp;gt;     &amp;lt;int&amp;gt;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  1          0       50         50        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  2          0.5     50         50        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  3          1       49         50        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  4          1.5     13         50        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  5          2        0         50        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  6          2.5      0         50        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  7          3        0         49        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  8          3.5      0         45        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  9          4        0         34        50&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 10          4.5      0         14        49&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 11          5        0          1        41&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 12          5.5      0          0        25&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 13          6        0          0         9&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 14          6.5      0          0         4&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 15          7        0          0         0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 16          7.5      0          0         0&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; 17          8        0          0         0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2 id=&#34;thanks&#34;&gt;Thanks
  &lt;a href=&#34;#thanks&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to all contributors for this release.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/abouf&#34;&gt;@abouf&lt;/a&gt;, &lt;a href=&#34;https://github.com/adisarid&#34;&gt;@adisarid&lt;/a&gt;, &lt;a href=&#34;https://github.com/adrfantini&#34;&gt;@adrfantini&lt;/a&gt;, &lt;a href=&#34;https://github.com/aetiologicCanada&#34;&gt;@aetiologicCanada&lt;/a&gt;, &lt;a href=&#34;https://github.com/afdta&#34;&gt;@afdta&lt;/a&gt;, &lt;a href=&#34;https://github.com/albertomv83&#34;&gt;@albertomv83&lt;/a&gt;, &lt;a href=&#34;https://github.com/alistaire47&#34;&gt;@alistaire47&lt;/a&gt;, &lt;a href=&#34;https://github.com/aloes2512&#34;&gt;@aloes2512&lt;/a&gt;, &lt;a href=&#34;https://github.com/andresimi&#34;&gt;@andresimi&lt;/a&gt;, &lt;a href=&#34;https://github.com/antaldaniel&#34;&gt;@antaldaniel&lt;/a&gt;, &lt;a href=&#34;https://github.com/AnthonyEbert&#34;&gt;@AnthonyEbert&lt;/a&gt;, &lt;a href=&#34;https://github.com/ArtemSokolov&#34;&gt;@ArtemSokolov&lt;/a&gt;, &lt;a href=&#34;https://github.com/AshesITR&#34;&gt;@AshesITR&lt;/a&gt;, &lt;a href=&#34;https://github.com/bakaburg1&#34;&gt;@bakaburg1&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/bbachrach&#34;&gt;@bbachrach&lt;/a&gt;, &lt;a href=&#34;https://github.com/bbolker&#34;&gt;@bbolker&lt;/a&gt;, &lt;a href=&#34;https://github.com/behrman&#34;&gt;@behrman&lt;/a&gt;, &lt;a href=&#34;https://github.com/BenjaminLouis&#34;&gt;@BenjaminLouis&lt;/a&gt;, &lt;a href=&#34;https://github.com/bifouba&#34;&gt;@bifouba&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;@billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/bnicenboim&#34;&gt;@bnicenboim&lt;/a&gt;, &lt;a href=&#34;https://github.com/BobMuenchen&#34;&gt;@BobMuenchen&lt;/a&gt;, &lt;a href=&#34;https://github.com/brooke-watson&#34;&gt;@brooke-watson&lt;/a&gt;, &lt;a href=&#34;https://github.com/CarolineBarret&#34;&gt;@CarolineBarret&lt;/a&gt;, &lt;a href=&#34;https://github.com/cbailiss&#34;&gt;@cbailiss&lt;/a&gt;, &lt;a href=&#34;https://github.com/CerebralMastication&#34;&gt;@CerebralMastication&lt;/a&gt;, &lt;a href=&#34;https://github.com/cfhammill&#34;&gt;@cfhammill&lt;/a&gt;, &lt;a href=&#34;https://github.com/cfry-propeller&#34;&gt;@cfry-propeller&lt;/a&gt;, &lt;a href=&#34;https://github.com/choisy&#34;&gt;@choisy&lt;/a&gt;, &lt;a href=&#34;https://github.com/ChrisBeeley&#34;&gt;@ChrisBeeley&lt;/a&gt;, &lt;a href=&#34;https://github.com/chrsigg&#34;&gt;@chrsigg&lt;/a&gt;, &lt;a href=&#34;https://github.com/clauswilke&#34;&gt;@clauswilke&lt;/a&gt;, &lt;a href=&#34;https://github.com/ClaytonJY&#34;&gt;@ClaytonJY&lt;/a&gt;, &lt;a href=&#34;https://github.com/colearendt&#34;&gt;@colearendt&lt;/a&gt;, &lt;a href=&#34;https://github.com/ColinFay&#34;&gt;@ColinFay&lt;/a&gt;, &lt;a href=&#34;https://github.com/coolbutuseless&#34;&gt;@coolbutuseless&lt;/a&gt;, &lt;a href=&#34;https://github.com/Copepoda&#34;&gt;@Copepoda&lt;/a&gt;, &lt;a href=&#34;https://github.com/cpsievert&#34;&gt;@cpsievert&lt;/a&gt;, &lt;a href=&#34;https://github.com/dah33&#34;&gt;@dah33&lt;/a&gt;, &lt;a href=&#34;https://github.com/damianooldoni&#34;&gt;@damianooldoni&lt;/a&gt;, &lt;a href=&#34;https://github.com/DanChaltiel&#34;&gt;@DanChaltiel&lt;/a&gt;, &lt;a href=&#34;https://github.com/danyal123&#34;&gt;@danyal123&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/Demetrio92&#34;&gt;@Demetrio92&lt;/a&gt;, &lt;a href=&#34;https://github.com/dewoller&#34;&gt;@dewoller&lt;/a&gt;, &lt;a href=&#34;https://github.com/dfalbel&#34;&gt;@dfalbel&lt;/a&gt;, &lt;a href=&#34;https://github.com/DiogoFerrari&#34;&gt;@DiogoFerrari&lt;/a&gt;, &lt;a href=&#34;https://github.com/dirkschumacher&#34;&gt;@dirkschumacher&lt;/a&gt;, &lt;a href=&#34;https://github.com/dmenne&#34;&gt;@dmenne&lt;/a&gt;, &lt;a href=&#34;https://github.com/dmvianna&#34;&gt;@dmvianna&lt;/a&gt;, &lt;a href=&#34;https://github.com/dongzhuoer&#34;&gt;@dongzhuoer&lt;/a&gt;, &lt;a href=&#34;https://github.com/earowang&#34;&gt;@earowang&lt;/a&gt;, &lt;a href=&#34;https://github.com/echasnovski&#34;&gt;@echasnovski&lt;/a&gt;, &lt;a href=&#34;https://github.com/eddelbuettel&#34;&gt;@eddelbuettel&lt;/a&gt;, &lt;a href=&#34;https://github.com/EdwinTh&#34;&gt;@EdwinTh&lt;/a&gt;, &lt;a href=&#34;https://github.com/eijoac&#34;&gt;@eijoac&lt;/a&gt;, &lt;a href=&#34;https://github.com/elbersb&#34;&gt;@elbersb&lt;/a&gt;, &lt;a href=&#34;https://github.com/Eli-Berkow&#34;&gt;@Eli-Berkow&lt;/a&gt;, &lt;a href=&#34;https://github.com/EmilHvitfeldt&#34;&gt;@EmilHvitfeldt&lt;/a&gt;, &lt;a href=&#34;https://github.com/epetrovski&#34;&gt;@epetrovski&lt;/a&gt;, &lt;a href=&#34;https://github.com/erblast&#34;&gt;@erblast&lt;/a&gt;, &lt;a href=&#34;https://github.com/etienne-s&#34;&gt;@etienne-s&lt;/a&gt;, &lt;a href=&#34;https://github.com/foundinblank&#34;&gt;@foundinblank&lt;/a&gt;, &lt;a href=&#34;https://github.com/FrancoisGuillem&#34;&gt;@FrancoisGuillem&lt;/a&gt;, &lt;a href=&#34;https://github.com/geotheory&#34;&gt;@geotheory&lt;/a&gt;, &lt;a href=&#34;https://github.com/ggrothendieck&#34;&gt;@ggrothendieck&lt;/a&gt;, &lt;a href=&#34;https://github.com/GoldbergData&#34;&gt;@GoldbergData&lt;/a&gt;, &lt;a href=&#34;https://github.com/gowerc&#34;&gt;@gowerc&lt;/a&gt;, &lt;a href=&#34;https://github.com/grayskripko&#34;&gt;@grayskripko&lt;/a&gt;, &lt;a href=&#34;https://github.com/GrimTrigger88&#34;&gt;@GrimTrigger88&lt;/a&gt;, &lt;a href=&#34;https://github.com/grizzthepro64&#34;&gt;@grizzthepro64&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hafen&#34;&gt;@hafen&lt;/a&gt;, &lt;a href=&#34;https://github.com/heavywatal&#34;&gt;@heavywatal&lt;/a&gt;, &lt;a href=&#34;https://github.com/helix123&#34;&gt;@helix123&lt;/a&gt;, &lt;a href=&#34;https://github.com/henrikmidtiby&#34;&gt;@henrikmidtiby&lt;/a&gt;, &lt;a href=&#34;https://github.com/hpeaker&#34;&gt;@hpeaker&lt;/a&gt;, &lt;a href=&#34;https://github.com/htc502&#34;&gt;@htc502&lt;/a&gt;, &lt;a href=&#34;https://github.com/hughjonesd&#34;&gt;@hughjonesd&lt;/a&gt;, &lt;a href=&#34;https://github.com/ignacio82&#34;&gt;@ignacio82&lt;/a&gt;, &lt;a href=&#34;https://github.com/igoldin2u&#34;&gt;@igoldin2u&lt;/a&gt;, &lt;a href=&#34;https://github.com/igordot&#34;&gt;@igordot&lt;/a&gt;, &lt;a href=&#34;https://github.com/ilarischeinin&#34;&gt;@ilarischeinin&lt;/a&gt;, &lt;a href=&#34;https://github.com/Ilia-Kosenkov&#34;&gt;@Ilia-Kosenkov&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/ipofanes&#34;&gt;@ipofanes&lt;/a&gt;, &lt;a href=&#34;https://github.com/jasonmhoule&#34;&gt;@jasonmhoule&lt;/a&gt;, &lt;a href=&#34;https://github.com/jayhesselberth&#34;&gt;@jayhesselberth&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jepusto&#34;&gt;@jepusto&lt;/a&gt;, &lt;a href=&#34;https://github.com/jflynn264&#34;&gt;@jflynn264&lt;/a&gt;, &lt;a href=&#34;https://github.com/jialu512&#34;&gt;@jialu512&lt;/a&gt;, &lt;a href=&#34;https://github.com/JiaxiangBU&#34;&gt;@JiaxiangBU&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jkylearmstrongibx&#34;&gt;@jkylearmstrongibx&lt;/a&gt;, &lt;a href=&#34;https://github.com/jnolis&#34;&gt;@jnolis&lt;/a&gt;, &lt;a href=&#34;https://github.com/JohnMount&#34;&gt;@JohnMount&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonkeane&#34;&gt;@jonkeane&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;@jonthegeek&lt;/a&gt;, &lt;a href=&#34;https://github.com/jschelbert&#34;&gt;@jschelbert&lt;/a&gt;, &lt;a href=&#34;https://github.com/jsekamane&#34;&gt;@jsekamane&lt;/a&gt;, &lt;a href=&#34;https://github.com/jtelleria&#34;&gt;@jtelleria&lt;/a&gt;, &lt;a href=&#34;https://github.com/kendonB&#34;&gt;@kendonB&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinykuo&#34;&gt;@kevinykuo&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/langbe&#34;&gt;@langbe&lt;/a&gt;, &lt;a href=&#34;https://github.com/ldecicco-USGS&#34;&gt;@ldecicco-USGS&lt;/a&gt;, &lt;a href=&#34;https://github.com/leungi&#34;&gt;@leungi&lt;/a&gt;, &lt;a href=&#34;https://github.com/libbieweimer&#34;&gt;@libbieweimer&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/liz-is&#34;&gt;@liz-is&lt;/a&gt;, &lt;a href=&#34;https://github.com/lloven&#34;&gt;@lloven&lt;/a&gt;, &lt;a href=&#34;https://github.com/ltrgoddard&#34;&gt;@ltrgoddard&lt;/a&gt;, &lt;a href=&#34;https://github.com/luccastermans&#34;&gt;@luccastermans&lt;/a&gt;, &lt;a href=&#34;https://github.com/maicel1978&#34;&gt;@maicel1978&lt;/a&gt;, &lt;a href=&#34;https://github.com/Make42&#34;&gt;@Make42&lt;/a&gt;, &lt;a href=&#34;https://github.com/MalditoBarbudo&#34;&gt;@MalditoBarbudo&lt;/a&gt;, &lt;a href=&#34;https://github.com/markdly&#34;&gt;@markdly&lt;/a&gt;, &lt;a href=&#34;https://github.com/markvanderloo&#34;&gt;@markvanderloo&lt;/a&gt;, &lt;a href=&#34;https://github.com/mattbk&#34;&gt;@mattbk&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxheld83&#34;&gt;@maxheld83&lt;/a&gt;, &lt;a href=&#34;https://github.com/melissakey&#34;&gt;@melissakey&lt;/a&gt;, &lt;a href=&#34;https://github.com/mem48&#34;&gt;@mem48&lt;/a&gt;, &lt;a href=&#34;https://github.com/mgirlich&#34;&gt;@mgirlich&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikmart&#34;&gt;@mikmart&lt;/a&gt;, &lt;a href=&#34;https://github.com/MilesMcBain&#34;&gt;@MilesMcBain&lt;/a&gt;, &lt;a href=&#34;https://github.com/minhsphuc12&#34;&gt;@minhsphuc12&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkoohafkan&#34;&gt;@mkoohafkan&lt;/a&gt;, &lt;a href=&#34;https://github.com/momeara&#34;&gt;@momeara&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;@moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/move%5Bbot%5D&#34;&gt;@move[bot]&lt;/a&gt;, &lt;a href=&#34;https://github.com/nealpsmith&#34;&gt;@nealpsmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/NightWinkle&#34;&gt;@NightWinkle&lt;/a&gt;, &lt;a href=&#34;https://github.com/o1iv3r&#34;&gt;@o1iv3r&lt;/a&gt;, &lt;a href=&#34;https://github.com/PascalKieslich&#34;&gt;@PascalKieslich&lt;/a&gt;, &lt;a href=&#34;https://github.com/petermeissner&#34;&gt;@petermeissner&lt;/a&gt;, &lt;a href=&#34;https://github.com/peterzsohar&#34;&gt;@peterzsohar&lt;/a&gt;, &lt;a href=&#34;https://github.com/philstraforelli&#34;&gt;@philstraforelli&lt;/a&gt;, &lt;a href=&#34;https://github.com/PMassicotte&#34;&gt;@PMassicotte&lt;/a&gt;, &lt;a href=&#34;https://github.com/PPICARDO&#34;&gt;@PPICARDO&lt;/a&gt;, &lt;a href=&#34;https://github.com/privefl&#34;&gt;@privefl&lt;/a&gt;, &lt;a href=&#34;https://github.com/prokulski&#34;&gt;@prokulski&lt;/a&gt;, &lt;a href=&#34;https://github.com/quartin&#34;&gt;@quartin&lt;/a&gt;, &lt;a href=&#34;https://github.com/rabutler-usbr&#34;&gt;@rabutler-usbr&lt;/a&gt;, &lt;a href=&#34;https://github.com/ramongallego&#34;&gt;@ramongallego&lt;/a&gt;, &lt;a href=&#34;https://github.com/randomgambit&#34;&gt;@randomgambit&lt;/a&gt;, &lt;a href=&#34;https://github.com/rappster&#34;&gt;@rappster&lt;/a&gt;, &lt;a href=&#34;https://github.com/rensa&#34;&gt;@rensa&lt;/a&gt;, &lt;a href=&#34;https://github.com/reshmamena&#34;&gt;@reshmamena&lt;/a&gt;, &lt;a href=&#34;https://github.com/richard987&#34;&gt;@richard987&lt;/a&gt;, &lt;a href=&#34;https://github.com/richierocks&#34;&gt;@richierocks&lt;/a&gt;, &lt;a href=&#34;https://github.com/RickPack&#34;&gt;@RickPack&lt;/a&gt;, &lt;a href=&#34;https://github.com/riship2009&#34;&gt;@riship2009&lt;/a&gt;, &lt;a href=&#34;https://github.com/RobertMyles&#34;&gt;@RobertMyles&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/rontomer&#34;&gt;@rontomer&lt;/a&gt;, &lt;a href=&#34;https://github.com/roumail&#34;&gt;@roumail&lt;/a&gt;, &lt;a href=&#34;https://github.com/rozsoma&#34;&gt;@rozsoma&lt;/a&gt;, &lt;a href=&#34;https://github.com/rundel&#34;&gt;@rundel&lt;/a&gt;, &lt;a href=&#34;https://github.com/rupesh2017&#34;&gt;@rupesh2017&lt;/a&gt;, &lt;a href=&#34;https://github.com/s-fleck&#34;&gt;@s-fleck&lt;/a&gt;, &lt;a href=&#34;https://github.com/S-UP&#34;&gt;@S-UP&lt;/a&gt;, &lt;a href=&#34;https://github.com/salmansyed0709&#34;&gt;@salmansyed0709&lt;/a&gt;, &lt;a href=&#34;https://github.com/schloerke&#34;&gt;@schloerke&lt;/a&gt;, &lt;a href=&#34;https://github.com/seasmith&#34;&gt;@seasmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/sharlagelfand&#34;&gt;@sharlagelfand&lt;/a&gt;, &lt;a href=&#34;https://github.com/shizidushu&#34;&gt;@shizidushu&lt;/a&gt;, &lt;a href=&#34;https://github.com/simon-anasta&#34;&gt;@simon-anasta&lt;/a&gt;, &lt;a href=&#34;https://github.com/skaltman&#34;&gt;@skaltman&lt;/a&gt;, &lt;a href=&#34;https://github.com/skylarhopkins&#34;&gt;@skylarhopkins&lt;/a&gt;, &lt;a href=&#34;https://github.com/sowla&#34;&gt;@sowla&lt;/a&gt;, &lt;a href=&#34;https://github.com/statsccpr&#34;&gt;@statsccpr&lt;/a&gt;, &lt;a href=&#34;https://github.com/stenhaug&#34;&gt;@stenhaug&lt;/a&gt;, &lt;a href=&#34;https://github.com/streamline55&#34;&gt;@streamline55&lt;/a&gt;, &lt;a href=&#34;https://github.com/stuartE9&#34;&gt;@stuartE9&lt;/a&gt;, &lt;a href=&#34;https://github.com/stufield&#34;&gt;@stufield&lt;/a&gt;, &lt;a href=&#34;https://github.com/suzanbaert&#34;&gt;@suzanbaert&lt;/a&gt;, &lt;a href=&#34;https://github.com/sverchkov&#34;&gt;@sverchkov&lt;/a&gt;, &lt;a href=&#34;https://github.com/thackl&#34;&gt;@thackl&lt;/a&gt;, &lt;a href=&#34;https://github.com/the-knife&#34;&gt;@the-knife&lt;/a&gt;, &lt;a href=&#34;https://github.com/ThiAmm&#34;&gt;@ThiAmm&lt;/a&gt;, &lt;a href=&#34;https://github.com/thisisnic&#34;&gt;@thisisnic&lt;/a&gt;, &lt;a href=&#34;https://github.com/tinyheero&#34;&gt;@tinyheero&lt;/a&gt;, &lt;a href=&#34;https://github.com/tmelconian&#34;&gt;@tmelconian&lt;/a&gt;, &lt;a href=&#34;https://github.com/tobadia&#34;&gt;@tobadia&lt;/a&gt;, &lt;a href=&#34;https://github.com/tonyelhabr&#34;&gt;@tonyelhabr&lt;/a&gt;, &lt;a href=&#34;https://github.com/torbjorn&#34;&gt;@torbjorn&lt;/a&gt;, &lt;a href=&#34;https://github.com/trueNico&#34;&gt;@trueNico&lt;/a&gt;, &lt;a href=&#34;https://github.com/tungmilan&#34;&gt;@tungmilan&lt;/a&gt;, &lt;a href=&#34;https://github.com/TylerGrantSmith&#34;&gt;@TylerGrantSmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/ukkonen&#34;&gt;@ukkonen&lt;/a&gt;, &lt;a href=&#34;https://github.com/vincentanutama&#34;&gt;@vincentanutama&lt;/a&gt;, &lt;a href=&#34;https://github.com/vnijs&#34;&gt;@vnijs&lt;/a&gt;, &lt;a href=&#34;https://github.com/wanfahmi&#34;&gt;@wanfahmi&lt;/a&gt;, &lt;a href=&#34;https://github.com/waynelapierre&#34;&gt;@waynelapierre&lt;/a&gt;, &lt;a href=&#34;https://github.com/wch&#34;&gt;@wch&lt;/a&gt;, &lt;a href=&#34;https://github.com/wdenton&#34;&gt;@wdenton&lt;/a&gt;, &lt;a href=&#34;https://github.com/wgrundlingh&#34;&gt;@wgrundlingh&lt;/a&gt;, &lt;a href=&#34;https://github.com/wmayner&#34;&gt;@wmayner&lt;/a&gt;, &lt;a href=&#34;https://github.com/wolski&#34;&gt;@wolski&lt;/a&gt;, &lt;a href=&#34;https://github.com/yiqinfu&#34;&gt;@yiqinfu&lt;/a&gt;, &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;, &lt;a href=&#34;https://github.com/Zanidean&#34;&gt;@Zanidean&lt;/a&gt;, &lt;a href=&#34;https://github.com/Zedseayou&#34;&gt;@Zedseayou&lt;/a&gt;, &lt;a href=&#34;https://github.com/zslajchrt&#34;&gt;@zslajchrt&lt;/a&gt;, &lt;a href=&#34;https://github.com/zx8754&#34;&gt;@zx8754&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zzygyx9119&#34;&gt;@zzygyx9119&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>purrr 0.3.0</title>
      <link>https://www.tidyverse.org/blog/2019/02/purrr-0-3-0/</link>
      <pubDate>Wed, 06 Feb 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/02/purrr-0-3-0/</guid>
      <description>We’re excited to announce the release of purrr 0.3.0! purrr enhances R’s functional programming toolkit by providing a complete and consistent set of tools for working with functions and vectors.
# Install the latest version with: install.packages(&amp;quot;purrr&amp;quot;) # Start working with purrr: library(purrr) In this release, pluck() gets a few new variants:
 pluck&amp;lt;-, assign_in() and modify_in() allow deep modifications of nested structures.
 chuck() is a stricter variant of pluck() that consistently fails instead of returning NULL when the structure does not have the expected shape.</description>
      <content>


&lt;p&gt;We’re excited to announce the release of &lt;a href=&#34;https://purrr.tidyverse.org&#34;&gt;purrr&lt;/a&gt; 0.3.0! purrr enhances R’s functional programming toolkit by providing a complete and consistent set of tools for working with functions and vectors.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Install the latest version with:
install.packages(&amp;quot;purrr&amp;quot;)

# Start working with purrr:
library(purrr)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this release, &lt;code&gt;pluck()&lt;/code&gt; gets a few new variants:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;pluck&amp;lt;-&lt;/code&gt;, &lt;code&gt;assign_in()&lt;/code&gt; and &lt;code&gt;modify_in()&lt;/code&gt; allow deep modifications of nested structures.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;chuck()&lt;/code&gt; is a stricter variant of &lt;code&gt;pluck()&lt;/code&gt; that consistently fails instead of returning &lt;code&gt;NULL&lt;/code&gt; when the structure does not have the expected shape.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A new set of tools helps limiting the rate at which a function is called:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;slowly()&lt;/code&gt; forces a function to sleep between each invokation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;insistently()&lt;/code&gt; automatically invokes a function again on error until it succeeds, and sleeps between invokations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;rate_delay()&lt;/code&gt; and &lt;code&gt;rate_backoff()&lt;/code&gt; helpers control the invokation rate of &lt;code&gt;slowly()&lt;/code&gt; and &lt;code&gt;insistently()&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The reduce and map functions gain a few improvements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;map_if()&lt;/code&gt; accepts an optional function with the &lt;code&gt;.else&lt;/code&gt; parameter. This function is applied on elements for which the predicate is &lt;code&gt;FALSE&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;map_at()&lt;/code&gt; now accepts &lt;code&gt;vars()&lt;/code&gt; selections. This lets you use selection helpers like &lt;code&gt;dplyr::starts_with()&lt;/code&gt; to determine the elements of a list which should be mapped.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;reduce()&lt;/code&gt; now supports early termination of a computation. Just return a value wrapped in a &lt;code&gt;done()&lt;/code&gt; to signal to &lt;code&gt;reduce()&lt;/code&gt; that you’re done.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Besides these new functions and tools, purrr 0.3.0 is mostly a polishing release. We have improved the consistency of behaviour:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;modify()&lt;/code&gt; is now a wrapper around &lt;code&gt;[[&amp;lt;-&lt;/code&gt; instead of &lt;code&gt;[&amp;lt;-&lt;/code&gt;. This makes it compatible with a larger variety of S3 vector classes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Predicate functions (such that you would pass to &lt;code&gt;map_if()&lt;/code&gt;) now must return a single &lt;code&gt;TRUE&lt;/code&gt; or &lt;code&gt;FALSE&lt;/code&gt;. Missing values and integers are no longer valid predicate outputs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, we improved the consistency of the interface:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The direction of iteration/application is now consistently specified with a &lt;code&gt;.dir&lt;/code&gt; argument.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Many missing functions were added to fill the gaps: &lt;code&gt;accumulate2()&lt;/code&gt;, &lt;code&gt;imodify()&lt;/code&gt;, &lt;code&gt;map_depth()&lt;/code&gt;, …&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;partial()&lt;/code&gt; has a much improved and more flexible interface.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Find a detailed account of the changes in the &lt;a href=&#34;https://github.com/tidyverse/purrr/blob/master/NEWS.md#purrr-030&#34;&gt;NEWS&lt;/a&gt; file.&lt;/p&gt;
&lt;div id=&#34;new-pluck-variants&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;New pluck variants&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;pluck()&lt;/code&gt; implements a generalised form of &lt;code&gt;[[&lt;/code&gt; that allow you to index deeply and flexibly into data structures. For instance, &lt;code&gt;pluck(x, &amp;quot;foo&amp;quot;, 2)&lt;/code&gt; is equivalent to &lt;code&gt;x[[&amp;quot;foo&amp;quot;]][[2]]&lt;/code&gt;. You can also supply a default value in case the element does not exist. For instance, &lt;code&gt;pluck(x, &amp;quot;foo&amp;quot;, 2, .default = NA)&lt;/code&gt; is equivalent to &lt;code&gt;x[[&amp;quot;foo&amp;quot;]][[2]]&lt;/code&gt;, returning an &lt;code&gt;NA&lt;/code&gt; if that element doesn’t exist. purrr 0.3.0 introduces variants of &lt;code&gt;pluck()&lt;/code&gt; to make it easier to work with deep data structures.&lt;/p&gt;
&lt;div id=&#34;pluck-assignment&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Pluck assignment&lt;/h3&gt;
&lt;p&gt;This release introduces the new functions &lt;code&gt;pluck&amp;lt;-&lt;/code&gt;, &lt;code&gt;assign_in()&lt;/code&gt; and &lt;code&gt;modify_in()&lt;/code&gt; as assignment variants of &lt;code&gt;pluck()&lt;/code&gt;. To illustrate deep assignment, let’s create a nested data structure:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;x &amp;lt;- list(foo = list(1, 2), bar = list(3, 4))
str(x)
#&amp;gt; List of 2
#&amp;gt;  $ foo:List of 2
#&amp;gt;   ..$ : num 1
#&amp;gt;   ..$ : num 2
#&amp;gt;  $ bar:List of 2
#&amp;gt;   ..$ : num 3
#&amp;gt;   ..$ : num 4&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This sort of repeated structure is the kind of data where &lt;code&gt;pluck()&lt;/code&gt; shines:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;pluck(x, &amp;quot;foo&amp;quot;, 2)
#&amp;gt; [1] 2

pluck(x, &amp;quot;bar&amp;quot;, 1)
#&amp;gt; [1] 3&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can now use the same syntax to modify the data:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;pluck(x, &amp;quot;foo&amp;quot;, 2) &amp;lt;- 100
str(x)
#&amp;gt; List of 2
#&amp;gt;  $ foo:List of 2
#&amp;gt;   ..$ : num 1
#&amp;gt;   ..$ : num 100
#&amp;gt;  $ bar:List of 2
#&amp;gt;   ..$ : num 3
#&amp;gt;   ..$ : num 4&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;pluck&amp;lt;-&lt;/code&gt; also has a functional form that does not modify objects in your environment, but instead returns a modified copy:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;out &amp;lt;- assign_in(x, list(&amp;quot;foo&amp;quot;, 2), 2000)

# The object is still the same as before
str(x)
#&amp;gt; List of 2
#&amp;gt;  $ foo:List of 2
#&amp;gt;   ..$ : num 1
#&amp;gt;   ..$ : num 100
#&amp;gt;  $ bar:List of 2
#&amp;gt;   ..$ : num 3
#&amp;gt;   ..$ : num 4

# The modified data is in `out`
str(out)
#&amp;gt; List of 2
#&amp;gt;  $ foo:List of 2
#&amp;gt;   ..$ : num 1
#&amp;gt;   ..$ : num 2000
#&amp;gt;  $ bar:List of 2
#&amp;gt;   ..$ : num 3
#&amp;gt;   ..$ : num 4&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, &lt;code&gt;modify_in()&lt;/code&gt; is a variant of &lt;code&gt;modify()&lt;/code&gt; that only changes the pluck location with the result of applying a function:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;out &amp;lt;- modify_in(x, list(&amp;quot;foo&amp;quot;, 2), as.character)
str(out)
#&amp;gt; List of 2
#&amp;gt;  $ foo:List of 2
#&amp;gt;   ..$ : num 1
#&amp;gt;   ..$ : chr &amp;quot;100&amp;quot;
#&amp;gt;  $ bar:List of 2
#&amp;gt;   ..$ : num 3
#&amp;gt;   ..$ : num 4&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;stricter-pluck&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Stricter pluck()&lt;/h3&gt;
&lt;p&gt;Thanks to Daniel Barnett (&lt;span class=&#34;citation&#34;&gt;@daniel-barnett&lt;/span&gt; on Github), &lt;code&gt;pluck()&lt;/code&gt; now has a stricter cousin &lt;code&gt;chuck()&lt;/code&gt;. Whereas &lt;code&gt;pluck()&lt;/code&gt; is very permissive regarding non-existing locations and returns &lt;code&gt;NULL&lt;/code&gt; in these cases, and &lt;code&gt;[[&lt;/code&gt; inconsistently returns &lt;code&gt;NULL&lt;/code&gt;, &lt;code&gt;NA&lt;/code&gt;, or throws an error, &lt;code&gt;chuck()&lt;/code&gt; fails consistently with informative messages (i.e., it “chucks” an error message):&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;pluck(list(1), &amp;quot;foo&amp;quot;)
#&amp;gt; NULL

chuck(list(1), &amp;quot;foo&amp;quot;)
#&amp;gt; Error: Index 1 is attempting to pluck from an unnamed vector using a string name&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;rates&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Rates&lt;/h2&gt;
&lt;p&gt;Thanks to Richie Cotton (&lt;span class=&#34;citation&#34;&gt;@richierocks&lt;/span&gt;) and Ian Lyttle (&lt;span class=&#34;citation&#34;&gt;@ijlyttle&lt;/span&gt;), purrr gains a function operator to make a function call itself repeatedly when an error occurs.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;counter &amp;lt;- 0

f &amp;lt;- function(...) {
  if (counter &amp;lt; 2) {
    counter &amp;lt;&amp;lt;- counter + 1
    stop(&amp;quot;tilt!&amp;quot;)
  }
  &amp;quot;result&amp;quot;
}

f()
#&amp;gt; Error in f(): tilt!&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the function is wrapped with &lt;code&gt;insistently()&lt;/code&gt;, it will try a few times before giving up:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Reset counter
counter &amp;lt;- 0

f2 &amp;lt;- insistently(f)
f2()
#&amp;gt; [1] &amp;quot;result&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Another rate limiting function is &lt;code&gt;slowly()&lt;/code&gt;. While &lt;code&gt;insistently()&lt;/code&gt; loops by itself, &lt;code&gt;slowly()&lt;/code&gt; is designed to be used in your own loops, for instance in a map iteration:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;f &amp;lt;- function(...) print(Sys.time())

walk(1:3, f)
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:28 CET&amp;quot;
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:28 CET&amp;quot;
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:28 CET&amp;quot;

walk(1:3, slowly(f))
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:28 CET&amp;quot;
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:29 CET&amp;quot;
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:30 CET&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;slowly()&lt;/code&gt; uses a constant rate by default while &lt;code&gt;insistently()&lt;/code&gt; uses a backoff rate. The rate limiting can be configured with optional jitter via &lt;code&gt;rate_backoff()&lt;/code&gt; and &lt;code&gt;rate_delay()&lt;/code&gt;, which implement exponential backoff rate and constant rate respectively.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;walk(1:3, slowly(f, rate_backoff(2, max_times = Inf)))
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:30 CET&amp;quot;
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:32 CET&amp;quot;
#&amp;gt; [1] &amp;quot;2019-02-06 16:22:34 CET&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;map-and-reduce-improvements&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Map and reduce improvements&lt;/h2&gt;
&lt;div id=&#34;map_if-or-else&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;&lt;code&gt;map_if()&lt;/code&gt;… or else?&lt;/h3&gt;
&lt;p&gt;If you like using &lt;code&gt;map_if()&lt;/code&gt;, perhaps you’ll find the new &lt;code&gt;.else&lt;/code&gt; argument useful. &lt;code&gt;.else&lt;/code&gt; is a function applied to elements for which the predicate is &lt;code&gt;FALSE&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;map_if(iris, is.numeric, mean, .else = nlevels)
#&amp;gt; $Sepal.Length
#&amp;gt; [1] 5.843333
#&amp;gt; 
#&amp;gt; $Sepal.Width
#&amp;gt; [1] 3.057333
#&amp;gt; 
#&amp;gt; $Petal.Length
#&amp;gt; [1] 3.758
#&amp;gt; 
#&amp;gt; $Petal.Width
#&amp;gt; [1] 1.199333
#&amp;gt; 
#&amp;gt; $Species
#&amp;gt; [1] 3&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;new-map_at-features&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;New &lt;code&gt;map_at()&lt;/code&gt; features&lt;/h3&gt;
&lt;p&gt;Colin Fay (&lt;span class=&#34;citation&#34;&gt;@ColinFay&lt;/span&gt;) has added support for tidyselect expressions to &lt;code&gt;map_at()&lt;/code&gt; and other &lt;code&gt;_at&lt;/code&gt; mappers. This brings the interface of these functions closer to scoped functions from the dplyr package, such as &lt;code&gt;dplyr::mutate_at()&lt;/code&gt;. Note that &lt;code&gt;vars()&lt;/code&gt; is currently not reexported from purrr, so you need to use &lt;code&gt;dplyr::vars()&lt;/code&gt; or &lt;code&gt;ggplot2::vars()&lt;/code&gt; for the time being.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;suppressMessages(library(&amp;quot;dplyr&amp;quot;))

x &amp;lt;- list(
  foo = 1:5,
  bar = 6:10,
  baz = 11:15
)

map_at(x, vars(starts_with(&amp;quot;b&amp;quot;)), mean)
#&amp;gt; $foo
#&amp;gt; [1] 1 2 3 4 5
#&amp;gt; 
#&amp;gt; $bar
#&amp;gt; [1] 8
#&amp;gt; 
#&amp;gt; $baz
#&amp;gt; [1] 13&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;map_at()&lt;/code&gt; now also supports negative selections:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;map_at(x, -2, `*`, 1000)
#&amp;gt; $foo
#&amp;gt; [1] 1000 2000 3000 4000 5000
#&amp;gt; 
#&amp;gt; $bar
#&amp;gt; [1]  6  7  8  9 10
#&amp;gt; 
#&amp;gt; $baz
#&amp;gt; [1] 11000 12000 13000 14000 15000&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;early-termination-of-reduction&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Early termination of reduction&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;reduce()&lt;/code&gt; is an operation that combines the elements of a vector into a single value by calling a binary function repeatedly with the result so far and the next input of a vector. &lt;code&gt;reduce()&lt;/code&gt; and its variant &lt;code&gt;accumulate()&lt;/code&gt; now support early termination of the reduction. To halt the computation, just return the last value wrapped in a &lt;code&gt;done()&lt;/code&gt; box:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# This computes the total sum of the input vector
reduce(1:100, ~ .x + .y)
#&amp;gt; [1] 5050

# This stops as soon as the sum is greater than 50
reduce(1:100, ~ if (.x &amp;gt; 50) done(.x) else .x + .y)
#&amp;gt; [1] 55&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This feature takes inspiration from the &lt;a href=&#34;https://clojuredocs.org/clojure.core/reduced&#34;&gt;Clojure&lt;/a&gt; language.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;consistency&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Consistency&lt;/h2&gt;
&lt;p&gt;In this polishing release, a lot of effort went towards consistency of behaviour and of the interface.&lt;/p&gt;
&lt;div id=&#34;behaviour&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Behaviour&lt;/h3&gt;
&lt;div id=&#34;better-support-for-s3-vectors&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Better support for S3 vectors&lt;/h4&gt;
&lt;p&gt;We are working hard on improving support for S3 vectors in the tidyverse. As of this release, &lt;code&gt;modify()&lt;/code&gt; is now a wrapper around &lt;code&gt;[[&amp;lt;-&lt;/code&gt; instead of &lt;code&gt;[&amp;lt;-&lt;/code&gt;. This should make it directly compatible with a larger set of vector classes. Thanks to the work of Mikko Marttila (&lt;span class=&#34;citation&#34;&gt;@mikmart&lt;/span&gt;), &lt;code&gt;pmap()&lt;/code&gt; and &lt;code&gt;pwalk()&lt;/code&gt; also do a better job of preserving S3 classes. Finally, &lt;code&gt;pluck()&lt;/code&gt; now properly calls the &lt;code&gt;[[&lt;/code&gt; methods of S3 objects.&lt;/p&gt;
&lt;p&gt;In the next version of purrr, we plan to use the in-development vctrs package to provide more principled and predictable vector operations. This should help us preserve the class and properties of S3 vectors like factors, dates, or your custom classes.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;stricter-predicate-checking&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Stricter predicate checking&lt;/h4&gt;
&lt;p&gt;purrr now checks the results of your predicate functions, which must now consistently return &lt;code&gt;TRUE&lt;/code&gt; or &lt;code&gt;FALSE&lt;/code&gt;. We no longer offer support for &lt;code&gt;NA&lt;/code&gt; or for boolish numeric values (R normally interprets 0 as &lt;code&gt;FALSE&lt;/code&gt; and all other values as &lt;code&gt;TRUE&lt;/code&gt;). The purpose of this change is to detect errors earlier with a more relevant error message.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;keep(c(1, NA, 3), ~ . %% 2 == 0)
#&amp;gt; Error: Predicate functions must return a single `TRUE` or `FALSE`, not a missing value&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;interface&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Interface&lt;/h3&gt;
&lt;div id=&#34;direction-of-application&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Direction of application&lt;/h4&gt;
&lt;p&gt;The direction of application is now specified the same way across purrr functions. &lt;code&gt;reduce()&lt;/code&gt;, &lt;code&gt;compose()&lt;/code&gt; and &lt;code&gt;detect()&lt;/code&gt; now have a &lt;code&gt;.dir&lt;/code&gt; parameter that can take the value &lt;code&gt;&amp;quot;forward&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;backward&amp;quot;&lt;/code&gt;. This terminology should be less ambiguous than “left” and “right”:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;reduce(1:4, `-`, .dir = &amp;quot;backward&amp;quot;)

compose(foo, bar, .dir = &amp;quot;forward&amp;quot;)

detect(1:5, ~ . %% 2 == 0, .dir = &amp;quot;backward&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the backward version of &lt;code&gt;reduce()&lt;/code&gt; (called right-reduce in the literature) applies the reduced function in a slightly different way than &lt;code&gt;reduce_right()&lt;/code&gt;. The new algorithm is more consistent with how this operation is usually defined in other languages.&lt;/p&gt;
&lt;p&gt;Following the introduction of the &lt;code&gt;.dir&lt;/code&gt; parameters, the &lt;code&gt;_right&lt;/code&gt; variants such as &lt;code&gt;reduce_right()&lt;/code&gt; have been soft-deprecated, as well as the &lt;code&gt;.right&lt;/code&gt; parameter of &lt;code&gt;detect()&lt;/code&gt; and &lt;code&gt;detect_index()&lt;/code&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;partial&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;partial()&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;partial()&lt;/code&gt; has been rewritten to be a simple wrapper around &lt;code&gt;call_modify()&lt;/code&gt; and &lt;code&gt;eval_tidy()&lt;/code&gt; from the rlang package. Consequently, the &lt;code&gt;.env&lt;/code&gt;, &lt;code&gt;.lazy&lt;/code&gt; and &lt;code&gt;.first&lt;/code&gt; arguments are soft-deprecated and replaced by a flexible syntax.&lt;/p&gt;
&lt;p&gt;To control the timing of evaluation, unquote the partialised arguments that should be evaluated only once when the function is created. The non-unquoted arguments are evaluated at each invokation of the function:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;my_list &amp;lt;- partial(list, lazy = rnorm(3), eager = !!rnorm(3))

my_list()
#&amp;gt; $lazy
#&amp;gt; [1]  0.2945451  0.3897943 -1.2080762
#&amp;gt; 
#&amp;gt; $eager
#&amp;gt; [1] -0.1842525 -1.3713305 -0.5991677

my_list()
#&amp;gt; $lazy
#&amp;gt; [1] -0.3636760 -1.6266727 -0.2564784
#&amp;gt; 
#&amp;gt; $eager
#&amp;gt; [1] -0.1842525 -1.3713305 -0.5991677&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also control the position of the future arguments by passing an empty &lt;code&gt;... =&lt;/code&gt; parameter. This syntax is powered by &lt;code&gt;rlang::call_modify()&lt;/code&gt; and allows you to add or move dots in a quoted function call. In the case of &lt;code&gt;partial()&lt;/code&gt;, the dots represent the future arguments. We use this syntax in the following snippet to position the future arguments right between two partialised arguments:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;my_list &amp;lt;- partial(list, 1, ... = , 2)

my_list()
#&amp;gt; [[1]]
#&amp;gt; [1] 1
#&amp;gt; 
#&amp;gt; [[2]]
#&amp;gt; [1] 2

my_list(&amp;quot;foo&amp;quot;)
#&amp;gt; [[1]]
#&amp;gt; [1] 1
#&amp;gt; 
#&amp;gt; [[2]]
#&amp;gt; [1] &amp;quot;foo&amp;quot;
#&amp;gt; 
#&amp;gt; [[3]]
#&amp;gt; [1] 2&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;exec-replaces-invoke&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;&lt;code&gt;exec()&lt;/code&gt; replaces &lt;code&gt;invoke()&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;We are retiring &lt;code&gt;invoke()&lt;/code&gt; and &lt;code&gt;invoke_map()&lt;/code&gt; in favour of &lt;code&gt;exec()&lt;/code&gt;. Retirement means that we’ll keep these functions indefinitely in the package, but we won’t add features or recommend using them.&lt;/p&gt;
&lt;p&gt;We are now favouring &lt;code&gt;exec()&lt;/code&gt;, which uses the tidy dots syntax for passing lists of arguments:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Before:
invoke(mean, list(na.rm = TRUE), x = 1:10)
#&amp;gt; [1] 5.5

# After
exec(mean, 1:10, !!!list(na.rm = TRUE))
#&amp;gt; [1] 5.5&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;filling-the-missing-parts&#34; class=&#34;section level4&#34;&gt;
&lt;h4&gt;Filling the missing parts&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;purrr 0.3.0 introduces &lt;code&gt;accumulate2()&lt;/code&gt;, &lt;code&gt;modify2()&lt;/code&gt; and &lt;code&gt;imodify()&lt;/code&gt; variants.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By popular request, &lt;code&gt;at_depth()&lt;/code&gt; is back as &lt;code&gt;map_depth()&lt;/code&gt;. Unlike &lt;code&gt;modify_depth()&lt;/code&gt; which preserves the class structure of the input tree, this variant only returns trees made of lists of lists (up to the given depth), coercing vectors if needed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;thanks&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Thanks!&lt;/h2&gt;
&lt;p&gt;Thanks to all the contributors for this release!&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/ArtemSokolov&#34;&gt;＠ArtemSokolov&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;＠batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/bbrewington&#34;&gt;＠bbrewington&lt;/a&gt;, &lt;a href=&#34;https://github.com/billdenney&#34;&gt;＠billdenney&lt;/a&gt;, &lt;a href=&#34;https://github.com/cderv&#34;&gt;＠cderv&lt;/a&gt;, &lt;a href=&#34;https://github.com/cfhammill&#34;&gt;＠cfhammill&lt;/a&gt;, &lt;a href=&#34;https://github.com/ColinFay&#34;&gt;＠ColinFay&lt;/a&gt;, &lt;a href=&#34;https://github.com/dan-reznik&#34;&gt;＠dan-reznik&lt;/a&gt;, &lt;a href=&#34;https://github.com/daniel-barnett&#34;&gt;＠daniel-barnett&lt;/a&gt;, &lt;a href=&#34;https://github.com/danilinares&#34;&gt;＠danilinares&lt;/a&gt;, &lt;a href=&#34;https://github.com/drtjc&#34;&gt;＠drtjc&lt;/a&gt;, &lt;a href=&#34;https://github.com/egnha&#34;&gt;＠egnha&lt;/a&gt;, &lt;a href=&#34;https://github.com/Eluvias&#34;&gt;＠Eluvias&lt;/a&gt;, &lt;a href=&#34;https://github.com/flying-sheep&#34;&gt;＠flying-sheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/gergness&#34;&gt;＠gergness&lt;/a&gt;, &lt;a href=&#34;https://github.com/gvwilson&#34;&gt;＠gvwilson&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;＠hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/hammer&#34;&gt;＠hammer&lt;/a&gt;, &lt;a href=&#34;https://github.com/ijlyttle&#34;&gt;＠ijlyttle&lt;/a&gt;, &lt;a href=&#34;https://github.com/ilarischeinin&#34;&gt;＠ilarischeinin&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;＠IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/ISPritchin&#34;&gt;＠ISPritchin&lt;/a&gt;, &lt;a href=&#34;https://github.com/jameslairdsmith&#34;&gt;＠jameslairdsmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/jameslamb&#34;&gt;＠jameslamb&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrnold&#34;&gt;＠jrnold&lt;/a&gt;, &lt;a href=&#34;https://github.com/kcf-jackson&#34;&gt;＠kcf-jackson&lt;/a&gt;, &lt;a href=&#34;https://github.com/leungi&#34;&gt;＠leungi&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;＠lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/loladze&#34;&gt;＠loladze&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxheld83&#34;&gt;＠maxheld83&lt;/a&gt;, &lt;a href=&#34;https://github.com/mikmart&#34;&gt;＠mikmart&lt;/a&gt;, &lt;a href=&#34;https://github.com/MilesMcBain&#34;&gt;＠MilesMcBain&lt;/a&gt;, &lt;a href=&#34;https://github.com/moodymudskipper&#34;&gt;＠moodymudskipper&lt;/a&gt;, &lt;a href=&#34;https://github.com/mrstlee&#34;&gt;＠mrstlee&lt;/a&gt;, &lt;a href=&#34;https://github.com/namelessjon&#34;&gt;＠namelessjon&lt;/a&gt;, &lt;a href=&#34;https://github.com/r-cheologist&#34;&gt;＠r-cheologist&lt;/a&gt;, &lt;a href=&#34;https://github.com/randomgambit&#34;&gt;＠randomgambit&lt;/a&gt;, &lt;a href=&#34;https://github.com/rmflight&#34;&gt;＠rmflight&lt;/a&gt;, &lt;a href=&#34;https://github.com/roumail&#34;&gt;＠roumail&lt;/a&gt;, &lt;a href=&#34;https://github.com/Ryo-N7&#34;&gt;＠Ryo-N7&lt;/a&gt;, &lt;a href=&#34;https://github.com/serina-robinson&#34;&gt;＠serina-robinson&lt;/a&gt;, &lt;a href=&#34;https://github.com/skaltman&#34;&gt;＠skaltman&lt;/a&gt;, &lt;a href=&#34;https://github.com/suraggupta&#34;&gt;＠suraggupta&lt;/a&gt;, &lt;a href=&#34;https://github.com/thays42&#34;&gt;＠thays42&lt;/a&gt;, &lt;a href=&#34;https://github.com/tyluRp&#34;&gt;＠tyluRp&lt;/a&gt;, &lt;a href=&#34;https://github.com/tzakharko&#34;&gt;＠tzakharko&lt;/a&gt;, &lt;a href=&#34;https://github.com/VincentGuyader&#34;&gt;＠VincentGuyader&lt;/a&gt;, &lt;a href=&#34;https://github.com/wlandau&#34;&gt;＠wlandau&lt;/a&gt;, &lt;a href=&#34;https://github.com/wmayner&#34;&gt;＠wmayner&lt;/a&gt;, &lt;a href=&#34;https://github.com/yanxianl&#34;&gt;＠yanxianl&lt;/a&gt;, &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;＠yutannihilation&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yysh12&#34;&gt;＠yysh12&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
</content>
    </item>
    
    <item>
      <title>tibble 2.0.1</title>
      <link>https://www.tidyverse.org/blog/2019/01/tibble-2.0.1/</link>
      <pubDate>Tue, 15 Jan 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/01/tibble-2.0.1/</guid>
      <description>PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};  I&amp;rsquo;m pleased to announce that version 2.0.1 of the tibble package is on CRAN now, just in time for rstudio::conf(). Tibbles are a modern reimagining of the data frame, keeping what time has shown to be effective, and throwing out what is not, with nicer default output too! Grab the latest version with:
install.packages(&amp;#34;tibble&amp;#34;) This release required a bit of preparation, including a pre-release blog post that described the breaking changes, mostly in as_tibble(), new_tibble(), set_tidy_names(), tidy_names(), and names&amp;lt;-(), and a patch release that fixed problems found after the initial 2.</description>
      <content>&lt;STYLE type=&#39;text/css&#39; scoped&gt;
PRE.fansi SPAN {padding-top: .25em; padding-bottom: .25em};
&lt;/STYLE&gt;
&lt;p&gt;I&amp;rsquo;m pleased to announce that version 2.0.1 of the &lt;em&gt;tibble&lt;/em&gt; package is on CRAN now, just in time for &lt;a href=&#34;https://www.rstudio.com/conference/&#34;&gt;rstudio::conf()&lt;/a&gt;. Tibbles are a modern reimagining of the data frame, keeping what time has shown to be effective, and throwing out what is not, with nicer default output too! Grab the latest version with:&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;install.packages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tibble&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;p&gt;This release required a bit of preparation, including a &lt;a href=&#34;https://www.tidyverse.org/articles/2018/11/tibble-2.0.0-pre-announce/&#34;&gt;pre-release blog post&lt;/a&gt; that described the breaking changes, mostly in &lt;a href=&#34;https://tibble.tidyverse.org/reference/as_tibble.html&#34;&gt;&lt;code&gt;as_tibble()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tibble.tidyverse.org/reference/new_tibble.html&#34;&gt;&lt;code&gt;new_tibble()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tibble.tidyverse.org/reference/set_tidy_names.html&#34;&gt;&lt;code&gt;set_tidy_names()&lt;/code&gt;&lt;/a&gt;, &lt;a href=&#34;https://tibble.tidyverse.org/reference/tidy_names.html&#34;&gt;&lt;code&gt;tidy_names()&lt;/code&gt;&lt;/a&gt;, and &lt;code&gt;names&amp;lt;-()&lt;/code&gt;, and a patch release that fixed problems found after the initial 2.0.0 release.
In this blog post, I focus on a few user- and programmer-related changes, and give an outlook over future development:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://tibble.tidyverse.org/reference/view.html&#34;&gt;&lt;code&gt;view()&lt;/code&gt;&lt;/a&gt;, nameless &lt;a href=&#34;https://tibble.tidyverse.org/reference/enframe.html&#34;&gt;&lt;code&gt;enframe()&lt;/code&gt;&lt;/a&gt;, 2D columns&lt;/li&gt;
&lt;li&gt;Lifecycle, robustness, name repair, row names, &lt;a href=&#34;https://tibble.tidyverse.org/reference/glimpse.html&#34;&gt;&lt;code&gt;glimpse()&lt;/code&gt;&lt;/a&gt; for subclasses&lt;/li&gt;
&lt;li&gt;&lt;em&gt;vctrs&lt;/em&gt;, dependencies, decorations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a complete overview please see the &lt;a href=&#34;https://github.com/tidyverse/tibble/releases/tag/v2.0.0&#34;&gt;release notes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Use the &lt;a href=&#34;https://github.com/tidyverse/tibble/issues&#34;&gt;issue tracker&lt;/a&gt; to submit bugs or suggest ideas, your contributions are always welcome.&lt;/p&gt;




&lt;h2 id=&#34;changes-that-affect-users&#34;&gt;Changes that affect users
  &lt;a href=&#34;#changes-that-affect-users&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;view&#34;&gt;view
  &lt;a href=&#34;#view&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The experimental &lt;a href=&#34;https://tibble.tidyverse.org/reference/view.html&#34;&gt;&lt;code&gt;view()&lt;/code&gt;&lt;/a&gt; function forwards its input to &lt;code&gt;utils::View()&lt;/code&gt; (only in interactive mode) and always returns its input invisibly, which is useful for pipe-based workflows.
Currently it is unclear if this functionality should live in &lt;em&gt;tibble&lt;/em&gt; or elsewhere.&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;# This is a no-op in non-interactive mode.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;# In interactive mode, a viewer window/pane will open.&lt;/span&gt;
&lt;span class=&#34;n&#34;&gt;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3 id=&#34;nameless-enframe&#34;&gt;Nameless enframe
  &lt;a href=&#34;#nameless-enframe&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The &lt;a href=&#34;https://tibble.tidyverse.org/reference/enframe.html&#34;&gt;&lt;code&gt;enframe()&lt;/code&gt;&lt;/a&gt; function always has been a good way to convert a (named) vector to a two-column data frame.
In this version, conversion to a one-column data frame is also supported by setting the &lt;code&gt;name&lt;/code&gt; argument to &lt;code&gt;NULL&lt;/code&gt;.
This is now the recommended way to turn a vector to a one-column tibble, due to changes to the default implementation of &lt;a href=&#34;https://tibble.tidyverse.org/reference/as_tibble.html&#34;&gt;&lt;code&gt;as_tibble()&lt;/code&gt;&lt;/a&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;enframe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;letters&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;[1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 2&lt;/span&gt;
#&amp;gt;    &lt;span style=&#39;font-weight: bold;&#39;&gt;name&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;value&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;int&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;     1 a    &lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt;     2 b    &lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt;     3 c&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&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;enframe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;letters&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;[1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 1&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;font-weight: bold;&#39;&gt;value&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt; a    &lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt; b    &lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt; c&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;




&lt;h3 id=&#34;2d-columns&#34;&gt;2D columns
  &lt;a href=&#34;#2d-columns&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;&lt;code&gt;tibble()&lt;/code&gt; now supports columns that are matrices or data frames.
These have always been supported in data frames and are used in some modelling functions.
We are looking forward to supporting these and other exciting use cases, see also the &lt;a href=&#34;https://adv-r.hadley.nz/vectors-chap.html#matrix-and-data-frame-columns&#34;&gt;Matrix and data frame columns&lt;/a&gt; chapter of adv-r.
The number of rows in these objects must be consistent with the length of the other columns.
Internally, this feature required using &lt;code&gt;NROW()&lt;/code&gt; instead of &lt;code&gt;length()&lt;/code&gt; in a few spots, which conveniently returns the length for vectors and the number of rows for 2D objects.
The required support in &lt;em&gt;pillar&lt;/em&gt; has been added earlier last year.&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#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;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;d&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;e&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;9&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;h&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;11&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)),&lt;/span&gt;
  &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;diag&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 4&lt;/span&gt;
#&amp;gt;       &lt;span style=&#39;font-weight: bold;&#39;&gt;a&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;b$c&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;d$e&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;$f$g&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;$$h&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;i[,1]&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;[,2]&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;[,3]&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;int&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;int&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;int&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;     1     4     7    10    11     1     0     0&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt;     2     5     8    10    11     0     1     0&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt;     3     6     9    10    11     0     0     1&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;




&lt;h2 id=&#34;changes-that-affect-package-developers&#34;&gt;Changes that affect package developers
  &lt;a href=&#34;#changes-that-affect-package-developers&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;lifecycle&#34;&gt;Lifecycle
  &lt;a href=&#34;#lifecycle&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;&lt;a href=&#34;https://www.tidyverse.org/lifecycle/&#34;&gt;&lt;img src=&#34;https://img.shields.io/badge/lifecycle-stable-brightgreen.svg&#34; alt=&#34;Lifecycle&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All functions have been assigned a lifecycle.
The &lt;em&gt;tibble&lt;/em&gt; package has now reached the &amp;ldquo;stable&amp;rdquo; lifecycle, functions in a different lifecycle stage are marked as such in their documentation.
One example is the &lt;a href=&#34;https://tibble.tidyverse.org/reference/add_row.html&#34;&gt;&lt;code&gt;add_row()&lt;/code&gt;&lt;/a&gt; function: it is unclear if it  should ensure that all columns have length one by wrapping in a list if necessary, and a better implementation is perhaps possible once &lt;em&gt;tibble&lt;/em&gt; uses the &lt;em&gt;vctrs&lt;/em&gt; package, see below.
Therefore this function is marked &amp;ldquo;questioning&amp;rdquo;.
Learn more about lifecycle in the tidyverse at &lt;a href=&#34;https://www.tidyverse.org/lifecycle/&#34;&gt;https://www.tidyverse.org/lifecycle/&lt;/a&gt;.&lt;/p&gt;




&lt;h3 id=&#34;robustness&#34;&gt;Robustness
  &lt;a href=&#34;#robustness&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The new &lt;code&gt;.rows&lt;/code&gt; argument to &lt;a href=&#34;https://tibble.tidyverse.org/reference/tibble.html&#34;&gt;&lt;code&gt;tibble()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://tibble.tidyverse.org/reference/as_tibble.html&#34;&gt;&lt;code&gt;as_tibble()&lt;/code&gt;&lt;/a&gt; allows specifying the expected number of rows explicitly, even if it&amp;rsquo;s evident from the data.
This supports writing even more defensive code.
The &lt;code&gt;nrow&lt;/code&gt; argument to the low-level &lt;a href=&#34;https://tibble.tidyverse.org/reference/new_tibble.html&#34;&gt;&lt;code&gt;new_tibble()&lt;/code&gt;&lt;/a&gt; constructor is now mandatory, on the other hand most expensive checks have been moved to the new &lt;a href=&#34;https://tibble.tidyverse.org/reference/validate_tibble.html&#34;&gt;&lt;code&gt;validate_tibble()&lt;/code&gt;&lt;/a&gt; function.
This means that constructions of tibbles is now faster by default if you know that the inputs are correct, but you can always double-check if needed.
See also the &lt;a href=&#34;https://adv-r.hadley.nz/s3.html#s3-classes&#34;&gt;S3 classes&lt;/a&gt; chapter in adv-r for motivation.&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#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;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.rows&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 2&lt;/span&gt;
#&amp;gt;       &lt;span style=&#39;font-weight: bold;&#39;&gt;a&lt;/span&gt;&lt;span&gt;     &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;b&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;int&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;     1     1&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt;     1     2&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt;     1     3&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&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;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.rows&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Tibble columns must have consistent lengths, only values of length one are recycled:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Length 3: Requested with `.rows` argument&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Length 2: Column `b`&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.rows&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 1&lt;/span&gt;
#&amp;gt;       &lt;span style=&#39;font-weight: bold;&#39;&gt;a&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;     1&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt;     1&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt;     1&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&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;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;iris[1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.rows&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 5&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;font-weight: bold;&#39;&gt;Sepal.Length&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;Sepal.Width&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;Petal.Length&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;Petal.Width&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;Species&lt;/span&gt;
#&amp;gt;          &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt;       &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt;        &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt;       &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;fct&amp;gt;&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;          5.1         3.5          1.4         0.2 setosa &lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt;          4.9         3            1.4         0.2 setosa &lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt;          4.7         3.2          1.3         0.2 setosa&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&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;new_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#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;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nrow&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 3 x 1&lt;/span&gt;
#&amp;gt;       &lt;span style=&#39;font-weight: bold;&#39;&gt;a&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;int&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;     1&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;2&lt;/span&gt;&lt;span&gt;     2&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;3&lt;/span&gt;&lt;span&gt;     3&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&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;bad&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;-&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;new_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#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;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;nrow&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;validate_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bad&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Tibble columns must have consistent lengths, only values of length one are recycled:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Length 3: Requested with `nrow` argument&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * Length 2: Column `a`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3 id=&#34;name-repair&#34;&gt;Name repair
  &lt;a href=&#34;#name-repair&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;Column name repair has more direct support, via the new &lt;code&gt;.name_repair&lt;/code&gt; argument to &lt;a href=&#34;https://tibble.tidyverse.org/reference/tibble.html&#34;&gt;&lt;code&gt;tibble()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://tibble.tidyverse.org/reference/as_tibble.html&#34;&gt;&lt;code&gt;as_tibble()&lt;/code&gt;&lt;/a&gt;.
It takes the following values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;minimal&amp;quot;&lt;/code&gt;: No name repair or checks, beyond basic existence.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;unique&amp;quot;&lt;/code&gt;: Make sure names are unique and not empty.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;check_unique&amp;quot;&lt;/code&gt;: (default value), no name repair, but check they are &lt;code&gt;unique&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;universal&amp;quot;&lt;/code&gt;: Make the names &lt;code&gt;unique&lt;/code&gt; and syntactic.&lt;/li&gt;
&lt;li&gt;a function: apply custom name repair (e.g., &lt;code&gt;.name_repair = make.names&lt;/code&gt; or &lt;code&gt;.name_repair = ~make.names(., unique = TRUE)&lt;/code&gt; for names in the style of base R).&lt;/li&gt;
&lt;/ul&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;## by default, duplicate names are not allowed&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Error: Column name `1a` must not be duplicated.&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; Use .name_repair to specify repair.&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;## you can authorize duplicate names&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;minimal&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 class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 2&lt;/span&gt;
#&amp;gt;    &lt;span style=&#39;font-weight: bold;&#39;&gt;`1a`&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;`1a`&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;     1     2&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&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;## or request that the names be made unique&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;unique&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; New names:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `1a` -&amp;gt; `1a..1`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `1a` -&amp;gt; `1a..2`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 2&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;font-weight: bold;&#39;&gt;`1a..1`&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;`1a..2`&lt;/span&gt;
#&amp;gt;     &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;       1       2&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&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;## or universal&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;`1a`&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;.name_repair&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;universal&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; New names:&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `1a` -&amp;gt; ..1a..1&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; * `1a` -&amp;gt; ..1a..2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 1 x 2&lt;/span&gt;
#&amp;gt;   &lt;span style=&#39;font-weight: bold;&#39;&gt;..1a..1&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;..1a..2&lt;/span&gt;
#&amp;gt;     &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;1&lt;/span&gt;&lt;span&gt;       1       2&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;




&lt;h3 id=&#34;row-names&#34;&gt;Row names
  &lt;a href=&#34;#row-names&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;Row name handling is stricter.
Row names were never supported in &lt;a href=&#34;https://tibble.tidyverse.org/reference/tibble.html&#34;&gt;&lt;code&gt;tibble()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://tibble.tidyverse.org/reference/new_tibble.html&#34;&gt;&lt;code&gt;new_tibble()&lt;/code&gt;&lt;/a&gt;, and are now stripped by default in &lt;a href=&#34;https://tibble.tidyverse.org/reference/as_tibble.html&#34;&gt;&lt;code&gt;as_tibble()&lt;/code&gt;&lt;/a&gt;.
The &lt;code&gt;rownames&lt;/code&gt; argument to &lt;a href=&#34;https://tibble.tidyverse.org/reference/as_tibble.html&#34;&gt;&lt;code&gt;as_tibble()&lt;/code&gt;&lt;/a&gt; supports:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;NULL&lt;/code&gt;: remove row names (default),&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NA&lt;/code&gt;: keep row names,&lt;/li&gt;
&lt;li&gt;A string: the name of the new column that will contain the existing row names, which are no longer present in the result.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The old default can be restored by calling &lt;code&gt;pkgconfig::set_config(&amp;quot;tibble::rownames&amp;quot;, NA)&lt;/code&gt;, this also works for packages that import &lt;em&gt;tibble&lt;/em&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;rownames&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [1] &amp;#34;1&amp;#34;  &amp;#34;2&amp;#34;  &amp;#34;3&amp;#34;  &amp;#34;4&amp;#34;  &amp;#34;5&amp;#34;  &amp;#34;6&amp;#34;  &amp;#34;7&amp;#34;  &amp;#34;8&amp;#34;  &amp;#34;9&amp;#34;  &amp;#34;10&amp;#34; &amp;#34;11&amp;#34; &amp;#34;12&amp;#34; &amp;#34;13&amp;#34; &amp;#34;14&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [15] &amp;#34;15&amp;#34; &amp;#34;16&amp;#34; &amp;#34;17&amp;#34; &amp;#34;18&amp;#34; &amp;#34;19&amp;#34; &amp;#34;20&amp;#34; &amp;#34;21&amp;#34; &amp;#34;22&amp;#34; &amp;#34;23&amp;#34; &amp;#34;24&amp;#34; &amp;#34;25&amp;#34; &amp;#34;26&amp;#34; &amp;#34;27&amp;#34; &amp;#34;28&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [29] &amp;#34;29&amp;#34; &amp;#34;30&amp;#34; &amp;#34;31&amp;#34; &amp;#34;32&amp;#34;&lt;/span&gt;
&lt;span class=&#34;nf&#34;&gt;as_tibble&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;mtcars&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rownames&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;make_model&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 class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# A tibble: 32 x 12&lt;/span&gt;
#&amp;gt;    &lt;span style=&#39;font-weight: bold;&#39;&gt;make_model&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;mpg&lt;/span&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;cyl&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;disp&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;hp&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;drat&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;wt&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;qsec&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;vs&lt;/span&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;am&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;span style=&#39;font-weight: bold;&#39;&gt;gear&lt;/span&gt;
#&amp;gt;    &lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;chr&amp;gt;&lt;/span&gt;&lt;span&gt;      &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 1&lt;/span&gt;&lt;span&gt; Mazda RX4   21       6  160    110  3.9   2.62  16.5     0     1     4&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 2&lt;/span&gt;&lt;span&gt; Mazda RX4…  21       6  160    110  3.9   2.88  17.0     0     1     4&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 3&lt;/span&gt;&lt;span&gt; Datsun 710  22.8     4  108     93  3.85  2.32  18.6     1     1     4&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 4&lt;/span&gt;&lt;span&gt; Hornet 4 …  21.4     6  258    110  3.08  3.22  19.4     1     0     3&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 5&lt;/span&gt;&lt;span&gt; Hornet Sp…  18.7     8  360    175  3.15  3.44  17.0     0     0     3&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 6&lt;/span&gt;&lt;span&gt; Valiant     18.1     6  225    105  2.76  3.46  20.2     1     0     3&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 7&lt;/span&gt;&lt;span&gt; Duster 360  14.3     8  360    245  3.21  3.57  15.8     0     0     3&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 8&lt;/span&gt;&lt;span&gt; Merc 240D   24.4     4  147.    62  3.69  3.19  20       1     0     4&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt; 9&lt;/span&gt;&lt;span&gt; Merc 230    22.8     4  141.    95  3.92  3.15  22.9     1     0     4&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;10&lt;/span&gt;&lt;span&gt; Merc 280    19.2     6  168.   123  3.92  3.44  18.3     1     0     4&lt;/span&gt;
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;# … with 22 more rows, and 1 more variable: &lt;/span&gt;&lt;span style=&#39;color: #555555;font-weight: bold;&#39;&gt;carb&lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;




&lt;h3 id=&#34;glimpse-for-subclasses&#34;&gt;glimpse for subclasses
  &lt;a href=&#34;#glimpse-for-subclasses&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The &lt;a href=&#34;https://tibble.tidyverse.org/reference/glimpse.html&#34;&gt;&lt;code&gt;glimpse()&lt;/code&gt;&lt;/a&gt; function shows information obtained from &lt;a href=&#34;https://tibble.tidyverse.org/reference/tbl_sum.html&#34;&gt;&lt;code&gt;tbl_sum()&lt;/code&gt;&lt;/a&gt; in the header, e.g. grouping information for &lt;code&gt;grouped_df&lt;/code&gt; from &lt;em&gt;dplyr&lt;/em&gt;, or other information from packages that override the &lt;code&gt;tbl_df&lt;/code&gt; class.&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;iris&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;group_by&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Species&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;%&amp;gt;%&lt;/span&gt;
  &lt;span class=&#34;nf&#34;&gt;glimpse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;PRE class=&#34;fansi fansi-output&#34;&gt;&lt;CODE&gt;#&amp;gt; Observations: 150
#&amp;gt; Variables: 5
#&amp;gt; Groups: Species [3]
#&amp;gt; $ &lt;span style=&#39;font-weight: bold;&#39;&gt;Sepal.Length&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; 5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5…&lt;/span&gt;
#&amp;gt; $ &lt;span style=&#39;font-weight: bold;&#39;&gt;Sepal.Width &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; 3.5, 3.0, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1, 3…&lt;/span&gt;
#&amp;gt; $ &lt;span style=&#39;font-weight: bold;&#39;&gt;Petal.Length&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; 1.4, 1.4, 1.3, 1.5, 1.4, 1.7, 1.4, 1.5, 1.4, 1.5, 1…&lt;/span&gt;
#&amp;gt; $ &lt;span style=&#39;font-weight: bold;&#39;&gt;Petal.Width &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;dbl&amp;gt;&lt;/span&gt;&lt;span&gt; 0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1, 0…&lt;/span&gt;
#&amp;gt; $ &lt;span style=&#39;font-weight: bold;&#39;&gt;Species     &lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;font-style: italic;&#39;&gt;&amp;lt;fct&amp;gt;&lt;/span&gt;&lt;span&gt; setosa, setosa, setosa, setosa, setosa, setosa, set…&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;




&lt;h2 id=&#34;outlook&#34;&gt;Outlook
  &lt;a href=&#34;#outlook&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;



&lt;h3 id=&#34;vctrs&#34;&gt;vctrs
  &lt;a href=&#34;#vctrs&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;The plan is to &lt;a href=&#34;https://github.com/tidyverse/tibble/issues/521&#34;&gt;use &lt;em&gt;vctrs&lt;/em&gt;&lt;/a&gt; in &lt;em&gt;tibble&lt;/em&gt; 2.1.0.
This package is a solid foundation for handling coercion, concatenation and recycling in vectors of arbitrary type.
The support provided by &lt;em&gt;vctrs&lt;/em&gt; will yield a better &lt;a href=&#34;https://tibble.tidyverse.org/reference/add_row.html&#34;&gt;&lt;code&gt;add_row()&lt;/code&gt;&lt;/a&gt; implementation, in return name repair which is currently defined in &lt;em&gt;tibble&lt;/em&gt; should likely live in &lt;em&gt;vctrs&lt;/em&gt;.&lt;/p&gt;




&lt;h3 id=&#34;dependencies&#34;&gt;Dependencies
  &lt;a href=&#34;#dependencies&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;Currently, installing &lt;em&gt;tibble&lt;/em&gt; can bring in almost dozen other packages:&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;tools&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;package_dependencies&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;tibble&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;recursive&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;TRUE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;which&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Imports&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; $tibble&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [1] &amp;#34;cli&amp;#34;        &amp;#34;crayon&amp;#34;     &amp;#34;fansi&amp;#34;      &amp;#34;methods&amp;#34;    &amp;#34;pillar&amp;#34;    &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt;  [6] &amp;#34;pkgconfig&amp;#34;  &amp;#34;rlang&amp;#34;      &amp;#34;utils&amp;#34;      &amp;#34;assertthat&amp;#34; &amp;#34;grDevices&amp;#34; &lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;#&amp;gt; [11] &amp;#34;utf8&amp;#34;       &amp;#34;tools&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Some of them, namely &lt;em&gt;fansi&lt;/em&gt; and &lt;em&gt;utf8&lt;/em&gt;, contain code that requires compilation and are only required for optional features.
&lt;a href=&#34;https://github.com/tidyverse/tibble/issues/475&#34;&gt;The plan&lt;/a&gt; is to make these packages, and &lt;em&gt;crayon&lt;/em&gt;, a suggested package to &lt;em&gt;cli&lt;/em&gt;, and provide fallback implementations there.
When finished, taking a strong dependency on &lt;em&gt;tibble&lt;/em&gt; won&amp;rsquo;t add too many new dependencies (again): &lt;em&gt;rlang&lt;/em&gt;, &lt;em&gt;vctrs&lt;/em&gt; and &lt;em&gt;cli&lt;/em&gt; will be used by most of the tidyverse anyway, &lt;em&gt;pillar&lt;/em&gt; is the only truly new strong dependency.
Packages that subclass &lt;code&gt;tbl_df&lt;/code&gt; should import &lt;em&gt;tibble&lt;/em&gt; to make sure that the subsetting operator &lt;code&gt;[&lt;/code&gt; always behaves the same.
Constructing (subclasses of) tibbles should happen through &lt;a href=&#34;https://tibble.tidyverse.org/reference/new_tibble.html&#34;&gt;&lt;code&gt;new_tibble()&lt;/code&gt;&lt;/a&gt; only.&lt;/p&gt;




&lt;h3 id=&#34;decorations&#34;&gt;Decorations
  &lt;a href=&#34;#decorations&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h3&gt;&lt;p&gt;Tibbles have a very opinionated way to print their data, not always in line with users&amp;rsquo; expectations, and sometimes clearly wrong (e.g. for numerical data where the absolute mean is much larger than the standard deviation).
It seems difficult to devise a formatting that suits all needs, especially for numbers: how do we tell if a number represents money, or perhaps is a misspecified categorical variable or a UID?
&lt;a href=&#34;https://github.com/tidyverse/tibble/pull/411&#34;&gt;Decorations&lt;/a&gt; are an idea that might help here.
A decoration is applied only when printing a vector, which behaves identically to a bare vector otherwise.
Decorations can be &amp;ldquo;learned&amp;rdquo; from the data (using heuristics), or specified directly after import or when creating column,
and stored in attribues like &lt;code&gt;&amp;quot;class&amp;quot;&lt;/code&gt;.
It will be important to make sure that these attributes survive subsetting and perhaps some arithmetic transformations, easiest to achieve with the help of &lt;em&gt;vctrs&lt;/em&gt;.&lt;/p&gt;




&lt;h2 id=&#34;acknowledgments&#34;&gt;Acknowledgments
  &lt;a href=&#34;#acknowledgments&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thanks to Brodie Gaslam (&lt;a href=&#34;https://github.com/brodieG&#34;&gt;@brodieG&lt;/a&gt;) for his help with formatting this blog post and for spotting inaccurate wording.&lt;/p&gt;
&lt;p&gt;We also received issues, pull requests, and comments from 108 people since tibble 1.4.2. Thanks to everyone:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/adam-gruer&#34;&gt;@adam-gruer&lt;/a&gt;, &lt;a href=&#34;https://github.com/aegerton&#34;&gt;@aegerton&lt;/a&gt;, &lt;a href=&#34;https://github.com/alaindanet&#34;&gt;@alaindanet&lt;/a&gt;, &lt;a href=&#34;https://github.com/alexpghayes&#34;&gt;@alexpghayes&lt;/a&gt;, &lt;a href=&#34;https://github.com/alexwhan&#34;&gt;@alexwhan&lt;/a&gt;, &lt;a href=&#34;https://github.com/alistaire47&#34;&gt;@alistaire47&lt;/a&gt;, &lt;a href=&#34;https://github.com/anhqle&#34;&gt;@anhqle&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/brendanf&#34;&gt;@brendanf&lt;/a&gt;, &lt;a href=&#34;https://github.com/brodieG&#34;&gt;@brodieG&lt;/a&gt;, &lt;a href=&#34;https://github.com/cfhammill&#34;&gt;@cfhammill&lt;/a&gt;, &lt;a href=&#34;https://github.com/christophsax&#34;&gt;@christophsax&lt;/a&gt;, &lt;a href=&#34;https://github.com/cimentadaj&#34;&gt;@cimentadaj&lt;/a&gt;, &lt;a href=&#34;https://github.com/czeildi&#34;&gt;@czeildi&lt;/a&gt;, &lt;a href=&#34;https://github.com/DasHammett&#34;&gt;@DasHammett&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/earowang&#34;&gt;@earowang&lt;/a&gt;, &lt;a href=&#34;https://github.com/Eluvias&#34;&gt;@Eluvias&lt;/a&gt;, &lt;a href=&#34;https://github.com/Enchufa2&#34;&gt;@Enchufa2&lt;/a&gt;, &lt;a href=&#34;https://github.com/esford3&#34;&gt;@esford3&lt;/a&gt;, &lt;a href=&#34;https://github.com/flying-sheep&#34;&gt;@flying-sheep&lt;/a&gt;, &lt;a href=&#34;https://github.com/gavinsimpson&#34;&gt;@gavinsimpson&lt;/a&gt;, &lt;a href=&#34;https://github.com/GeorgeHayduke&#34;&gt;@GeorgeHayduke&lt;/a&gt;, &lt;a href=&#34;https://github.com/gregorp&#34;&gt;@gregorp&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/IndrajeetPatil&#34;&gt;@IndrajeetPatil&lt;/a&gt;, &lt;a href=&#34;https://github.com/iron0012&#34;&gt;@iron0012&lt;/a&gt;, &lt;a href=&#34;https://github.com/isteves&#34;&gt;@isteves&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeffreyhanson&#34;&gt;@jeffreyhanson&lt;/a&gt;, &lt;a href=&#34;https://github.com/jennybc&#34;&gt;@jennybc&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/JLYJabc&#34;&gt;@JLYJabc&lt;/a&gt;, &lt;a href=&#34;https://github.com/joranE&#34;&gt;@joranE&lt;/a&gt;, &lt;a href=&#34;https://github.com/jtelleriar&#34;&gt;@jtelleriar&lt;/a&gt;, &lt;a href=&#34;https://github.com/karldw&#34;&gt;@karldw&lt;/a&gt;, &lt;a href=&#34;https://github.com/kendonB&#34;&gt;@kendonB&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinushey&#34;&gt;@kevinushey&lt;/a&gt;, &lt;a href=&#34;https://github.com/kovla&#34;&gt;@kovla&lt;/a&gt;, &lt;a href=&#34;https://github.com/lbusett&#34;&gt;@lbusett&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/lorenzwalthert&#34;&gt;@lorenzwalthert&lt;/a&gt;, &lt;a href=&#34;https://github.com/lwiklendt&#34;&gt;@lwiklendt&lt;/a&gt;, &lt;a href=&#34;https://github.com/mattfidler&#34;&gt;@mattfidler&lt;/a&gt;, &lt;a href=&#34;https://github.com/MatthieuStigler&#34;&gt;@MatthieuStigler&lt;/a&gt;, &lt;a href=&#34;https://github.com/maxheld83&#34;&gt;@maxheld83&lt;/a&gt;, &lt;a href=&#34;https://github.com/michaelweylandt&#34;&gt;@michaelweylandt&lt;/a&gt;, &lt;a href=&#34;https://github.com/mingsu&#34;&gt;@mingsu&lt;/a&gt;, &lt;a href=&#34;https://github.com/momeara&#34;&gt;@momeara&lt;/a&gt;, &lt;a href=&#34;https://github.com/PalaceChan&#34;&gt;@PalaceChan&lt;/a&gt;, &lt;a href=&#34;https://github.com/pat-s&#34;&gt;@pat-s&lt;/a&gt;, &lt;a href=&#34;https://github.com/plantarum&#34;&gt;@plantarum&lt;/a&gt;, &lt;a href=&#34;https://github.com/prosoitos&#34;&gt;@prosoitos&lt;/a&gt;, &lt;a href=&#34;https://github.com/ptoche&#34;&gt;@ptoche&lt;/a&gt;, &lt;a href=&#34;https://github.com/QuLogic&#34;&gt;@QuLogic&lt;/a&gt;, &lt;a href=&#34;https://github.com/ralonso-igenomix&#34;&gt;@ralonso-igenomix&lt;/a&gt;, &lt;a href=&#34;https://github.com/randomgambit&#34;&gt;@randomgambit&lt;/a&gt;, &lt;a href=&#34;https://github.com/riccardopinosio&#34;&gt;@riccardopinosio&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/tomroh&#34;&gt;@tomroh&lt;/a&gt;, &lt;a href=&#34;https://github.com/Woosah&#34;&gt;@Woosah&lt;/a&gt;, &lt;a href=&#34;https://github.com/yonicd&#34;&gt;@yonicd&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>rlang 0.3.1</title>
      <link>https://www.tidyverse.org/blog/2019/01/rlang-0-3-1/</link>
      <pubDate>Thu, 10 Jan 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/01/rlang-0-3-1/</guid>
      <description>The patch release 0.3.1 of rlang is now on CRAN! This release polishes the rlang backtraces introduced in 0.3.0. See the NEWS for the complete set of changes. The main feature is rlang::entrace(), that you can set as a global error handler to get rlang backtraces for all errors.
Numbered backtraces Since rlang 0.3.0, errors thrown with abort() embed a backtrace that can be consulted by calling last_error(). We have improved the appearance of the backtraces by numbering its components.</description>
      <content>


&lt;p&gt;The patch release 0.3.1 of rlang is now on CRAN! This release polishes the rlang backtraces introduced in 0.3.0. See the &lt;a href=&#34;https://rlang.r-lib.org/news/index.html#rlang-0-3-1&#34;&gt;NEWS&lt;/a&gt; for the complete set of changes. The main feature is &lt;code&gt;rlang::entrace()&lt;/code&gt;, that you can set as a global error handler to get rlang backtraces for &lt;em&gt;all&lt;/em&gt; errors.&lt;/p&gt;
&lt;div id=&#34;numbered-backtraces&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Numbered backtraces&lt;/h2&gt;
&lt;p&gt;Since rlang 0.3.0, errors thrown with &lt;code&gt;abort()&lt;/code&gt; embed a backtrace that can be consulted by calling &lt;code&gt;last_error()&lt;/code&gt;. We have improved the appearance of the backtraces by numbering its components. Let’s trigger an error within a complicated call stack:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;f &amp;lt;- function() tryCatch(g(), warning = identity) # Try g()
g &amp;lt;- function() evalq(h())                        # Eval h()
h &amp;lt;- function() abort(&amp;quot;Oh no!&amp;quot;)                   # And fail!

f()&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;output&#34;&gt;
&lt;pre class=&#34;knitr r&#34;&gt;#&amp;gt; Error: Oh no!
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;Call `rlang::last_error()` to see a backtrace&lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The simplified backtrace shown on error is now numbered:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;last_error()&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;output&#34;&gt;
&lt;pre class=&#34;knitr r&#34;&gt;#&amp;gt; &lt;span style=&#39;font-weight: bold;&#39;&gt;&amp;lt;error&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; message: &lt;/span&gt;&lt;span style=&#39;font-style: italic;&#39;&gt;Oh no!&lt;/span&gt;&lt;span&gt;
#&amp;gt; class:   `rlang_error`
#&amp;gt; backtrace:
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 1. &lt;/span&gt;&lt;span style=&#39;color: #BB0000;&#39;&gt;global::f()&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 6. &lt;/span&gt;&lt;span style=&#39;color: #BB0000;&#39;&gt;global::g()&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 9. &lt;/span&gt;&lt;span style=&#39;color: #BB0000;&#39;&gt;global::h()&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;Call `rlang::last_trace()` to see the full backtrace&lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Notice how the numbering is not sequential? That’s because &lt;code&gt;last_error()&lt;/code&gt; displays a simplified backtrace by default, that only includes the calls that are most likely to help you figure out a problem. Call the new function &lt;code&gt;last_trace()&lt;/code&gt; to get the full picture:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;last_trace()&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;output&#34;&gt;
&lt;pre class=&#34;knitr r&#34;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;    &lt;/span&gt;&lt;span&gt;█
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 1. &lt;/span&gt;&lt;span&gt;└─global::f()
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 2. &lt;/span&gt;&lt;span&gt;  ├─base::tryCatch(g(), warning = identity)
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 3. &lt;/span&gt;&lt;span&gt;  │ └─base:::tryCatchList(expr, classes, parentenv, handlers)
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 4. &lt;/span&gt;&lt;span&gt;  │   └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 5. &lt;/span&gt;&lt;span&gt;  │     └─base:::doTryCatch(return(expr), name, parentenv, handler)
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 6. &lt;/span&gt;&lt;span&gt;  └─global::g()
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 7. &lt;/span&gt;&lt;span&gt;    ├─base::evalq(h())
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 8. &lt;/span&gt;&lt;span&gt;    │ └─base::evalq(h())
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 9. &lt;/span&gt;&lt;span&gt;    └─global::h()
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Note that this full backtrace is the equivalent of &lt;code&gt;base::traceback()&lt;/code&gt;, only structured as a tree, presented in reverse order, and with namespace prefixes. Here is the output of &lt;code&gt;traceback()&lt;/code&gt; for comparison:&lt;/p&gt;
&lt;pre class=&#34;output&#34;&gt;&lt;code&gt;#&amp;gt; 9: h()
#&amp;gt; 8: evalq(h())
#&amp;gt; 7: evalq(h()) at #1
#&amp;gt; 6: g()
#&amp;gt; 5: doTryCatch(return(expr), name, parentenv, handler)
#&amp;gt; 4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
#&amp;gt; 3: tryCatchList(expr, classes, parentenv, handlers)
#&amp;gt; 2: tryCatch(g(), warning = identity) at #1
#&amp;gt; 1: f()&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;backtraces-for-base-errors&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Backtraces for base errors!&lt;/h2&gt;
&lt;p&gt;These backtraces are normally only recorded for errors thrown with &lt;code&gt;abort()&lt;/code&gt;. This leaves out errors thrown with &lt;code&gt;stop()&lt;/code&gt;, errors thrown from native C code, and warnings converted to errors. Starting from this release, insert this snippet in your RProfile to enable backtraces for all errors:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;if (requireNamespace(&amp;quot;rlang&amp;quot;, quietly = TRUE)) {
  options(error = rlang::entrace)
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this in place, any unhandled error will record an rlang backtrace automatically:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;h &amp;lt;- function() stop(&amp;quot;stop!&amp;quot;)
f()&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;output&#34;&gt;
&lt;pre class=&#34;knitr r&#34;&gt;#&amp;gt; Error: stop!
#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;Call `rlang::last_error()` to see a backtrace&lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The backtrace can be consulted in the ordinary way:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;last_error()&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;output&#34;&gt;
&lt;pre class=&#34;knitr r&#34;&gt;#&amp;gt; &lt;span style=&#39;font-weight: bold;&#39;&gt;&amp;lt;error&amp;gt;&lt;/span&gt;&lt;span&gt;
#&amp;gt; message: &lt;/span&gt;&lt;span style=&#39;font-style: italic;&#39;&gt;stop!&lt;/span&gt;&lt;span&gt;
#&amp;gt; class:   `rlang_error`
#&amp;gt; backtrace:
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 1. &lt;/span&gt;&lt;span style=&#39;color: #BB0000;&#39;&gt;global::f()&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 6. &lt;/span&gt;&lt;span style=&#39;color: #BB0000;&#39;&gt;global::g()&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 9. &lt;/span&gt;&lt;span style=&#39;color: #BB0000;&#39;&gt;global::h()&lt;/span&gt;&lt;span&gt;
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt;Call `rlang::last_trace()` to see the full backtrace&lt;/span&gt;&lt;span&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;last_trace()&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;output&#34;&gt;
&lt;pre class=&#34;knitr r&#34;&gt;#&amp;gt; &lt;span style=&#39;color: #555555;&#39;&gt;    &lt;/span&gt;&lt;span&gt;█
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 1. &lt;/span&gt;&lt;span&gt;└─global::f()
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 2. &lt;/span&gt;&lt;span&gt;  ├─base::tryCatch(g(), warning = identity)
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 3. &lt;/span&gt;&lt;span&gt;  │ └─base:::tryCatchList(expr, classes, parentenv, handlers)
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 4. &lt;/span&gt;&lt;span&gt;  │   └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 5. &lt;/span&gt;&lt;span&gt;  │     └─base:::doTryCatch(return(expr), name, parentenv, handler)
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 6. &lt;/span&gt;&lt;span&gt;  └─global::g()
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 7. &lt;/span&gt;&lt;span&gt;    ├─base::evalq(h())
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 8. &lt;/span&gt;&lt;span&gt;    │ └─base::evalq(h())
#&amp;gt; &lt;/span&gt;&lt;span style=&#39;color: #555555;&#39;&gt; 9. &lt;/span&gt;&lt;span&gt;    └─global::h()
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Both the entracing of base errors and the simplification of backtraces are experimental, but they should already work well enough to be useful in your day-to-day work. We’d love to hear about your feedback!&lt;/p&gt;
&lt;/div&gt;
</content>
    </item>
    
    <item>
      <title>dbplyr 1.3.0</title>
      <link>https://www.tidyverse.org/blog/2019/01/dbplyr-1-3-0/</link>
      <pubDate>Wed, 09 Jan 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/01/dbplyr-1-3-0/</guid>
      <description>We&amp;rsquo;re stoked to announce that dbplyr 1.3.0 is now available on CRAN. dbplyr is the database backend for dplyr, translating dplyr syntax into SQL. This is a minor release primarily for compatibility with dplyr 0.8.0. However, there have been some changes to the API, and minor improvements (the full details of which can be found in the changelog). A more substantive update can be expected after rstudio::conf.
API changes       Calls of the form dplyr::foo() are now evaluated in the database, rather than locally.</description>
      <content>&lt;p&gt;We&amp;rsquo;re stoked to announce that &lt;a href=&#34;https://dbplyr.tidyverse.org&#34;&gt;dbplyr&lt;/a&gt; 1.3.0 is now available on CRAN. dbplyr is the database backend for dplyr, translating dplyr syntax into SQL. This is a minor release primarily for compatibility with dplyr 0.8.0. However, there have been some changes to the API, and minor improvements (the full details of which can be found in the &lt;a href=&#34;https://dbplyr.tidyverse.org/news/index.html&#34;&gt;changelog&lt;/a&gt;). A more substantive update can be expected after rstudio::conf.&lt;/p&gt;




&lt;h2 id=&#34;api-changes&#34;&gt;API changes
  &lt;a href=&#34;#api-changes&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Calls of the form &lt;code&gt;dplyr::foo()&lt;/code&gt; are now evaluated in the database, rather than locally.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;vars&lt;/code&gt; argument to &lt;a href=&#34;https://dbplyr.tidyverse.org/reference/tbl_sql.html&#34;&gt;&lt;code&gt;tbl_sql()&lt;/code&gt;&lt;/a&gt; has been formally deprecated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;src&lt;/code&gt; and &lt;code&gt;tbl&lt;/code&gt; objects now include a class generated from the class of the underlying connection object. This makes it possible for dplyr backends to implement different behaviour at the dplyr level, when needed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;sql-translation&#34;&gt;SQL translation
  &lt;a href=&#34;#sql-translation&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The new &lt;code&gt;as.integer64(x)&lt;/code&gt; is translated to &lt;code&gt;CAST(x AS BIGINT)&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://dplyr.tidyverse.org/reference/cumall.html&#34;&gt;&lt;code&gt;cummean()&lt;/code&gt;&lt;/a&gt; now translates to SQL &lt;code&gt;AVG()&lt;/code&gt; as opposed to &lt;code&gt;MEAN()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;x %in% y&lt;/code&gt; is now translated to &lt;code&gt;FALSE&lt;/code&gt; if &lt;code&gt;y&lt;/code&gt; is empty.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2 id=&#34;acknowledgements&#34;&gt;Acknowledgements
  &lt;a href=&#34;#acknowledgements&#34;&gt;
    &lt;svg class=&#34;anchor-symbol&#34; height=&#34;26&#34; width=&#34;26&#34; viewBox=&#34;0 0 22 22&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
      &lt;path d=&#34;M0 0h24v24H0z&#34; fill=&#34;currentColor&#34;&gt;&lt;/path&gt;
      &lt;path d=&#34;M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76.0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71.0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71.0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76.0 5-2.24 5-5s-2.24-5-5-5z&#34;&gt;&lt;/path&gt;
    &lt;/svg&gt;
  &lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;Thank you to the 49 people who contributed to this release: &lt;a href=&#34;https://github.com/AkhilGNair&#34;&gt;@AkhilGNair&lt;/a&gt;, &lt;a href=&#34;https://github.com/andypohl&#34;&gt;@andypohl&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/bogdanrau&#34;&gt;@bogdanrau&lt;/a&gt;, &lt;a href=&#34;https://github.com/cboettig&#34;&gt;@cboettig&lt;/a&gt;, &lt;a href=&#34;https://github.com/cderv&#34;&gt;@cderv&lt;/a&gt;, &lt;a href=&#34;https://github.com/chris-park&#34;&gt;@chris-park&lt;/a&gt;, &lt;a href=&#34;https://github.com/colearendt&#34;&gt;@colearendt&lt;/a&gt;, &lt;a href=&#34;https://github.com/copernican&#34;&gt;@copernican&lt;/a&gt;, &lt;a href=&#34;https://github.com/cseidman&#34;&gt;@cseidman&lt;/a&gt;, &lt;a href=&#34;https://github.com/DavisVaughan&#34;&gt;@DavisVaughan&lt;/a&gt;, &lt;a href=&#34;https://github.com/dgrtwo&#34;&gt;@dgrtwo&lt;/a&gt;, &lt;a href=&#34;https://github.com/dlindelof&#34;&gt;@dlindelof&lt;/a&gt;, &lt;a href=&#34;https://github.com/dpprdan&#34;&gt;@dpprdan&lt;/a&gt;, &lt;a href=&#34;https://github.com/edgararuiz&#34;&gt;@edgararuiz&lt;/a&gt;, &lt;a href=&#34;https://github.com/foonwong&#34;&gt;@foonwong&lt;/a&gt;, &lt;a href=&#34;https://github.com/gbisschoff&#34;&gt;@gbisschoff&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/halldc&#34;&gt;@halldc&lt;/a&gt;, &lt;a href=&#34;https://github.com/happyshows&#34;&gt;@happyshows&lt;/a&gt;, &lt;a href=&#34;https://github.com/iangow&#34;&gt;@iangow&lt;/a&gt;, &lt;a href=&#34;https://github.com/javierluraschi&#34;&gt;@javierluraschi&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jinaliu&#34;&gt;@jinaliu&lt;/a&gt;, &lt;a href=&#34;https://github.com/JohnMount&#34;&gt;@JohnMount&lt;/a&gt;, &lt;a href=&#34;https://github.com/jonthegeek&#34;&gt;@jonthegeek&lt;/a&gt;, &lt;a href=&#34;https://github.com/jrjohnson0821&#34;&gt;@jrjohnson0821&lt;/a&gt;, &lt;a href=&#34;https://github.com/karldw&#34;&gt;@karldw&lt;/a&gt;, &lt;a href=&#34;https://github.com/kevinykuo&#34;&gt;@kevinykuo&lt;/a&gt;, &lt;a href=&#34;https://github.com/kmace&#34;&gt;@kmace&lt;/a&gt;, &lt;a href=&#34;https://github.com/krlmlr&#34;&gt;@krlmlr&lt;/a&gt;, &lt;a href=&#34;https://github.com/lincis&#34;&gt;@lincis&lt;/a&gt;, &lt;a href=&#34;https://github.com/lionel-&#34;&gt;@lionel-&lt;/a&gt;, &lt;a href=&#34;https://github.com/mfalcioni1&#34;&gt;@mfalcioni1&lt;/a&gt;, &lt;a href=&#34;https://github.com/mgirlich&#34;&gt;@mgirlich&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkirzon&#34;&gt;@mkirzon&lt;/a&gt;, &lt;a href=&#34;https://github.com/mkuehn10&#34;&gt;@mkuehn10&lt;/a&gt;, &lt;a href=&#34;https://github.com/mtmorgan&#34;&gt;@mtmorgan&lt;/a&gt;, &lt;a href=&#34;https://github.com/N1h1l1sT&#34;&gt;@N1h1l1sT&lt;/a&gt;, &lt;a href=&#34;https://github.com/Prometheus77&#34;&gt;@Prometheus77&lt;/a&gt;, &lt;a href=&#34;https://github.com/ramnathv&#34;&gt;@ramnathv&lt;/a&gt;, &lt;a href=&#34;https://github.com/romainfrancois&#34;&gt;@romainfrancois&lt;/a&gt;, &lt;a href=&#34;https://github.com/sandan&#34;&gt;@sandan&lt;/a&gt;, &lt;a href=&#34;https://github.com/sverchkov&#34;&gt;@sverchkov&lt;/a&gt;, &lt;a href=&#34;https://github.com/tdsmith&#34;&gt;@tdsmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/tmastny&#34;&gt;@tmastny&lt;/a&gt;, &lt;a href=&#34;https://github.com/TomWeishaar&#34;&gt;@TomWeishaar&lt;/a&gt;, &lt;a href=&#34;https://github.com/vitallish&#34;&gt;@vitallish&lt;/a&gt;, and &lt;a href=&#34;https://github.com/yutannihilation&#34;&gt;@yutannihilation&lt;/a&gt;.&lt;/p&gt;
</content>
    </item>
    
    <item>
      <title>vdiffr 0.3.0</title>
      <link>https://www.tidyverse.org/blog/2019/01/vdiffr-0-3-0/</link>
      <pubDate>Thu, 03 Jan 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/01/vdiffr-0-3-0/</guid>
      <description>We’re thrilled to announce that vdiffr 0.3.0 is now on CRAN! vdiffr is a testthat extension that makes it easy to add visual unit tests for R plots. Testing visualisations is hard because it is difficult to integrate in an automated workflow. vdiffr achieves this by generating SVG renditions of your plot, storing them in the tests/fig folder in your package, and comparing the SVGs when running the tests. If you’re developing a package for statistical graphics, you might be interested in adding vdiffr to your checking workflow.</description>
      <content>


&lt;p&gt;We’re thrilled to announce that &lt;a href=&#34;https://github.com/lionel-/vdiffr&#34;&gt;vdiffr 0.3.0&lt;/a&gt; is now on CRAN! vdiffr is a testthat extension that makes it easy to add visual unit tests for R plots. Testing visualisations is hard because it is difficult to integrate in an automated workflow. vdiffr achieves this by generating SVG renditions of your plot, storing them in the &lt;code&gt;tests/fig&lt;/code&gt; folder in your package, and comparing the SVGs when running the tests. If you’re developing a package for statistical graphics, you might be interested in adding vdiffr to your checking workflow.&lt;/p&gt;
&lt;p&gt;This is the first publicly announced version of vdiffr because previous versions had issues with the comparison of SVGs across platforms, such as Travis or the CRAN machines. These problems should now be fixed. If you’re already a vdiffr user, please note that you will need to regenerate all your figures with the new SVG generation engine.&lt;/p&gt;
&lt;div id=&#34;create-visual-unit-tests&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Create visual unit tests&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;expect_doppelganger()&lt;/code&gt; is the main function you’ll be using to create visual unit tests. It accepts three types of input:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;ggplot2 objects, which are specially integrated in vdiffr (see
below).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;More generally, any object whose &lt;code&gt;print()&lt;/code&gt; method draws the object on the graphics device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Functions. Those will be called by vdiffr and should print the plot as side effect.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is an example of how to use it:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;context(&amp;quot;Distributions&amp;quot;)

test_that(&amp;quot;histograms draw correctly&amp;quot;, {
  hist_ggplot &amp;lt;- ggplot(mtcars, aes(disp)) + geom_histogram()
  vdiffr::expect_doppelganger(&amp;quot;ggplot2 histogram&amp;quot;, hist_ggplot)

  hist_base &amp;lt;- function() hist(mtcars$disp)
  vdiffr::expect_doppelganger(&amp;quot;Base graphics histogram&amp;quot;, hist_base)
})&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The first argument of &lt;code&gt;expect_doppelganger()&lt;/code&gt; is the plot title. It should be a description of what is being tested exactly by the plot. The title is also standardised (all special characters are converted to &lt;code&gt;-&lt;/code&gt;) and used as a filename to store the visual case. In addition, the current testthat context (here, “Distributions”) is used as directory for all figures generated in that context. The example above creates two visual tests whose whose saved SVG files live (once validated) in &lt;code&gt;tests/figs/distributions/ggplot2-histogram.svg&lt;/code&gt; and &lt;code&gt;tests/figs/distributions/base-graphics-histogram.svg&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;vdiffr treats ggplot2 figures specially. First, it adds the figure title as &lt;code&gt;ggtitle()&lt;/code&gt; (if the plot does not already have one). This makes the test figure self-explanatory when you open the SVG file. Secondly, if the plot does not have a ggplot2 theme, a minimalistic testing theme is automatically applied to it. This theme will not be tweaked in future ggplot2 versions to ensure some stability to the visual unit tests.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;manage-visual-tests-with-a-shiny-app&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Manage visual tests with a Shiny app&lt;/h2&gt;
&lt;p&gt;New visual expectations must be validated first. To validate new figures, call &lt;code&gt;vdiffr::manage_cases()&lt;/code&gt; or use the RStudio Addin installed by vdiffr. This opens a Shiny app that you will use to
validate the figures of new visual expectations.&lt;/p&gt;
&lt;p&gt;Once the figures are validated, run &lt;code&gt;devtools::test()&lt;/code&gt; in the usual way to run the visual tests. If the figure generated during the test doesn’t match its recorded version, testthat fails (but not on CRAN, see next section).&lt;/p&gt;
&lt;p&gt;When testthat reports that a visual comparison fails, open the Shiny app again. The app features several diffing widgets to help you compare the figures and detect why they don’t match. You can also revalidate the figure if the failure is the result of fixing a bug, adding a feature, or some other benign upstream change that caused a change in the appearance of your figure.&lt;/p&gt;
&lt;div class=&#34;figure&#34;&gt;
&lt;img src=&#34;https://raw.githubusercontent.com/lionel-/vdiffr/readme/rstudio-vdiffr.png&#34; alt=&#34;vdiffr in RStudio&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;vdiffr in RStudio&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;testing-versus-monitoring&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Testing versus Monitoring&lt;/h2&gt;
&lt;p&gt;When a figure doesn’t match its saved version, it is only reported as a failure under these circumstances:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When the &lt;code&gt;NOT_CRAN&lt;/code&gt; environment variable is set. Note that devtools sets this automatically when the tests are run interactively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On Travis, Appveyor, or any environment where the &lt;code&gt;Sys.getenv(&amp;quot;CI&amp;quot;)&lt;/code&gt; is set.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Otherwise, the failure is ignored. The motivation for this is that vdiffr is a monitoring tool and shouldn’t cause R CMD check failures on the CRAN machines.&lt;/p&gt;
&lt;p&gt;This behaviour is motivated by the inherent fragility of visual comparisons. The exact way plots are rendered depends on a lot of upstream logic, such as the way margins are computed. vdiffr uses a special ggplot2 theme that should change very rarely, but there are just too many upstream factors that could cause breakages. In the end, visual testing is not an alternative to writing unit tests for the internal data transformations performed during the creation of your figure. It is more of a monitoring tool that allows you to quickly check how the appearance of your figures changes over time, and to manually assess whether changes reflect actual problems in your packages.&lt;/p&gt;
&lt;p&gt;If you need to override the default vdiffr behaviour on CRAN (not recommended) or Travis (for example to run the tests in a particular builds but not others), set the &lt;code&gt;VDIFFR_RUN_TESTS&lt;/code&gt; environment variable to “true” or “false”.&lt;/p&gt;
&lt;/div&gt;
</content>
    </item>
    
    <item>
      <title>haven 2.0.0</title>
      <link>https://www.tidyverse.org/blog/2019/01/haven-2-0-0/</link>
      <pubDate>Wed, 02 Jan 2019 00:00:00 +0000</pubDate>
      
      <guid>https://www.tidyverse.org/blog/2019/01/haven-2-0-0/</guid>
      <description>We’re pleased to announce that haven 2.0.0 is now on CRAN. haven enables R to read and write various data formats used by other statistical packages by wrapping the ReadStat C library written by Evan Miller. As always, you can find a detailed account of all the changes in this release in the Changelog.
Breaking changes The biggest change is that labelled() and labelled_spss() now produce objects with class “haven_labelled” and “haven_labelled_spss”.</description>
      <content>


&lt;p&gt;We’re pleased to announce that &lt;a href=&#34;https://haven.tidyverse.org/&#34;&gt;haven 2.0.0&lt;/a&gt; is now on CRAN. haven enables R to read and write various data formats used by other statistical packages by wrapping the &lt;a href=&#34;https://github.com/WizardMac/ReadStat&#34;&gt;ReadStat&lt;/a&gt; C library written by &lt;a href=&#34;http://www.evanmiller.org/&#34;&gt;Evan Miller&lt;/a&gt;. As always, you can find a detailed account of all the changes in this release in the &lt;a href=&#34;https://haven.tidyverse.org/news/index.html#haven-2-0-0&#34;&gt;Changelog&lt;/a&gt;.&lt;/p&gt;
&lt;div id=&#34;breaking-changes&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Breaking changes&lt;/h2&gt;
&lt;p&gt;The biggest change is that &lt;a href=&#34;https://haven.tidyverse.org/reference/labelled.html&#34;&gt;&lt;code&gt;labelled()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://haven.tidyverse.org/reference/labelled_spss.html&#34;&gt;&lt;code&gt;labelled_spss()&lt;/code&gt;&lt;/a&gt; now produce objects with class “haven_labelled” and “haven_labelled_spss”. This resolves a &lt;a href=&#34;https://github.com/tidyverse/haven/issues/329&#34;&gt;problematic clash&lt;/a&gt; with the labelled class defined by &lt;a href=&#34;http://www.fharrell.com/&#34;&gt;Frank Harrell&lt;/a&gt;’s &lt;a href=&#34;https://cran.r-project.org/web/packages/Hmisc/index.html&#34;&gt;Hmisc&lt;/a&gt; package.&lt;/p&gt;
&lt;p&gt;Given Hmisc has been around much longer than haven (Hmisc’s oldest source &lt;a href=&#34;https://cran.r-project.org/src/contrib/Archive/Hmisc/&#34;&gt;archive on CRAN&lt;/a&gt; is from 2003), it makes sense that haven should be the one to make the change. This will require some changes to packages that use haven, but shouldn’t affect user code.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;x1 &amp;lt;- haven::labelled(c(1, 1, 2), c(Grunt = 1, Sgt = 2),
                      label = &amp;quot;Army status&amp;quot;)

class(x1)
#&amp;gt; [1] &amp;quot;haven_labelled&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;x2 &amp;lt;- haven::labelled_spss(1:10, c(Good = 1, Bad = 8), na_range = c(9, Inf),
                           label = &amp;quot;Quality rating&amp;quot;)

class(x2)
#&amp;gt; [1] &amp;quot;haven_labelled_spss&amp;quot; &amp;quot;haven_labelled&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;minor-improvements&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Minor improvements&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;labelled()&lt;/code&gt; and &lt;code&gt;labelled_spss()&lt;/code&gt; now support adding the label attribute to the resulting object (as seen in the code above). The label is a short, human-readable description of the object, and is now also used when printing, and can be easily removed using the new &lt;a href=&#34;https://haven.tidyverse.org/reference/zap_label.html&#34;&gt;&lt;code&gt;zap_label()&lt;/code&gt;&lt;/a&gt; function.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;x1
#&amp;gt; &amp;lt;Labelled double&amp;gt;: Army status
#&amp;gt; [1] 1 1 2
#&amp;gt; 
#&amp;gt; Labels:
#&amp;gt;  value label
#&amp;gt;      1 Grunt
#&amp;gt;      2   Sgt

zap_labels(x1)
#&amp;gt; [1] 1 1 2
#&amp;gt; attr(,&amp;quot;label&amp;quot;)
#&amp;gt; [1] &amp;quot;Army status&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;acknowledgements&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;A special thanks to &lt;a href=&#34;https://github.com/huftis&#34;&gt;Karl Ove Hufthammer&lt;/a&gt; for implementing &lt;code&gt;zap_label()&lt;/code&gt;, as well as to the 30 others who contributed to this release: &lt;a href=&#34;https://github.com/ajdamico&#34;&gt;@ajdamico&lt;/a&gt;, &lt;a href=&#34;https://github.com/alexeyknorre&#34;&gt;@alexeyknorre&lt;/a&gt;, &lt;a href=&#34;https://github.com/batpigandme&#34;&gt;@batpigandme&lt;/a&gt;, &lt;a href=&#34;https://github.com/beckerbenj&#34;&gt;@beckerbenj&lt;/a&gt;, &lt;a href=&#34;https://github.com/caayala&#34;&gt;@caayala&lt;/a&gt;, &lt;a href=&#34;https://github.com/Crismoc&#34;&gt;@Crismoc&lt;/a&gt;, &lt;a href=&#34;https://github.com/dar143&#34;&gt;@dar143&lt;/a&gt;, &lt;a href=&#34;https://github.com/davidc92&#34;&gt;@davidc92&lt;/a&gt;, &lt;a href=&#34;https://github.com/elbersb&#34;&gt;@elbersb&lt;/a&gt;, &lt;a href=&#34;https://github.com/gergness&#34;&gt;@gergness&lt;/a&gt;, &lt;a href=&#34;https://github.com/hadley&#34;&gt;@hadley&lt;/a&gt;, &lt;a href=&#34;https://github.com/helge-baumann&#34;&gt;@helge-baumann&lt;/a&gt;, &lt;a href=&#34;https://github.com/HughParsonage&#34;&gt;@HughParsonage&lt;/a&gt;, &lt;a href=&#34;https://github.com/iadli100&#34;&gt;@iadli100&lt;/a&gt;, &lt;a href=&#34;https://github.com/JanMarvin&#34;&gt;@JanMarvin&lt;/a&gt;, &lt;a href=&#34;https://github.com/jeffeaton&#34;&gt;@jeffeaton&lt;/a&gt;, &lt;a href=&#34;https://github.com/jimhester&#34;&gt;@jimhester&lt;/a&gt;, &lt;a href=&#34;https://github.com/jmetzel&#34;&gt;@jmetzel&lt;/a&gt;, &lt;a href=&#34;https://github.com/larmarange&#34;&gt;@larmarange&lt;/a&gt;, &lt;a href=&#34;https://github.com/lemzwerg&#34;&gt;@lemzwerg&lt;/a&gt;, &lt;a href=&#34;https://github.com/Majid-Eismann&#34;&gt;@Majid-Eismann&lt;/a&gt;, &lt;a href=&#34;https://github.com/nealrichardson&#34;&gt;@nealrichardson&lt;/a&gt;, &lt;a href=&#34;https://github.com/oscardssmith&#34;&gt;@oscardssmith&lt;/a&gt;, &lt;a href=&#34;https://github.com/philstraforelli&#34;&gt;@philstraforelli&lt;/a&gt;, &lt;a href=&#34;https://github.com/reyntjesr&#34;&gt;@reyntjesr&lt;/a&gt;, &lt;a href=&#34;https://github.com/rubenarslan&#34;&gt;@rubenarslan&lt;/a&gt;, &lt;a href=&#34;https://github.com/sjkiss&#34;&gt;@sjkiss&lt;/a&gt;, &lt;a href=&#34;https://github.com/visseho&#34;&gt;@visseho&lt;/a&gt;, &lt;a href=&#34;https://github.com/zkamvar&#34;&gt;@zkamvar&lt;/a&gt;, and &lt;a href=&#34;https://github.com/zross&#34;&gt;@zross&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
</content>
    </item>
    
  </channel>
</rss>
