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
datain the examples. - Rolanddatais an object exported in your package, then it will be interpreted as a function, which will cause your example to fail. You should define data in your example - Aaron Haymandataordfas data frame names created no complications. Variables need to be defined, whether or not the name is being re-used. - Gregor Thomas