arch_dist.Rd
arch_dist()
calculates Euclidean distance from every point to every archetype give matrices that contain this data.
arch_dist(data, archetypes, dist_metric = "euclidean")
data | matrix of dim(variables/dimentions, examples) |
---|---|
archetypes | matrix of dim(variables/dimentions, archetypes) |
dist_metric | distance metric, currently only "euclidean" implemented |
matrix of distances to archetypes of dim(examples, archetypes)
#> archetype_1 archetype_2 #> [1,] 3 4 #> [2,] 3 4# Random data that fits into the triangle set.seed(4355) archetypes = generate_arc(arc_coord = list(c(5, 0), c(-10, 15), c(-30, -20)), mean = 0, sd = 1, N_dim = 2)#> Error in generate_arc(arc_coord = list(c(5, 0), c(-10, 15), c(-30, -20)), mean = 0, sd = 1, N_dim = 2): unused argument (N_dim = 2)#> Error in ncol(archetypes): object 'archetypes' not found# Find Euclidean distance between data points and archetypes distance = arch_dist(data, archetypes)#> Error in ncol(archetypes): object 'archetypes' not found# Find Euclidean distance between archetypes arc_distance = arch_dist(archetypes, archetypes)#> Error in ncol(archetypes): object 'archetypes' not found