0% found this document useful (1 vote)
2K views3 pages

Quiz - Coursera

This document contains a quiz about R package development taken on Coursera. It has 5 multiple choice questions about the requirements for an R package to pass checks, generic functions in base R, identifying function types, required functions for deploying models on yhat, and appropriate Roxygen2 documentation for a function. The student certified that the answers were their own work in accordance with the Coursera Honor Code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
2K views3 pages

Quiz - Coursera

This document contains a quiz about R package development taken on Coursera. It has 5 multiple choice questions about the requirements for an R package to pass checks, generic functions in base R, identifying function types, required functions for deploying models on yhat, and appropriate Roxygen2 documentation for a function. The student certified that the answers were their own work in accordance with the Coursera Honor Code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

24/7/2014 Quiz | Coursera

https://class.coursera.org/devdataprod-003/quiz/attempt?quiz_id=27 1/3
Help
Quiz 3
The due date for this quiz is Sun 3 Aug 2014 8:30 PM BRT.
In accordance with the Coursera Honor Code, I (Caio Henrique Konyosi Miyashiro)
certify that the answers here are my own work.
Question 1
Which of the following items is required for an R package to pass R CMD check without any
warnings or errors?
a demo directory
DESCRIPTION file
example data sets
vignette
Question 2
Which of the following is a generic function in a fresh installation of R, with only the default
packages loaded?
show
dgamma
lm
colSums
Question 3
What function is used to obtain the function body for an S4 method function?
getMethod()
getClass()
showMethods()
24/7/2014 Quiz | Coursera
https://class.coursera.org/devdataprod-003/quiz/attempt?quiz_id=27 2/3
getS3method()
Question 4
Which one of the following functions must be defined in order to deploy an R function on yhat?
model.transform
model.predict
model.require
model.load
Question 5
Please download the R package DDPQuiz3 from the course web site. Examine the createmean
function implemented in the R/ sub-directory. What is the appropriate text to place above the
createmean function for Roxygen2 to create a complete help file?
#' This function calculates the mean
#'
#' @param x is a numeric vector
#' @export
#' @examples
#' x <- 1:10
#' createmean(x)
#' This function calculates the mean
#'
#' @param x is a numeric vector
#' @return the mean of x
#' @export
#' @examples
#' x <- 1:10
#' createmean(x)
24/7/2014 Quiz | Coursera
https://class.coursera.org/devdataprod-003/quiz/attempt?quiz_id=27 3/3
#' This function calculates the mean
#'
#' @param x is a numeric vector
#' @return the mean of x
#' @export
#' @examples
#' x <- 1:10
#' createmean(y)
#' This function calculates the mean
#'
#' @return the mean of x
#' @export
#' @examples
#' x <- 1:10
#' createmean(x)
In accordance with the Coursera Honor Code, I (Caio Henrique Konyosi Miyashiro)
certify that the answers here are my own work.
Save Answers
You cannot submit your work until you agree to the Honor Code. Thanks!
Submit Answers

You might also like