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)

Question

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")

Solution


Meta-information

extype: num exsolution: r my_sol exname: "dataframe basic" exshuffle: TRUE



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