mhead <- function(m, i = 6, j = i) {
force(j)
i <- head(seq_len(nrow(m)), i)
j <- head(seq_len(ncol(m)), j)
return(m[i,j])
}
mtail <- function(m, i = 6, j = i) {
force(j)
i <- tail(seq_len(nrow(m)), i)
j <- tail(seq_len(ncol(m)), j)
return(m[i,j])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.