目录

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

关于

提供 Gower 距离计算,适用于混合类型变量之间的相似性或距离分析。

162.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号