# Returns a boolean array to use as a filter to remove NA's from a
# columnized matrix with NA's on the diagonal (i.e if Y is an n-by-n
# matrix with NA's on the diagonal, we want to remove the NA's from
# c(Y).)
nafilter <- function(n) {
filter <- rep(TRUE, n^2)
for (i in 1:n) {
filter[n * (i - 1) + i] <- FALSE
}
return(filter)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.