Nothing
nearestScheme <- function(valueColours){
### valueColours is a data frame with $value and $col columns
force(valueColours)
f = function(data){
colours = rep(NA,length(data))
for(i in 1:length(data)){
d=data[i]
diffs = abs(valueColours$value-d)
colours[i]=as.character(valueColours[which.min(diffs),'col'])
}
return(colours)
}
class(f) <- c("nearestScheme","colourScheme","function")
attr(f,"type") <- "nearest colour scheme"
return(f)
}
schemeData.nearestScheme <- function(object){
return(get("valueColours",env=environment(object)))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.