```
hubercls <-
function(r, delta) {
d <- matrix(NA, nrow(r), ncol(r))
for (i in 1:nrow(r)) {
for (j in 1:ncol(r)) {
if (r[i, j] > 1)
d[i, j] <- 0 else {
if (r[i, j] <= (1 - delta))
d[i, j] <- 1 - r[i, j] - 0.5 * delta else d[i, j] <- 0.5 * (1 - r[i, j])^2/delta
}
}
}
d
}
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.