All Projects → markvanderloo → Gower

markvanderloo / Gower

Licence: gpl-3.0
Gower's distance for R

Programming Languages

c
50402 projects - #5 most used programming language

Build Status Coverage Status CRAN status Downloads

gower

Gower's distance for R. Based in C, using openMP for parallelization.

Usage

library(gower)
reviris <- iris[rev(seq_len(nrow(iris))),,drop=FALSE]
# compute distances
d <- gower_dist(iris, reviris)

# data.frame with less records is recycled
d <- gower_dist(iris[1:3,,drop=FALSE], reviris)

# compute top-n matches
mat <- gower_topn(iris, reviris, n=5)

## mat$index   : Array of indices (sorted from better to worse match)
## mat$distance: Array of distances (sorted from small to large)

More info in the vignette

Installation

From CRAN

install.packages("gower")

Beta versions

Made available through my drat repo.

First, install the drat package. Users of the OS who's name shall not be mentioned need to install Rtools first.

if(!require(drat)) install.packages('drat')
drat::addRepo('markvanderloo')
install.packages('gower',type='source')

Reference

Gower (1971) A general coefficient of similarity and some of its properties. Biometrics 27 857-874 pdf

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].