-
Notifications
You must be signed in to change notification settings - Fork 3
Design principles
Hugo Gruson edited this page Oct 2, 2020
·
1 revision
We aim at having as few as dependencies as possible, unless they remain relatively lightweight and provide a large speed boost. Acceptable dependencies include:
- Rccp
- geometry
- provide one function per index
- do not perform transformation on input data without any explicit action from the user
Two inputs are acceptable in fundiversity functions:
- a
data.frame
with individuals as rows and characteristics as columns - a distance matrix between individuals
The rationale is that providing data.frame
s with characteristics is more user-friendly, as they are a common format in functional ecology, and data.frame
s are a familiar object in R.
However, only allowing data.frame
s doesn't provide enough flexibility. In particular, advanced users may want to compute distances with a custom function (instead of euclidean distances).
The functions should return data.frame
s whenever possible for several reasons:
-
data.frame
s are one of the most common object in the R ecosystem meaning they are familiar to beginners and there exist many S3 methods for them -
data.frame
s enable a pipe-able workflow, which is important as R announced they are working on a native base R pipe, and it is prevalent in the tidyverse
- Start with FRic, FDiv, and Rao's Quadratic Entropy