Session Ready
Exercise

Tying it all together

Using everything that you learned in the chapter, let's make a simple replica of one of the 'pageviews' functions - building queries, sending GET requests (with an appropriate user agent) and handling the output in a fault-tolerant way. You'll build this function up piece by piece in this exercise.

To output an error, you will use the function stop(), which takes a string as an argument, stops the execution of the program, and outputs the string as an error. You can try it right now by running stop("This is an error").

Instructions 1/4
undefined XP
  • 1
  • 2
  • 3
  • 4

First, get the function to construct the url.

  • In the call to paste(), add article_title as the second argument to construct url.