title: how get country name from r geocode
body: <p>I use <code>ggmap</code> library for getting country name from the list of addresses.</p>
  <p>But it does not work as intended (at least <a href="https://bcb.dfci.harvard.edu/%7Eaedin/courses/R/CDC/maps.html" rel="nofollow noreferrer">as described here</a>)</p>
  <pre class="lang-r prettyprint-override"><code>r&lt;-ggmap::geocode(c('harvard university', 'the vatican'), output = 'more')
  glimpse(r)
  </code></pre>
  <p>result:</p>
  <pre class="lang-r prettyprint-override"><code>Rows: 2
  Columns: 9
  $ lon     &lt;dbl&gt; -71.117, 12.453
  $ lat     &lt;dbl&gt; 42.377, 41.903
  $ type    &lt;chr&gt; &quot;establishment&quot;, &quot;country&quot;
  $ loctype &lt;chr&gt; &quot;geometric_center&quot;, &quot;approximate&quot;
  $ address &lt;chr&gt; &quot;cambridge, ma, usa&quot;, &quot;00120, vatican city&quot;
  $ north   &lt;dbl&gt; 42.378, 41.907
  $ south   &lt;dbl&gt; 42.376, 41.900
  $ east    &lt;dbl&gt; -71.115, 12.458
  $ west    &lt;dbl&gt; -71.118, 12.446
  </code></pre>
  <p>How to get a country name in this case?</p>
  <p>UPDATE:</p>
  <p>If I provide an <code>output='all'</code> parameter, it returns a long nested list where in <code>address_components</code> there is a country name. What is the most efficient way to retrieve it?</p>
  <p>CODE:</p>
  <pre class="lang-r prettyprint-override"><code>r&lt;-ggmap::geocode(c('harvard university', 'the vatican'), output = 'all')
  glimpse(r)
  </code></pre>
  <p>RESULT:</p>
  <pre class="lang-r prettyprint-override"><code>&gt; str(r )
  tibble [1 × 2] (S3: tbl_df/tbl/data.frame)
   $ results:List of 1
    ..$ :List of 5
    .. ..$ address_components:List of 3
    .. .. ..$ :List of 3
    .. .. .. ..$ long_name : chr &quot;New York&quot;
    .. .. .. ..$ short_name: chr &quot;New York&quot;
    .. .. .. ..$ types     :List of 2
    .. .. .. .. ..$ : chr &quot;locality&quot;
    .. .. .. .. ..$ : chr &quot;political&quot;
    .. .. ..$ :List of 3
    .. .. .. ..$ long_name : chr &quot;New York&quot;
    .. .. .. ..$ short_name: chr &quot;NY&quot;
    .. .. .. ..$ types     :List of 2
    .. .. .. .. ..$ : chr &quot;administrative_area_level_1&quot;
    .. .. .. .. ..$ : chr &quot;political&quot;
    .. .. ..$ :List of 3
    .. .. .. ..$ long_name : chr &quot;United States&quot;
    .. .. .. ..$ short_name: chr &quot;US&quot;
    .. .. .. ..$ types     :List of 2
    .. .. .. .. ..$ : chr &quot;country&quot;
    .. .. .. .. ..$ : chr &quot;political&quot;
    .. ..$ formatted_address : chr &quot;New York, NY, USA&quot;
    .. ..$ geometry          :List of 4
    .. .. ..$ bounds       :List of 2
    .. .. .. ..$ northeast:List of 2
    .. .. .. .. ..$ lat: num 40.9
    .. .. .. .. ..$ lng: num -73.7
    .. .. .. ..$ southwest:List of 2
    .. .. .. .. ..$ lat: num 40.5
    .. .. .. .. ..$ lng: num -74.3
    .. .. ..$ location     :List of 2
    .. .. .. ..$ lat: num 40.7
    .. .. .. ..$ lng: num -74
    .. .. ..$ location_type: chr &quot;APPROXIMATE&quot;
    .. .. ..$ viewport     :List of 2
    .. .. .. ..$ northeast:List of 2
    .. .. .. .. ..$ lat: num 40.9
    .. .. .. .. ..$ lng: num -73.7
    .. .. .. ..$ southwest:List of 2
    .. .. .. .. ..$ lat: num 40.5
    .. .. .. .. ..$ lng: num -74.3
    .. ..$ place_id          : chr &quot;ChIJOwg_06VPwokRYv534QaPC8g&quot;
    .. ..$ types             :List of 2
    .. .. ..$ : chr &quot;locality&quot;
    .. .. ..$ : chr &quot;political&quot;
   $ status : chr &quot;OK&quot;
  
  </code></pre>