Loading Libraries
library(knitr)
library(printr)
library(rCharts)
Example 1:
r1 <- rPlot(mpg ~ wt, data = mtcars, type="point" , color="gear")
#r1$print('iframesrc', include_assets=TRUE)
r1$show('iframesrc' ,cdn = TRUE)
Example 2:
r1 <- rPlot(mpg ~ wt | am , data = mtcars, type="point" , color="gear")
r1$set(width = 800)
#r1$show('iframesrc' ,cdn = TRUE)
r1$show('inline', include_assets = TRUE)
Example 3:
data(economics, package = "ggplot2")
econ <- transform(economics, date = as.character(date))
m1 <- mPlot(x = "date", y = c("psavert", "uempmed"), type = "Line", data = econ)
m1$set(pointSize = 0, lineWidth = 1)
#m1$show('iframesrc' ,cdn = TRUE)
m1$show('inline', include_assets = TRUE)
Loading required package: reshape2
Example 4:
hair_eye_male <- subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair, group = "Eye", data = hair_eye_male, type = "multiBarChart")
n1$show('inline', include_assets = TRUE)
library(MASS)
h1 <- hPlot(x = "Wr.Hnd", y = "NW.Hnd", data = survey,
type = c("line", "bubble", "scatter"),
group = "Clap",
size = "Age")
Warning in hPlot(x = "Wr.Hnd", y = "NW.Hnd", data = survey, type =
c("line", : Observations with NA has been removed
h1$show('inline', include_assets = TRUE)