dist.mode: Configure which package is used to compute the distance...

Description Usage Arguments Examples

View source: R/config.R

Description

Configure which package is used to compute the distance matrix or register one. Note that the speed depends on the data and the hardware.

Usage

1
dist.mode(mode = c("stats", "amap"), FUN = NULL)

Arguments

mode

string. The available modes are "stats" and "amap" by default.

FUN

a function which has one argument x or NULL. The function should compute the pairwise distance of x and return a dist object. The user can skip this argument if the mode is registered. For example, "stats" and "amap" are registered by default.

Examples

1
2
3
4
# use stats::dist to compute the pairwise distance
dist.mode("stats") 
## use gputools to compute the pairwise distance with GPU
# dist.mode("gputools", function(x) gputools::gpuDist(x, method = "euclidean", p = 2.0)) 

wush978/supc documentation built on Oct. 12, 2021, 3:24 p.m.