# install from html_assets branch
# install_github("rCharts", "ramnathv", ref = "html_assets")

# utility function to convert data frame to format required for funnel
make_dataset = function(x, y, data){
  require(rCharts)
  toJSONArray2(data[c(x, y)], json = F, names = F)
}

options(stringsAsFactors = F)
dat = data.frame(
  x = c('Visits', 'Downloads', 'Requested price list', 'Invoice', 'Finalized'),
  y = c(15654, 4064, 1987, 976, 846)
)

h1 <- Highcharts$new()
h1$chart(type = 'funnel')
h1$series(data = make_dataset('x', 'y', dat))
h1$addAssets(js = '//github.highcharts.com/rambera/modules/funnel.js')
h1