skiptoniam / bbgdm

bbgdm: Assess uncertainty in Generalised Dissimilarity Models via a Bayesian bootstrap
GNU General Public License v2.0
2 stars 2 forks source link

NAs in env.dat cause error #4

Open jivelasquezt opened 5 years ago

jivelasquezt commented 5 years ago

An error occurs whenever any cell in the env.dat object has a NA value (for example, missing environmental covariate x for site y). The error returned is:

Error in env.dat[j_site, var] : subscript out of bounds
traceback()
2: dissim_table(sp.dat, env.dat, dism_metric = dism_metric, spline_type = spline_type, 
       spline_df = spline_df, spline_knots = spline_knots, geo = geo, 
       geo.type = geo.type)
1: bbgdm(form, sp.matrix[, 2:ncol(sp.matrix)], sp.matrix.env, family = "binomial", 
       link = "logit", dism_metric = "number_non_shared", spline_type = "ispline", 
       nboot = 100, geo = T, geo.type = "greater_circle", coord.names = c("X", 
           "Y"), optim.meth = "nlmnib")