Skip to content

Commit

Permalink
formatted the code
Browse files Browse the repository at this point in the history
  • Loading branch information
EricMarcon committed Nov 26, 2024
1 parent 8cd00d5 commit 0f593cb
Show file tree
Hide file tree
Showing 30 changed files with 1,138 additions and 1,139 deletions.
29 changes: 15 additions & 14 deletions R/abd_species.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#' Abundances of Communities
#'
#'
#' Utilities for community abundances (objects of class "abundances").
#'
#'
#' @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 in a numeric vector.
#' @inheritParams check_divent_args
#'
#' @examples
#' abd_species(paracou_6_abd)
#' prob_species(paracou_6_abd)
#' abd_sum(paracou_6_abd)
#'
#'
#' @name abd_species
NULL

Expand All @@ -22,11 +23,11 @@ NULL
#'
#' @export
abd_species <- function(
abundances,
abundances,
check_arguments = TRUE) {

if (any(check_arguments)) check_divent_args()

return(
abundances[, !colnames(abundances) %in% non_species_columns]
)
Expand All @@ -37,12 +38,12 @@ abd_species <- function(
#'
#' @export
abd_sum <- function(
abundances,
as_numeric = FALSE,
abundances,
as_numeric = FALSE,
check_arguments = TRUE) {

if (any(check_arguments)) check_divent_args()

the_abd_sum <- rowSums(
abundances[, !colnames(abundances) %in% non_species_columns]
)
Expand All @@ -65,13 +66,13 @@ abd_sum <- function(
#'
#' @export
prob_species <- function(
species_distribution,
species_distribution,
check_arguments = TRUE) {

if (any(check_arguments)) check_divent_args()

abundances <- species_distribution[
,
,
!colnames(species_distribution) %in% non_species_columns
]
sample_sizes <- rowSums(abundances)
Expand Down
Loading

0 comments on commit 0f593cb

Please sign in to comment.