Exercise

Count the NA

Now that you have a stricter version of the status code extractor, we'll try it on our list of URLs.

What we want to do here is to see which of the websites from our list return a status code which is not between 200 and 203. To achieve this task, we'll flip the is.na() function, that is to say that instead of returning TRUE if the value is missing, it will return FALSE.

The urls vector and the strict_code() function are available in your workspace. httr and purrr has been loaded for you.

Instructions

100 XP
  • Run the strict_code() against the vector of urls.

  • Set the names of the results with the set_names() function, using the urls vector.

  • "Flip" the is.na() function by negating its behavior.

  • Use the is_not_na() function on the vector of results.