Skip to content

Commit

Permalink
caught up master branch
Browse files Browse the repository at this point in the history
Merge branch 'master' into version_0.5

# Conflicts:
#	DESCRIPTION
#	NEWS.md
#	R/plot.phylo_divent.R
#	R/plot.species_distribution.R
  • Loading branch information
EricMarcon committed Nov 4, 2024
2 parents e33745d + 7d8713c commit a81b96d
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: divent
Type: Package
Title: Entropy Partitioning to Measure Diversity
Version: 0.4-99.9002
Version: 0.4-99.9003
Authors@R: c(
person("Eric", "Marcon", email="eric.marcon@agroparistech.fr", role=c("aut", "cre"), comment=c(ORCID="0000-0002-5249-321X"))
)
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# divent 0.4-99.9002
# divent 0.4-99.9003

## Features

- Hurlbert's diversity: `ent_hurlbert()` and `div_hurlbert()`.
- Methods for


# divent 0.3-16
Expand Down
6 changes: 3 additions & 3 deletions R/abd_species.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#'
#' Utilities for community abundances (objects of class "abundances").
#'
#' `abd_species()` returns a tibble containing the species abundance columns only,
#' @returns `abd_species()` returns a tibble containing the species abundance columns only,
#' to simplify numeric operations.
#'
#' `prob_species()` returns the same tibble but values are probabilities.
#'
#' `abd_sum()` returns the sample sizes of the communities.
#'
#' `abd_sum()` returns the sample sizes of the communities in a numeric vector.
#' @inheritParams check_divent_args
#'
#' @examples
Expand Down
6 changes: 3 additions & 3 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -1058,9 +1058,9 @@ ent_gamma_similarity <- function(
#' @noRd
#'
error_message <- function(message, argument, parent_function) {
cat(deparse(substitute(argument)), "cannot be:\n")
print(utils::head(argument))
cat(paste(paste("Error in ", parent_function, ":"), message, "\n"))
message(deparse(substitute(argument)), " cannot be:", appendLF = TRUE)
message(utils::head(argument))
message("In function ", parent_function, ": ", message)
stop("Check the function arguments.", call. = FALSE)
}

Expand Down
2 changes: 2 additions & 0 deletions R/plot.phylo_divent.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#' @param x An object of class "phylo_divent".
#' @param ... Arguments passed to [stats::plot.dendrogram].
#'
#' @returns `NULL`. Called for side effects.
#'
#' @export
#'
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/plot.species_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ NULL
#' @param palette The name of a color palette, recognized by [RColorBrewer::brewer.pal].
#' RAC plot only.
#'
#' @returns `NULL`. Called for side effects.
#'
#' @export
plot.species_distribution <- function(
x,
Expand Down
3 changes: 3 additions & 0 deletions R/probabilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#'
#' @param ... Unused.
#'
#' @returns An object of class "probabilities", which is a [species_distribution]
#' or a numeric vector with argument `as_numeric = TRUE`.
#'
#' @references
#' \insertAllCited{}
#'
Expand Down
17 changes: 13 additions & 4 deletions R/species_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
#'
#' A Species Distribution is a [tibble::tibble] containing species abundances
#' or probabilities.

#' Rows of the tibble are communities and column are species.
#' Values are either abundances or probabilities.
#' Special columns contain the site names, and their weights
#' (e.g. their area or number of individuals):
#' their names must be "site" and "weight".
#' All other column names are considered as species names.
#'
#' `species_distribution` objects include `abundances` and `probabilities`
#' objects.
Expand All @@ -22,17 +29,19 @@
#' the same output as `probabilities()` with `estimator = "naive"`.
#'
#' `species_distribution` objects objects can be plotted by [plot] and [autoplot].
#'
#' @inheritParams check_divent_args
#' @param x an object.
#' @param ... Unused.

#' @returns An object of classes "species_distribution" and "abundances" or "probabilities".
#'
#' `as.double()` and its synonymous `as.numeric()` return a numeric vector
#' that contains species abundances or probabilities of a single-row
#' `species_distribution`.
#' `as.matrix()` returns a numeric matrix if the `species_distribution` contains
#' several rows.
#' These are methods of the generic functions for class `species_distribution`.
#'
#' @inheritParams check_divent_args
#' @param x an object.
#' @param ... Unused.
#'
#' @references
#' \insertAllCited{}
Expand Down
11 changes: 6 additions & 5 deletions man/abd_species.Rd

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

3 changes: 3 additions & 0 deletions man/plot.phylo_divent.Rd

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

3 changes: 3 additions & 0 deletions man/plot.species_distribution.Rd

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

4 changes: 4 additions & 0 deletions man/probabilities.Rd

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

23 changes: 16 additions & 7 deletions man/species_distribution.Rd

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

0 comments on commit a81b96d

Please sign in to comment.