my_link <- 'https://www.gutenberg.org/ebooks/2264.txt.utf-8'

my_book <- readr::read_lines(my_link)

# solution
my_sol <- length(my_book)
my_answers <- make_random_answers(my_sol)

#check_answers(my_answers)

Question

At the address https://www.gutenberg.org/files/1342/1342-0.txt it is possible to access a file containing the full text of the book Pride and Prejudice by Jane Austen. Use functions download.file and readr::read_lines to import the entire book as a vector of characters called my_book in R. How many lines does the resulting object have?

exams::answerlist(my_answers, markup = "markdown")

Solution


Meta-information

extype: num exsolution: r my_sol exname: "numeric " exshuffle: TRUE



msperlin/afedR documentation built on Sept. 11, 2022, 9:49 a.m.