# load diamonds dataset from ggplot2
require(ggplot2)
data(diamonds)
# calculate normalized prices to be used as sample probabilities
price.norm <- with(diamonds, price / max(diamonds$price))
# draw samples
exp.diamonds <- diamonds[sample(1:nrow(diamonds), size=10000, prob=price.norm, replace=TRUE),]
chp.diamonds <- diamonds[sample(1:nrow(diamonds), size=10000, prob=1-price.norm, replace=TRUE),]
tp1 <- tableplot(exp.diamonds)
tp2 <- tableplot(chp.diamonds)
plot(tp2 - tp1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.