In [6]:
using RDatasets
ggdat = RDatasets.datasets("ggplot2") # convenient way to list datasets for a package
Out[6]:
Note that we can extract the dataset names as a DataArray
In [7]:
ggdat[:Dataset]
Out[7]:
Interact.jl provides "shiny-like" HTML widgets that gives us the ability to do "indirect manipulation" inside an IPython notebook. Interact.jl is built on top of Reactive.jl -- a general framework for reactive programming.
In [8]:
using Interact
@manipulate for dataName = ggdat[:Dataset] # Interact's widget defaults are based on variable types
dat = dataset("ggplot2", dataName)
end
Out[8]:
In [11]:
using Gadfly
diamonds = dataset("ggplot2", "diamonds");
set_default_plot_size(16cm, 12cm);
In [12]:
@manipulate for xn = 10:100, yn = 10:100
plot(diamonds, x = "Carat", y = "Price", Geom.hexbin(xbincount = xn, ybincount = yn))
end
In [ ]: