Developing Data Products Quiz 3 答案以及詳解:

這是Cousera Data science 的Developing Data Products  Quiz 3:

【具體課程網頁:Developing Data Products by Johns Hopkins University

 

這周主要學習R包,而考察的内容也是R包内的:

 

Q1:

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

可直接通過R 命令提示符的可以是:

  • vignette
  • example data sets
  • unit tests
  • An explicit software license  ✔(當然是R包外的文件許可證) 
  • a demo directory

 

除了R包外的文件許可證外,其他的都是R CMD 會運行的。



Q2:

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

具體參考與 R:可重用和面向对象编程

  • predict ✔
  • dgamma
  • mean ✔
  • lm
  • show✔
  • colSums

Q3

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

  • getS3method()
  • getClass()
  • getMethod() ✔
  • showMethods()

Q4

Please download the R package DDPQuiz3 from the course web site. Examine the \verb|createmean|createmean function implemented in the R/ sub-directory. What is the appropriate text to place above the \verb|createmean|createmean function for Roxygen2 to create a complete help file?

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值