my_link <- 'https://www.gutenberg.org/ebooks/2264.txt.utf-8' my_book <- readr::read_lines(my_link) # solution full_text <- paste0(my_book, collapse = '\n') my_sol <- stringr::str_count(full_text, stringr::fixed('King'))
my_answers <- make_random_answers(my_sol) #check_answers(my_answers)
Bind the vector of characters in my_book
into a single object called full_text
using command paste0(my_book, collapse = '\n'
. Using the stringr
package, how many times is the word 'King'
repeated throughout the text?
exams::answerlist(my_answers, markup = "markdown")
extype: num
exsolution: r my_sol
exname: "pride and prejudice"
exshuffle: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.