#' Smart Colour
#'
#' Assign colors to one dimensional value clusters
#'
#' @export
smartColour <- function(value, length=7, palette,idx=T){
if(missing(palette)) palette <- colorRampPalette(c("#d8f5c5","#6ebe3b","#43821d"))
if(min( value, na.rm=T ) == 0)
c("#FFFFFF",palette(length-1))[smartCut(value, length, return='clust')] else
palette(length)[smartCut(value, length, return='clust')]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.