title: Left joint dataset with partial string matching [R]
body: <p>I would like to ask how to perform left joint operation with 2 datasets when variable to joint by has different string.</p>
  
  <p>I know it can be done "by-hand" but I would prefer more efficient approach</p>
  
  <p>I provided 2 datasets in <a href="https://1drv.ms/u/s!Aha5nHo4JhEaq3ZtfoghLr7CsMbb?e=OBQhdf" rel="nofollow noreferrer">HERE</a>.</p>
  
  <p>Here are some rows from each data set.</p>
  
  <p><strong>all_data</strong></p>
  
  <pre><code>   GID_0 NAME_0   GID_1               NAME_1 NL_NAME_1      GID_2    provstate    VARNAME_2 NL_NAME_2      TYPE_2  ENGTYPE_2 CC_2
  1    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.1_1          Ain         &lt;NA&gt;      &lt;NA&gt; Département Department   01
  2    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.2_1       Allier Basses-Alpes      &lt;NA&gt; Département Department   03
  3    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.3_1      Ardèche         &lt;NA&gt;      &lt;NA&gt; Département Department   07
  4    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.4_1       Cantal         &lt;NA&gt;      &lt;NA&gt; Département Department   15
  5    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.5_1        Drôme         &lt;NA&gt;      &lt;NA&gt; Département Department   26
  6    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.6_1  Haute-Loire         &lt;NA&gt;      &lt;NA&gt; Département Department   43
  7    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.7_1 Haute-Savoie         &lt;NA&gt;      &lt;NA&gt; Département Department   74
  8    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.8_1        Isère         &lt;NA&gt;      &lt;NA&gt; Département Department   38
  9    FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt;  FRA.1.9_1        Loire         &lt;NA&gt;      &lt;NA&gt; Département Department   42
  10   FRA France FRA.1_1 Auvergne-Rhône-Alpes      &lt;NA&gt; FRA.1.10_1  Puy-de-Dôme         &lt;NA&gt;      &lt;NA&gt; Département Department   63
  </code></pre>
  
  <p><strong>data_to_insert</strong></p>
  
  <pre><code>   provstate               count
     &lt;chr&gt;                   &lt;int&gt;
   1 Alpes-Maritimes            13
   2 Alsace                     13
   3 Aquitaine                 119
   4 Aude                        1
   5 Auvergne                    1
   6 Auvergne-Rhone-Alpes       10
   7 Bas-Rhin                    5
   8 Bouches-du-Rhone            9
   9 Bourgogne-Franche-Comte     6
  10 Brittany                   23
  </code></pre>
  
  <p>I need to connect datasets that dataframe called <strong><em>all_data</em></strong> will contain new variable called <strong>count</strong> that is found in <strong><em>data_to_insert</em></strong> dataframe - joint should be based on <em>provstate</em> variable. (provstatet that do not have values in <strong><em>data_to_insert</em></strong> dataframe should have value 0 in new left joined dataframe)</p>
  
  <p>However names are slightly different in both dataset.</p>
  
  <p>I would like to ask for any advice</p>