Presentation

8/29/2016

Charts

Lets display some charts.

library(rCharts)

library(ggplot2)

n1 <- nPlot(carat ~ cut , group = "color", data = diamonds[1:40,], type = "multiBarChart")

n1

Plot

Plotting Chart from economics dataset

library(rCharts)
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 = 2, lineWidth = 2)
m1

Plot

library(googleVis)
Geo <- gvisGeoChart(Exports,locationvar='Country',colorvar='Profit',options=list(height=200,width=250))
Tbl <- gvisTable(Exports)
plot(gvisMerge(Geo, Tbl, horizontal=TRUE))

Lets plot Fruit vs Year

library(googleVis)
M <- gvisMotionChart(Fruits, 'Fruit', 'Year', options=list(width=400, height=350))

plot(M)
library(XML)
Bubble <- gvisBubbleChart(Fruits, idvar="Fruit",  xvar="Sales", yvar="Expenses",colorvar="Year",
                          sizevar="Profit", options=list(hAxis='{minValue:75, maxValue:125}'))
plot(Bubble)