| euc_dist | R Documentation | 
This function allows you to calculate the euclidean distance between two vectors
euc_dist(data, var1, var2)
data | 
 A data frame  | 
var1 | 
 Numeric vector (generally f1).  | 
var2 | 
 Numeric vectors (generally f2).  | 
# Create some data
df <- data.frame(vowel = gl(n = 2, k = 5, labels = c('a', 'o')),
                 var1 = rnorm(10, 10, 2), 
                 var2 = rnorm(10, 20, 2))
# Calculate euc.dist on entire data frame
euc_dist(data = df, var1 = var1, var2 = var2)
# Calculate euc.dist for each vowel
library(dplyr)
df %>%
 group_by(., vowel) %>%
 summarise(euc = euc_dist(., var1 = var1, var2 = var2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.