Running examples in ‘virtualspecies-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: generateRandomSp
> ### Title: Generate a random virtual species distribution from
> ###   environmental variables
> ### Aliases: generateRandomSp
> 
> ### ** Examples
> 
> # Create an example stack with six environmental variables
> a <- matrix(rep(dnorm(1:100, 50, sd = 25)), 
+             nrow = 100, ncol = 100, byrow = TRUE)
> env <- stack(raster(a * dnorm(1:100, 50, sd = 25)),
+              raster(a * 1:100),
+              raster(a * logisticFun(1:100, alpha = 10, beta = 70)),
+              raster(t(a)),
+              raster(exp(a)),
+              raster(log(a)))
> names(env) <- paste("Var", 1:6, sep = "")   
> 
> # More than 6 variables: by default a PCA approach will be used
> generateRandomSp(env)
 - Perfoming the pca

 - Defining the response of the species along PCA axes

 - Calculating suitability values

 - Converting into Presence - Absence

   --- Determing species.prevalence automatically according to alpha and beta


Virtual species generated from 6 variables:
 Var1, Var2, Var3, Var4, Var5, Var6

- Approach used: Response to axes of a PCA
- Axes:  1, 2 ;  81.71 % explained by these axes
- Responses to axes:
   .Axis 1  [min=-3.52; max=3.55] : dnorm (mean=1.399218; sd=2.969177)
   .Axis 2  [min=-1.74; max=3.75] : dnorm (mean=0.2190712; sd=1.881691)
- Environmental suitability was rescaled between 0 and 1

- Converted into presence-absence:
   .Method = probability
   .alpha (slope)           = -0.1
   .beta  (inflexion point) = 0.128128128128128
   .species prevalence      = 0.914> 
> # Manually choosing a response approach
> generateRandomSp(env, approach = "response")
 - Determining species' response to predictor variables

Error in seq.default(cur.rast@data@min, cur.rast@data@max, length = 1000) : 
  'from' must be a finite number
Calls: generateRandomSp -> sample -> seq -> seq.default
Execution halted