R package build failed when checking examples

旧街凉风 提交于 2021-01-29 08:03:52

问题


I am building my R package. However, when compiling it using CMD, the build fails because of the examples. I show you my function header for clarity:

#' @param data a dataframe containing the data to be modelled  
#' @param string identifying the location  
#' @param parameters a dataframe where the parameters for all the functions   
needed are saved  
#' @param period string saying whether the horizon to model  
#'  
#' @import dplyr  
#'  
#' @return list  
#' @export  
#' @examples   
Runner(data=data,Site="ABC",parameters=parameter,period="6-month")

Runner <- function(data, 
Site="ABC",parameters=parameter,period="6-month"){

  if(!is.data.frame(data)){
    stop("data must be a data.frame")
  }

and so on. I have only included the first test because it seems to be the following error message seems to refer to it.

When compiling, I get the following error message:

Running examples in ‘SiteRunner.R’ failed The error most likely occurred in:

base::assign(".ptime", proc.time(), pos = "CheckExEnv")

Name: Runner

Title: Feature engineer and Model the chosen location

Aliases: Runner

** Examples

Runner(data=data,Site="ABC",parameters=parameter,period="6-month") Error in Runner(data = data, Site = "ABC", parameters = parameter, : data must be a data.frame Execution halted

Any help? I see it often is the case that @export is missing, but it is not my case. Thank you very much for your help

来源:https://stackoverflow.com/questions/55181847/r-package-build-failed-when-checking-examples

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!