unitvector <- function(length, what, logical = FALSE) {
vec <- numeric(length)
vec[what] <- 1.
if (logical) as.logical(vec) else vec
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.