Extract features for a list of species based on phylogenetic Eigenvectors prepared with the iucnn_prepare_phy function. Tip labels need to match the species names in x.

iucnn_phylogenetic_features(x, species = "species", phy.eigen)

Arguments

x

a data.frame of species occurrence records including three columns with species name, longitudinal coordinates and latitudinal coordinates (both decimal).

species

a character string. The name of the column with the species names.

phy.eigen

a matrix of phylogenetic Eigenvector calculated from a phylogenetic tree including training and prediction species using the iucnn_prepare_phy function.

Value

a data.frame of phylogenetic features

Examples

if (FALSE) {
dat <- data.frame(species = c("A","B", "X"),
                  decimallongitude = runif(180,10,15),
                  decimallatitude = runif(180,-5,5))

tree <- ape::rphylo(n = 10, birth = 0.1, death = 0)
tree$tip.label <- LETTERS[1:10]
phy <- iucnn_prepare_phy(phy = tree)

iucnn_phylogenetic_features(x = dat,
                           phy.eigen = phy)
}