This is a wrapper function to perform standard data preparation and either unconstrained (DCA, vegan package]) or constrained ordination (DCCA, CANOCO software) with fossil pollen data. By default constrained ordination is constrained by "age".

fit_ordination(
  data_source_community,
  sel_method = c("unconstrained", "constrained"),
  data_source_predictors = NULL,
  var_name_pred = "age",
  sel_complexity = c("linear", "poly_2", "poly_3"),
  transform_to_percentage = FALSE,
  tranformation = c("none", "chisq", "hellinger")
)

Arguments

data_source_community

Data.frame with community data. Each row is a sample. The first column is sample_idand others are individual taxa.

sel_method
  • "unconstrained" - Detrended Correspondence Analysis

  • "constrained" - Detrended Correspondence Canonical Analysis

data_source_predictors

Data.frame with predictors. The first column is sample_id. Other columns can be predictors.

var_name_pred

Character. Vector with the name of a predictor variable.

sel_complexity

Indicate how the predictor should be used

  • "linear" - a linear predictor

  • "poly_2" - a polynomial predictor of second order

  • "poly_3" - a polynomial predictor of third order

transform_to_percentage

Logical. Should community data be transformed into percentages?

tranformation

Logical. Which transformation should be applied?

  • "none" - without transformation

  • "chisq" - Chisq tranformation

  • "hellinger" - Hellinger transformation

It is recommended to apply a transformation to percentage data.

Value

  • case_r - numeric matrix with CaseR scores for first 4 axes

  • tot_inertia - total variation in (transformed) response data

  • axis_1_grad_length - total gradient length of the first axis

Additional values are reported for unconstrained

  • ordination - ordination object of class "decorana"

Additional values are reported for constrained

  • sel_complexity - see sel_complexity agument description