Skip to content

Commit

Permalink
Improve doc here and there + NEWS
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Génin committed Dec 14, 2023
1 parent cd75e50 commit 5aafaf4
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 114 deletions.
5 changes: 3 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ This release has received external contributions from K. Siteur
Improvements:

* The type of neighborhood can now be specified in all patch-related functions,
including high-level functions (e.g. patchdistr_sews)
including high-level functions (e.g. patchdistr_sews). Neighborhood can also be
specified using "von_neumann" or "moore", on top of a 3x3 matrix

New indicators:

* Clustering of pairs (e.g. Schneider et al. 2016)

* Indicators based on the LSW distribution (Siteur et al. 2023)
* Indicators related to the LSW distribution (Siteur et al. 2023)

Bug fixes:

Expand Down
56 changes: 28 additions & 28 deletions R/extra_doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,46 +39,46 @@
#'
#' A \code{simple_sews_single} object is a list with the following components
#' \itemize{
#' \item{value: }{the indicator values. A vector of length one if there is
#' \code{itemvalue}: the indicator values. A vector of length one if there is
#' only one numeric value returned by the indicator function (e.g.
#' \code{\link{flowlength_sews}}, or with a length above one otherwise}
#' \item{orig_data: }{the original matrix on which the indicator was computed}
#' \item{fun.args: }{the argument used in the call to the indicator function
#' \code{\link{flowlength_sews}}, or with a length above one otherwise
#' \item \code{orig_data}: the original matrix on which the indicator was computed
#' \item \code{fun.args}: the argument used in the call to the indicator function
#' (the function that given a matrix, returns the spatial metrics of
#' interest)}
#' \item{taskname: }{a character string describing the current indicator(s)
#' being computed}
#' \item{indicf: }{the indicator function, which given the matrix, returns the
#' spatial metric(s) of interest}
#' interest)
#' \item \code{taskname}: a character string describing the current indicator(s)
#' being computed
#' \item \©ode{indicf}: the indicator function, which given the matrix, returns the
#' spatial metric(s) of interest
#' }
#'
#' \code{simple_sews_test_single} have all of the above components, plus
#' the following:
#'
#' \itemize{
#' \item{nulldistr: }{the null distribution of values, with nulln rows and
#' \item \code{nulldistr}: the null distribution of values, with nulln rows and
#' as many columns as the number of values returned by the indicator
#' function}
#' \item{null_mean: }{the mean indicator values in the null distribution}
#' \item{null_sd: }{the standard deviation of the null distribution}
#' \item{null_qsup: }{the upper quantile of the null distribution, by default
#' function
#' \item \code{null_mean}: the mean indicator values in the null distribution
#' \item \code{null_sd}: the standard deviation of the null distribution
#' \item \code{null_qsup}: the upper quantile of the null distribution, by default
#' the 95% upper quantile, but see \code{\link{indictest}} for a way to
#' adjust this}
#' \item{null_qinf: }{the upper quantile of the null distribution, by default
#' adjust this
#' \item \code{null_qinf}: the upper quantile of the null distribution, by default
#' the 05% upper quantile, but see \code{\link{indictest}} for a way to
#' adjust this}
#' \item{z_score: }{the z_score of the observed value relative to the null
#' distribution, i.e. (value - null_mean) / null_sd}
#' \item{pval: }{the p-value of the indicator, i.e. the proporation of values
#' of the null distribution that fall below the observed indicator value}
#' \item{null_method: }{the method used to produce the null matrices. See
#' \code{\link{indictest}} for details}
#' \item{nulln: }{the number of null matrices used}
#' \item{get_nullmat: }{a function that can be called to obtain a randomized
#' matrix}
#' \item{matrixn: }{the number of the matrix, can be above one if the
#' adjust this
#' \item \code{z_score}: the z_score of the observed value relative to the null
#' distribution, i.e. (value - null_mean) / null_sd
#' \item \code{pval}: the p-value of the indicator, i.e. the proporation of values
#' of the null distribution that fall below the observed indicator value
#' \item \code{null_method}: the method used to produce the null matrices. See
#' \code{\link{indictest}} for details
#' \item \code{nulln}: the number of null matrices used
#' \item \code{get_nullmat}: a function that can be called to obtain a randomized
#' matrix
#' \item \code{matrixn}: the number of the matrix, can be above one if the
#' computations have been run on a list of matrices, or non-existent if
#' only one matrix was used}
#' only one matrix was used
#' }
#'
#' @seealso \code{\link{custom_indicator}}
Expand Down
25 changes: 12 additions & 13 deletions R/fitpsd.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,22 +213,21 @@ pl_ll <- function(dat, expo, xmin) {
#' @return A list containing at list the following components:
#'
#' \itemize{
#' \item{type: }{The type of distribution fitted (as a character string)}
#' \item{method: }{The method used for the fit - here, maximum likelihood,
#' 'll'}
#' \item{ll: }{The log likelihood at the estimated parameter values}
#' \item{xmin: }{The value of xmin used for the fit}
#' \item{npars: }{The number of parameters of the distribution}
#' \item \code{type}: The type of distribution fitted (as a character string)
#' \item \code{method}: The method used for the fit - here, maximum likelihood, 'll'
#' \item \code{ll}: The log likelihood at the estimated parameter values
#' \item \code{xmin}: The value of xmin used for the fit
#' \item \code{npars}: The number of parameters of the distribution
#' }
#'
#' Additionnaly, this list may have one or more of the following parameters
#' depending on the type of distribution that has been fitted:
#' Additionally, this list may have one or more of the following elements depending on
#' the type of distribution that has been fitted:
#' \itemize{
#' \item{plexpo: }{The exponent of the power-law}
#' \item{cutoff: }{The rate of truncation, for truncated power law and
#' exponential fits}
#' \item{meanlog: }{The mean of the lognormal distribution}
#' \item{sdlog: }{The s.d. of the lognormal distribution}
#' \item \code{plexpo}: The exponent of the power-law
#' \item \code{cutoff}: The rate of truncation, for truncated power law and
#' exponential fits
#' \item \code{meanlog}: The mean of the lognormal distribution
#' \item \code{sdlog}: The s.d. of the lognormal distribution
#' }
#'
#' @details These functions will fit distributions to a set of values using
Expand Down
7 changes: 3 additions & 4 deletions R/indicator_psdtype.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
#' matrix when reaching the side
#'
#' @param nbmask Either "moore" for 8-way neighborhood, "von_neumann" for four-way
#' neighborhood (default), or a square matrix with an odd number of lines and columns
#' that describes which neighbors are to be considered around a cell. Default
#' is 4-way or Von Neumann neighborhood (the neighborhood of a cell comprises the cell
#' above, below, on the right and on the left of the target cell).
#' neighborhood (default), or a 3x3 matrix describing which neighbors to
#' consider around a cell. See \code{\link{patchsizes}} for details on how to specify
#' such neighborhoods.
#'
#' @return A data.frame (or a list of these if x is a list) with the
#' following columns:
Expand Down
14 changes: 6 additions & 8 deletions R/label.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#' @param mat A binary matrix
#'
#' @param nbmask Either "moore" for 8-way neighborhood, "von_neumann" for four-way
#' neighborhood, or a square matrix with an odd number of lines and columns that
#' describes which neighbors are to be considered around a cell. Default
#' is 4-way or Von Neumann neighborhood (the neighborhood of a cell comprises the cell
#' above, below, on the right and on the left of the target cell).
#' neighborhood (default), or a 3x3 matrix describing which neighbors to
#' consider around a cell. See \code{\link{patchsizes}} for details on how to specify
#' such neighborhoods.
#'
#' @param wrap Whether to wrap around lattice boundaries (`TRUE`/`FALSE`),
#' effectively using periodic boundaries.
Expand Down Expand Up @@ -122,10 +121,9 @@ percolation <- function(mat, nbmask = "von_neumann") {
#' be pooled together if \code{mat} is a list of matrices.
#'
#' @param nbmask Either "moore" for 8-way neighborhood, "von_neumann" for four-way
#' neighborhood, or a square matrix with an odd number of lines and columns that
#' describes which neighbors are to be considered around a cell. Default
#' is 4-way or Von Neumann neighborhood (the neighborhood of a cell comprises the cell
#' above, below, on the right and on the left of the target cell).
#' neighborhood (default), or a 3x3 matrix describing which neighbors to
#' consider around a cell. See \code{\link{patchsizes}} for details on how to specify
#' such neighborhoods.
#'
#' @param wrap Whether to wrap around lattice boundaries (`TRUE`/`FALSE`),
#' effectively using periodic boundaries.
Expand Down
6 changes: 3 additions & 3 deletions R/task_patch_indic.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#' matrix when reaching the side
#'
#' @param nbmask Either "moore" for 8-way neighborhood, "von_neumann" for four-way
#' neighborhood (default), or a square matrix with an odd number of lines and columns
#' that describes which neighbors are to be considered around a cell. See
#' \code{\link{patchsizes}} for details on how to specify more advanced neighborhoods.
#' neighborhood (default), or a 3x3 matrix describing which neighbors to
#' consider around a cell. See \code{\link{patchsizes}} for details on how to specify
#' such neighborhoods.
#'
#' @return A list object of class 'psdfit' containing among other things
#' - the observed patch size distribution data
Expand Down
7 changes: 3 additions & 4 deletions man/indicator_psdtype.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/label.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/patchdistr_sews.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/patchsizes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions man/pl_fit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions man/simple_sews.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5aafaf4

Please sign in to comment.