View source: R/ecological_indices.R
diet_rel_abundance | R Documentation |
TThis function calculates the relative or absolute abundance of four feeding types of nematodes in each sample. The feeding types include bacterial feeders (Ba), fungus feeders (Fu), plant feeders (Pp), and omnivores/predators (Op).
diet_rel_abundance(data, total.abundance = NULL, relative = TRUE, ...)
## S3 method for class 'data.frame'
diet_rel_abundance(data, total.abundance = NULL, relative = TRUE, ...)
## S3 method for class 'matrix'
diet_rel_abundance(data, total.abundance = NULL, relative = TRUE, ...)
## Default S3 method:
diet_rel_abundance(data, total.abundance = NULL, relative = TRUE, ...)
data |
|
total.abundance |
|
relative |
|
... |
Additional arguments (currently unused). |
A data frame with five columns:
Sample.ID |
Character vector of sample identifiers (from row names of |
Ba |
Relative or absolute abundance of bacterial feeders |
Fu |
Relative or absolute abundance of fungus feeders |
Pp |
Relative or absolute abundance of plant feeders |
Op |
Relative or absolute abundance of omnivores/predators |
# Example with a data frame
df <- data.frame(
Cephalobus = c(10, NA, 15),
Caenorhabditis = c(5, 10, NA),
Pratylenchus = c(8, 12, 10),
row.names = c("A", "B", "C")
)
abundance <- data.frame(
abundance = c(100, 150, 120),
row.names = c("A", "B", "C")
)
diet_rel_abundance(df, abundance, relative = FALSE)
# Example with a matrix
mat <- matrix(c(10, NA, 15, 5, 10, NA, 8, 12, 10), nrow = 3, byrow = TRUE)
colnames(mat) <- c("Cephalobus", "Caenorhabditis", "Pratylenchus")
row.names(mat) <- c("A", "B", "C")
diet_rel_abundance(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.