title: Loop through a list of URLs and retain only those that exist
body: <p>I am in a situation where I need to check 1000s of URLs to see if they exist, and retain the urls in an object if they exist (i am calling it &quot;exist&quot;) and store those that don't in another object (&quot;not exist&quot;).</p>
  <pre><code>urls &lt;- paste0(&quot;https://en.wikipedia.org/wiki/List_of_countries_by_population_in_&quot;,1990:2020)
  
  for(i in seq_along(urls)){
       exist &lt;- keep(urls[i], http_error(urls[i]))
       not_exist &lt;- discard(urls[i], httpe_error(url[i])
  }
  </code></pre>
  <p>I want to avoid using the loop and just stick to the purrr functions, I tried doing</p>
  <pre><code>exists &lt;- map(urls,http_error)
  </code></pre>
  <p>But this just returns true/False.</p>
  <p>My eventual goal is to create a table with two columns titled &quot;exists&quot; and &quot;not exists&quot; as follows:</p>
  <pre><code>\begin{table}[] \begin{tabular}{lll} Exists &amp; Not Exists &amp;  \\ 
  URL    &amp;  URL &amp;  \\ 
  URL    &amp; URL  &amp;  \\ 
  URL    &amp; URL  &amp;  \\ 
  URL    &amp;      &amp;  \\
  URL    &amp;      &amp;  \\ 
  URL    &amp;      &amp;  
  \end{tabular} \end{table} 
  
  </code></pre>