setGeneric("ggplot")
#' plot.rdiv
#'
#' @param data object of class \code{rdiv}
#' @export
#'
setMethod(f = "ggplot", signature(data = "rdiv"),
definition = function(data) {
what <- what(data)
if(what=="inddiv") return(plot_inddiv(data))
if(what=="subdiv" || (what=="metadiv") || what=="both") {
qs <- unique(data$q)
if(length(qs)==1) return(plot_single(data))
if(any(qs==0) && any(qs==Inf)) return(plot_diversity(data))
if(!any(qs %in% Inf)) return(simple_plot(data))
}
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.