fitKNN: Fit using K-nearest neighbour

Description Usage Arguments Details Value Author(s)

View source: R/fitKNN.R

Description

Model adegency matrix using K-nearest neighbour approach

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fitKNN(
  data,
  binary = TRUE,
  distFrom = "jaccard",
  distTo = "jaccard",
  distTraitFrom = "euclidean",
  distTraitTo = "euclidean",
  traitWeight,
  nNeig
)

Arguments

data

An object of the class alienData, see alienData.

binary

Logical. Whether the adjacency matrix is binary or not. Default is TRUE.

distFrom

Character string defining which distance (or dissimilarity) to apply on the "From" species. Check vegdist for the distances to choose from. Default is "jaccard".

distTo

Character string defining which distance (or dissimilarity) to apply on the "To" species. Check vegdist for the distances to choose from. Default is "jaccard".

distTraitFrom

Character string defining which distance (or dissimilarity) to apply on traits of the "From" species. Check vegdist for the distances to choose from. Default is "euclidean".

distTraitTo

Character string defining which distance (or dissimilarity) to apply on traits of the "To" species. Check vegdist for the distances to choose from. Default is "euclidean".

traitWeight

Numeric. Defines the contribution of the traits in the analysis. Must be between 0 and 1. Default is 0.5.

nNeig

Integer defining how many neighbours to consider.

Details

This function should only be used for bipartite adjency matrice.

The argument traitWeight defines the important of traits in the analysis. If a weight of 0 is given, the traits are assumes to have no importance. Conversely, if traitWeight is 1 the traits are given their full importance in the analysis.

When ranking the species to find the nNeig nearest neighbour, in case of ties the argument tie.method in the rank function is set to "first". Also, when ranking the species, it is assumed that the species is not a neighbour of itself.

NAs were removed in the calculation of the distances whenever they were present, but also in the calculation of the interaction probability. For species where all distance values are NAs, the returned interactions probability will be 0.

Value

An object of class alienFit.

Author(s)

F. Guillaume Blanchet and Dominique Gravel


TheoreticalEcosystemEcology/alien documentation built on Feb. 21, 2020, 7:12 p.m.