The goal of mangow is to normalize provide a transformation from Gower to Manhattan distance. The only exported function in this package converts a data frame to an equivalent matrix where the pairwise Gower distances in the input data frame are identical to the pairwise Manhattan distances in the resulting matrix. With this transformation, efficient algorithms for the Manhattan distance, such as nearest-neighbor for L1, can be extended to work with Gower distances.


You can install the released version of mangow from CRAN with:

And the development version from GitHub with:


This basic example computes a Gower dissimilarity matrix on a subset of the Iris data and compares it with the L1 dissimilarity matrix of the transformed data.

The transformation returns a matrix with the same number of rows, but potentially more columns, depending on the data types of the input columns.

The resulting dissimilarity matrix for the Manhattan metric is the same as the Gower dissimilarity matrix on the input.