Source:
library(devtools)
install_github("Rtwmap", "wush978")
data(county1984)
random.color <- as.factor(sample(1:3, length(county1984), TRUE))
color <- rainbow(3)
county1984$random.color <- random.color
spplot(county1984, "random.color", col.regions = color, main = "Taiwan Random Color")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.