Functions for studying relationships between species in respeciate data sets.

rsp_cor_species generates a by-species correlation matrix of the supplied respeciate data sets.

rsp_cor_species(
  rsp,
  min.n = 3,
  cols = c("#80FFFF", "#FFFFFF", "#FF80FF"),
  na.col = "#CFCFCF",
  heatmap.args = TRUE,
  key.args = TRUE,
  report = "silent"
)

Arguments

rsp

respeciate object, a data.frame of respeciate profiles.

min.n

numeric (default 3), the minimum number of species measurements needed in a profile for the function to use it in correlation calculations. Here, it should be noted that this does not guarantee the three matched pairs of measurements needed to calculate a correlation coefficient because not all profiles contain all species, so there may still be insufficient overlap on a case-by-case basis.

cols

a series of numeric, character or other class values that can be translated into a color gradient, used to color valid cases when generating plots and color keys, default c("#80FFFF", "#FFFFFF", "#FF80FF") equivalent to cm.colors output.

na.col

numeric, character or other class that can be translated into a single color, used to color NAs when generating plots and color keys, default grey "#CFCFCF".

heatmap.args

logical or list, heat map settings. Options include TRUE (default) to generate the heat map without modification; FALSE to not plot it; or a list of heat map options to alter the plot default appearance. The plot, a standard heat map with the dendrograms removed, is generated using heatmap, so see associated documentation for valid options.

key.args

logical or list, color key settings if plotting the correlation matrix heat map. Options include TRUE (default) to generate the key without modification; FALSE to not include the key; or a list of options to alter the key appearance.

report

logical or character, the required function output. Options include: 'silent' (default), to return the correlation matrix invisibly; TRUE to return the matrix (visibly); and, FALSE to not return it.

Value

By default rsp_cor_species invisibly returns the calculated correlation matrix a plots it as a heat map, but arguments including heatmap and report can be used to modify function outputs.