library(rCharts)
library(plyr)
a <- rCharts:::Highchart$new()
a$title(text = "Student Survey Data")
a$subtitle(text = "Venables, W. N. and Ripley, B. D. (1999) Modern Applied Statistics with S-PLUS")
a$chart(type = "scatter")
a$legend(align = "right", verticalAlign = "middle", layout = "vertical")
a$xAxis(title = list(text = "Age"))
a$yAxis(title = list(text = "Pulse"))
x <- subset(MASS::survey, !is.na(Sex) & Age <= 20)
plyr::ddply(x, .(Sex), function(x) {
a$data(x = x$Age, y = x$Pulse, name = unique(x$Sex))
return(NULL)
})
data frame with 0 columns and 0 rows
a$printChart()