# Regression Plots using rCharts
require(ggplot2)
require(rCharts)
dat = fortify(lm(mpg ~ wt, data = mtcars))
names(dat) = gsub('\\.', '_', names(dat))
p1 <- rPlot(mpg ~ wt, data = dat, type = 'point')
p1$layer(y = '_fitted', copy_layer = T, type = 'line',
color = list(const = 'red'),
tooltip = "function(item){return item._fitted}")
p1