Description Usage Arguments Details Value Examples
View source: R/fct_functions.R
make_frequency_count_table() takes a vector of species abundances and
returns a frequency count table.
1 | make_frequency_count_table(abundances, cautious = T)
|
abundances |
A numeric vector of absolute species abundances (counts of how many times the species was observed). |
cautious |
logical. If TRUE (default) then a vector of all zeroes will return a data frame with zero rows. If FALSE then an error will be thrown. |
A frequency count table is a data frame listing the frequencies ('freq') and the number of species observed that many times in the sample ('numTaxa').
If cautious = T, in the event that all of the species abundances
listed are zero, the function returns a data frame with the correct labels
for a frequency count table but zero rows. This is a precaution mostly
designed for small scale simulations where zero species may be observed - it
is unlikely to be relevant in real data.
returns a data.frame.
1 2 3 4 5 6 7 8 | taxa <- rnbinom(1000,0.1,0.1) # simulated abundances
make_frequency_count_table(taxa) # frequency count table
## Not run:
# The following will produce an error:
make_frequency_count_table(rep(0,100),cautious= F)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.