diff --git a/DESCRIPTION b/DESCRIPTION index ee5157d..4a1bfdd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: spAbundance Type: Package Title: Univariate and Multivariate Spatial Modeling of Species Abundance -Version: 0.2.0 +Version: 0.2.1 Authors@R: c(person("Jeffrey", "Doser", role=c("aut", "cre"), email="jwdoser@ncsu.edu"), person("Andrew", "Finley", role = c("aut"))) Description: Fits single-species (univariate) and multi-species (multivariate) non-spatial and spatial abundance models in a Bayesian framework using Markov Chain Monte Carlo (MCMC). Spatial models are fit using Nearest Neighbor Gaussian Processes (NNGPs). Details on NNGP models are given in Datta, Banerjee, Finley, and Gelfand (2016) and Finley, Datta, and Banerjee (2022) . Fits single-species and multi-species spatial and non-spatial versions of generalized linear mixed models (Gaussian, Poisson, Negative Binomial), N-mixture models (Royle 2004 ) and hierarchical distance sampling models (Royle, Dawson, Bates (2004) ). Multi-species spatial models are fit using a spatial factor modeling approach with NNGPs for computational efficiency. License: GPL (>= 3) diff --git a/NEWS.md b/NEWS.md index 209df2e..938853b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# spAbundance 0.2.1 + ++ Fixed a `C++` memory issue in `predict.spAbund()` that could result in crashes under certain situations. + # spAbundance 0.2.0 + Updated `svcAbund()` to now work with Poisson and negative binomial families. Note that the function now defaults to use `family = 'Poisson'`, which differs from the previous implementation when only `family = 'Gaussian'` was supported. This switch was done to maintain consistency with other spAbundance model-fitting functions. diff --git a/R/generics.R b/R/generics.R index 44c0486..447d103 100644 --- a/R/generics.R +++ b/R/generics.R @@ -562,7 +562,7 @@ predict.spAbund <- function(object, X.0, coords.0, if (is(object, 'spAbund')) { svc.cols <- 1 p.svc <- 1 - X.w.0 <- matrix(1, nrow = X.0, ncol = 1) + X.w.0 <- matrix(1, nrow = nrow(X.0), ncol = 1) } else { svc.cols <- object$svc.cols p.svc <- length(svc.cols) diff --git a/spAbundance.Rproj b/spAbundance.Rproj index 5caa49b..398aa14 100644 --- a/spAbundance.Rproj +++ b/spAbundance.Rproj @@ -1,20 +1,20 @@ -Version: 1.0 - -RestoreWorkspace: Default -SaveWorkspace: Default -AlwaysSaveHistory: Default - -EnableCodeIndexing: Yes -UseSpacesForTab: Yes -NumSpacesForTab: 2 -Encoding: UTF-8 - -RnwWeave: knitr -LaTeX: pdfLaTeX - -AutoAppendNewline: Yes -StripTrailingWhitespace: Yes - -BuildType: Package -PackageUseDevtools: Yes -PackageInstallArgs: --no-multiarch --with-keep.source +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: knitr +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source