MinDistFunc = function(vec, mat) {
DistVec = rep(0, dim(mat)[1])
for (i in 1:dim(mat)[1]){
DistVec[i] = norm(t(vec) - mat[i,], type = "F")
}
return(which.min(DistVec))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.