piLaboratory / GillesCom

Gillespie Simulation of Ecological Communities Dynamics
2 stars 0 forks source link

Examples are failing on R CMD check #2

Closed andrechalom closed 9 years ago

andrechalom commented 9 years ago

The examples for Init_Community run fine when the package is installed:

> library(GillesCom)
> example(Init_Community)
Int_Cm> # Initializes the community (in a global object)
Int_Cm> Init_Community(100)
Int_Cm> # Runs 50000 iteractions of the birth-death-migration process
Int_Cm> for (i in 1:50000) bdm()
Int_Cm> # Gets and analyzes the abundance vector
Int_Cm> (ab <- as.numeric(abundance()))
  [1]  57 134 206  79 113 167  62 201  43  75  20 117 194 112 188 253 124  44 154 101  54 168 109   0  60 182 103
 [28]  22 142  81  96  36 109 134  34   1 122 196 119 150   7   0 132 120  15  21  70 166 137  62  74  49 152 126
 [55]  71  30   0  67 183 112  14  21  24 100  83 173   8  17 311 212 215  35 180 335 172  35   4  55  82   4 305
 [82]  47  72 282 130 200 193 128 138   8  14  55   0  55   1  78  36  20 149 143

However, R CMD check is exiting on this same example, with an error related to what appears to be an internal Rcpp function:

* checking examples ... ERROR
Running examples in ‘GillesCom-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: Init_Community
> ### Title: Community
> ### Aliases: Init_Community abundance bdm time
> 
> ### ** Examples
> 
> # Initializes the community (in a global object)
> Init_Community(100)
Error in create_community(abundance, interaction, K, d0, b, m) : 
  function 'enterRNGScope' not provided by package 'Rcpp'
Calls: Init_Community -> create_community -> .Call
Execution halted

Maybe that's related to https://github.com/RcppCore/Rcpp/issues/92?

andrechalom commented 9 years ago

Probably solved by fixing the package Imports as well (see #4)

andrechalom commented 9 years ago

See also: https://github.com/Lobz/facilitation/issues/1