Skip to content

Design principles

Hugo Gruson edited this page Oct 2, 2020 · 1 revision

Scope

Dependencies

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

Functions

  • provide one function per index
  • do not perform transformation on input data without any explicit action from the user

Inputs

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.frames with characteristics is more user-friendly, as they are a common format in functional ecology, and data.frames are a familiar object in R. However, only allowing data.frames doesn't provide enough flexibility. In particular, advanced users may want to compute distances with a custom function (instead of euclidean distances).

Outputs

The functions should return data.frames whenever possible for several reasons:

  • data.frames 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.frames 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

Road map

  • Start with FRic, FDiv, and Rao's Quadratic Entropy
Clone this wiki locally