my_df <- dplyr::tibble(x = -100:100, y = x + 5) # solution my_sol <- sum((my_df$x > 10)&(my_df$x < 25))
my_answers <- make_random_answers(my_sol) #check_answers(my_answers)
Using function dplyr::tibble
, create a dataframe
called my_df
with a column called x
containing a sequence from -100 to 100 and another column called y
with the value of column x added by 5. How many values in column x
are greater than 10 and lower than 25?
exams::answerlist(my_answers, markup = "markdown")
extype: num
exsolution: r my_sol
exname: "dataframe basic"
exshuffle: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.