问题
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