mangow: Convert a Gower distance problem to a Manhattan distance...

Description Usage Arguments Value Examples

View source: R/mangow.R

Description

This function converts a data frame to a matrix with the same number of rows. For any two rows of the resulting matrix, the Manhattan distance equals the Gower distance in the input data between the corresponding rows.

Usage

1

Arguments

data

The input data frame with continuous, categorical (factor) and ordered variables

Value

A numeric matrix

Examples

1
2
3
4
5
6
iris_sub <- iris[c(1:2,50:51,100:101), ]
row.names(iris_sub) <- NULL
iris_sub
cluster::daisy(iris_sub, "gower")
mangow_iris_sub <- mangow(iris_sub)
cluster::daisy(mangow_iris_sub, "manhattan")

krlmlr/mangow documentation built on Jan. 1, 2020, 4:53 p.m.