partition_tdv_grdtp {diffval}R Documentation

Obtain a partition using a Greedy-type algorithm

Description

This function obtains a partition of the columns of a given phytosociological matrix, aiming at high values of the Total Differential Value (TDV), implementing a Greedy-type algorithm.

Usage

partition_tdv_grdtp(m_bin, k, verify = TRUE)

Arguments

m_bin

A matrix. A phytosociological table of 0s (absences) and 1s (presences), where rows correspond to taxa and columns correspond to relevés.

k

A numeric giving the number of desired groups.

verify

A logical. If TRUE (the default) the function verifies if basic features of m_bin data structure are met. Otherwise if FALSE.

Details

Given the phytosociological table m_bin (rows corresponding to taxa and columns corresponding to relevés), this function uses a Greedy-type algorithm (a simplified version of the Greedy algorithm) to obtain a k-partition (k, defined by the user) of the columns of m_bin, aiming at high values of TDV. The algorithm operates in the following way: Firstly, k columns are selected randomly to work as seeds for each one of the desired k groups. Secondly, one of the remaining columns is selected randomly and added to the partition group which maximizes the upcoming TDV. This second step is repeated until all columns are placed in a group of the k-partition.

This function is expected to perform faster than partition_tdv_grasp(), yet returning worse partitions in terms of TDV. For the (true) Greedy algorithm see partition_tdv_grasp(). See tdv() for an explanation on the TDV of a phytosociological table.

Value

A numeric vector, which length is the same as the number of columns of m_bin, with numbers from 1 to k, representing the group to which the respective column was ascribed.

Author(s)

Jorge Orestes Cerdeira and Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.

Examples

# Getting the Taxus baccata forests data set
data(taxus_bin)

# Obtaining a partiton based on a Greedy-type algorithm
partition_tdv_grdtp(taxus_bin, 3)


[Package diffval version 1.1.0 Index]