Question

Why check() is not able to find function in my package? I have a small package with function iv.num. My example in documentation is iv.num(german_data,"mob","gbbin"). If I run check(), I get error - could not find function. However, I am able to run the function without any problems as shown below. I'm using R 3.0.1. and devtools (using load_all() before check(). Unfortunately, I am not able to create reproducible example, the package is on github

* checking examples ... ERROR
Running examples in 'riv-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: iv.num
> ### Title: Calculate Information Value for numeric (double/integer) vectors
> ### Aliases: iv.num
> 
> ### ** Examples
> 
> iv.num(german_data,"mob","gbbin")
Error: could not find function "iv.num"
Execution halted
Error: Command failed (1)
> iv.num(german_data,"mob","gbbin")
  variable       class outcome_0 outcome_1     pct_1     pct_0      odds         woe          miv
1      mob     (;11.5)       153        27 0.0900000 0.2185714 0.4117647 -0.88730320 1.140818e-01
2      mob <11.5;15.5)       189        62 0.2066667 0.2700000 0.7654321 -0.26731477 1.692994e-02
3      mob   <15.5;19)        72        43 0.1433333 0.1028571 1.3935185  0.33183186 1.343129e-02
4      mob   <19;34.5)       198        86 0.2866667 0.2828571 1.0134680  0.01337813 5.096429e-05
5      mob     <34.5;)        88        82 0.2733333 0.1257143 2.1742424  0.77668029 1.146528e-01
Was it helpful?

Solution

You did not export iv.num. I saw that by looking at the NAMESPACE file.

Add #' @export to the roxygen comment block above iv.num like you did with your other functions that are being exported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top