diff --git a/DESCRIPTION b/DESCRIPTION index a65c18b..cae86b8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Hmsc Title: Hierarchical Model of Species Communities Type: Package -Version: 3.0-8 +Version: 3.0-9 Authors@R: c(person(given = "Gleb", family="Tikhonov", role="aut"), person(given="Otso", family="Ovaskainen", email="otso.ovaskainen@helsinki.fi", @@ -13,9 +13,10 @@ Authors@R: c(person(given = "Gleb", family="Tikhonov", role="aut"), Description: Hierarchical Modelling of Species Communities (HMSC) is a model-based approach for analyzing community ecological data. This package implements it in the Bayesian framework with Gibbs - Markov chain Monte Carlo (MCMC) sampling. + Markov chain Monte Carlo (MCMC) sampling (Tikhonov et al. (2020) + ). License: GPL-3 | file LICENSE -URL: https://www.helsinki.fi/en/researchgroups/statistical-ecology/hmsc/ +URL: https://www.helsinki.fi/en/researchgroups/statistical-ecology/hmsc BugReports: https://github.com/hmsc-r/HMSC/issues/ Encoding: UTF-8 LazyData: true diff --git a/R/constructGradient.R b/R/constructGradient.R index d78287a..e4bf7a4 100644 --- a/R/constructGradient.R +++ b/R/constructGradient.R @@ -17,14 +17,13 @@ #' \code{type = 2} sets the values of the non-focal variable to most likely value, given the value of focal variable, #' based on a linear relationship, and #' \code{type = 3} fixes to the value given. -#' If all non-focal variables are of the identical \code{type} \code{1} or \code{2}, -#' a single number (\code{1} or \code{2}) can be given as an argument to -#' \code{non.focalVariables}. +#' As a shortcut, a single number \code{1} or \code{2} can be given as a type +#' used for all non-focal variables. #' If a \code{non.focalVariable} is not listed, \code{type=2} is used as default. #' Note that if the focal variable is continuous, selecting type 2 for a non-focal categorical variable can cause abrupt changes in response. #' #' @seealso -#' \code{\link{plotGradient}}, \code{\link{predict}} +#' \code{\link{plotGradient}}, \code{\link{predict}}. #' #' @examples #' # Construct gradient for environmental covariate called 'x1'. diff --git a/inst/NEWS.md b/inst/NEWS.md index 9d74d38..bdfe1c4 100644 --- a/inst/NEWS.md +++ b/inst/NEWS.md @@ -1,4 +1,4 @@ -Version 3.0-8 +Version 3.0-9 ============= ### Installation @@ -43,6 +43,18 @@ Version 3.0-8 species. See GitHub [issue #44](https://github.com/hmsc-r/HMSC/issues/44). +* `constructGradient` argument `nonFocalVariables` accepts now a + single number `1` or `2` as a shortcut of default type for all + non-focal variables instead of requesting a list of types of all + variables. + +* `plotGradient` gained new argument `yshow` which is a single number + or vector of numeric values that must be included on the + *y*-axis. In general, the *y*-axis is scaled to show the plotted + values, but `yshow = 0` will always show zero, even when this is not + among plotted values, and `yshow = c(0,1)` will show both zero and + one. + * `plotVariancePartition` defaults to plot the original terms instead of single contrast. For instance, only one component is shown for multilevel factors instead of showing each level separately. User @@ -68,7 +80,9 @@ Version 3.0-8 * `plotGradient(..., showData = TRUE)` ignored data values in setting plot minimum. See GitHub - [issue #48](https://github.com/hmsc-r/HMSC/issues/48). + [issue #48](https://github.com/hmsc-r/HMSC/issues/48). The data + values were not always shown with `measure = "S"` in quantitative + linear models. Version 3.0-6 ============= diff --git a/man/Hmsc-package.Rd b/man/Hmsc-package.Rd index 1316b30..bb58c7a 100644 --- a/man/Hmsc-package.Rd +++ b/man/Hmsc-package.Rd @@ -85,13 +85,16 @@ Hierarchical Modelling of Species Communities (Hmsc) is a } \section{Citing the Package}{ - Tikhonov, G., Opedal, O., Abrego, N., Lehikoinen, A., Ovaskainen, O., 2019. Joint species distribution modelling with HMSC-R. \emph{bioRxiv} + Tikhonov, G., Opedal, O.H., Abrego, N., Lehikoinen, A., de Jonge, + M.M.J, Oksanen, J. and Ovaskainen, O. (2020) Joint species + distribution modelling with the R-package Hmsc. \emph{Methods in + Ecology and Evolution} \bold{11,} 442--447. \doi{10.1111/2041-210X.13345} } \seealso{ Useful links: \itemize{ - \item \url{https://www.helsinki.fi/en/researchgroups/statistical-ecology/hmsc/} + \item \url{https://www.helsinki.fi/en/researchgroups/statistical-ecology/hmsc} \item Report bugs at \url{https://github.com/hmsc-r/HMSC/issues/} } diff --git a/man/constructGradient.Rd b/man/constructGradient.Rd index 7027778..0a35ea6 100644 --- a/man/constructGradient.Rd +++ b/man/constructGradient.Rd @@ -29,9 +29,8 @@ to the most likely value (defined as expected value for covariates, mode for fac \code{type = 2} sets the values of the non-focal variable to most likely value, given the value of focal variable, based on a linear relationship, and \code{type = 3} fixes to the value given. -If all non-focal variables are of the identical \code{type} \code{1} or \code{2}, -a single number (\code{1} or \code{2}) can be given as an argument to -\code{non.focalVariables}. +As a shortcut, a single number \code{1} or \code{2} can be given as a type +used for all non-focal variables. If a \code{non.focalVariable} is not listed, \code{type=2} is used as default. Note that if the focal variable is continuous, selecting type 2 for a non-focal categorical variable can cause abrupt changes in response. } @@ -45,5 +44,5 @@ Gradient = constructGradient(TD$m, focalVariable="x1",non.focalVariables=list(x2 } \seealso{ -\code{\link{plotGradient}}, \code{\link{predict}} +\code{\link{plotGradient}}, \code{\link{predict}}. }