Skip to content

Instantly share code, notes, and snippets.

@phedinkus
Last active June 7, 2018 15:23
Show Gist options
  • Save phedinkus/7fb76084a9ca9b8677e70d8b98db173f to your computer and use it in GitHub Desktop.
Save phedinkus/7fb76084a9ca9b8677e70d8b98db173f to your computer and use it in GitHub Desktop.
find_euclidean_distance <- function(stratum_data) {
  # seed_value comes from the wrapper function init
  set.seed(seed_value)
  stratum_mean <- moment(stratum_data, order=1, central=FALSE)
  sqrt(rowSums((stratum_data - stratum_mean)^2))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment