check --as-cran a R package fails because of 'example' in .Rd documentation

2

I have a problem as I check my R source package. In my documentation file (*.Rd) there is a example section, as long as this section is blank my check passes, but when its not blank it fails no matter what I type in. Even a comment or the macro \dontrun{...} in this example results in fail. Does anyone know how to solve this problem?

Here a snapshot of the message:

* checking data for ASCII and uncompressed saves ... OK
* checking examples ... ERROR
Running examples in ‘rActus-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: riskfactors
> ### Title: Create a new riskfactor object
> ### Aliases: RiskFactors.rActus YieldCurve.rActus YieldCurve
> ###   StockIndex.rActus StockIndex
> ### Keywords: datasets
> 
> ### ** Examples
> 
> # test
> 
> 
> 
> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
Warning in getRiskFactor(code = code, envir = object) :
  risk factor not found, instead looking for default one
Error in proc.time() - get(".ptime", pos = "CheckExEnv") : 
  non-numeric argument to binary operator
Calls: <Anonymous>
Execution halted

Thanks in advance.

user3285235

Posted 2014-02-09T12:52:25.453

Reputation: 21

No answers