Question 1

Which of the following items is required for an R package to pass R CMD check without any warnings or errors?

Answers

Question 2

Which of the following is a generic function in a fresh installation of R, with only the default packages loaded? (Select all that apply)

Answer:

Question 3

What function is used to obtain the function body for an S4 method function?

Answer:

Question 4

Please download the R package DDPQuiz3 from the course web site. Examine the πšŒπš›πšŽπšŠπšπšŽπš–πšŽπšŠπš— function implemented in the R/ sub-directory. What is the appropriate text to place above the πšŒπš›πšŽπšŠπšπšŽπš–πšŽπšŠπš— function for Roxygen2 to create a complete help file?

Answers:

#' This function calculates the mean
#' 
#' @param x is a numeric vector
#' @return the mean of x
#' @export
#' @examples 
#' x <- 1:10
#' createmean(x)