View source: R/as_biomonitor.R
as_biomonitor | R Documentation |
This function merge the user data.frame
with a reference dataset and suggest corrections for mispelled names.
as_biomonitor(
x,
group = "mi",
dfref = NULL,
to_change = "default",
FUN = sum,
correct_names = FALSE,
traceB = FALSE
)
x |
A |
group |
Biotic group of interest. Possible values are |
dfref |
A custom reference database that replaces the built-in reference databases. |
to_change |
A |
FUN |
The function to be applied for aggregating rows with duplicated taxa names.
It should be |
correct_names |
If |
traceB |
Track changes in taxa names. |
The function as_biomonitor()
checks the taxonomy of the data.frame
provided by the user and suggests correction for mispelled names.
If one or more taxa names of x
are not present in the reference dataset or the spell checker is not able to find any suggestion the user is asked to exit.
This behaviour is to assure consistency with other functions implemented in biomonitoR
.
Default references databases are provided for macroinvertebrates, macrophytes and fish.
Reference datasets heavily rely on the information provided by the freshwaterecology.info website.
If dfref
is not NULL
a custom dictionary will be saved in the working directory to let the as_biomonitor ()
function work correctly.
If you are unable to build a reference database by your own please check the function ref_from_tree
for a possible solution.
as_biomonitor()
returns an object of class asb
togheter with one of the classes abundance
or bin
.
The function quick_rename
works as the as_biomonitor()
but returns
a data.frame
without the biomonitoR
format.
as_biomonitor()
aggregates all the rows with the same taxa name with the option FUN
and converts all the NA
to 0.
When group = mi
Hydracarina, Hydracnidia or Acariformes are changed to Trombidiformes given the uncertain taxonomic status of this group.
Schmidt-Kloiber, A., & Hering, D. (2015). www.freshwaterecology.info - An online tool that unifies, standardises and codifies more than 20,000 European freshwater organisms and their ecological preferences. Ecological indicators, 53, 271-282.
quick_rename ref_from_tree
data(mi_prin)
data_bio <- as_biomonitor(mi_prin, group = "mi")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.