vegclust2kmeans: Reshapes as kmeans object

View source: R/vegclust2kmeans.R

vegclust2kmeansR Documentation

Reshapes as kmeans object

Description

This function casts an object of class vegclust into an object of class kmeans.

Usage

vegclust2kmeans(x)

Arguments

x

An object of class vegclust to be casted, where method="KM" and mode="raw".

Value

An object of class kmeans

Author(s)

Miquel De Cáceres, CREAF

See Also

vegclust, kmeans

Examples

## Loads data  
data(wetland)

## This equals the chord transformation 
wetland.chord <- as.data.frame(sweep(as.matrix(wetland), 1, 
                                     sqrt(rowSums(as.matrix(wetland)^2)), "/"))

## Create noise clustering with 3 clusters. Perform 10 starts from random seeds 
wetland.vc <- vegclust(wetland.chord, mobileCenters=3, 
                       method="KM", nstart=10)

## Reshapes as kmeans object
wetland.km <- vegclust2kmeans(wetland.vc)
wetland.km

vegclust documentation built on June 10, 2025, 9:09 a.m.