## This code is part of the megaptera package
## © C. Heibl 2014 (last update 2017-01-12)
#' @export
cropToReference <- function(x){
## first and last position of reference
ref <- x[grep("REF", rownames(x)), ]
ref <- ref != as.raw(4)
ref <- apply(ref, 1, function(z) range(which(z)))
ref <- c(min(ref[1, ]), max(ref[2, ]))
## crop
x[, ref[1]:ref[2]]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.