SlideShare a Scribd company logo
Some Examples in R- [Data Visualization--R graphics]
and others..
library(rpart.plot),library(rCharts),library(plyr),library(knitr),
library(reshape2),library(scales)
Reference:
https://github.com/ramnathv/rCharts/tree/master/inst/libraries
http://www.rpubs.com/dnchari/rcharts
rCharts package by Ramnath Vaidyanathan
Prepared by Volkan OBAN
CODES:
require(rCharts)##Example 1
names(iris)=gsub(".","",names(iris))
rPlot(SepalLength~SepalWidth|Species,data= iris,color= 'Species',type = 'point')
Example2-
## Example 2 FacettedBarplot
hair_eye = as.data.frame(HairEyeColor)
rPlot(Freq~Hair | Eye,color = 'Eye', data = hair_eye,type = 'bar')
Example3-
require(rCharts)
> names(iris) = gsub(".", "", names(iris))
> rPlot(SepalLength ~ SepalWidth | Species, data = iris, color = 'Speci
es', type = 'point')
> ## Example 2 Facetted Barplot
> hair_eye = as.data.frame(HairEyeColor)
> rPlot(Freq ~ Hair | Eye, color = 'Eye', data = hair_eye, type = '
bar')
> hair_eye = as.data.frame(HairEyeColor)
> p2 <- nPlot(Freq ~ Hair, group = 'Eye',
+ data = subset(hair_eye, Sex == "Female"),
+ type = 'multiBarChart'
+ )
> p2$chart(color = c('brown', 'blue', '#594c26', 'green'))
> p2
Example 4:
p <- nPlot(~ cyl, data = mtcars, type = 'pieChart')
> p$chart(donut = TRUE
> p5
Example 5:
data(economics, package = 'ggplot2')
> p <- nPlot(uempmed ~ date, data = economics, type = 'lineChart')
> p
Example6:
dat <- data.frame(
t = rep(0:23, each= 4),
var = rep(LETTERS[1:4],4),
val = round(runif(4*24,0,50)) )
p<- nPlot(val ~t,group = 'var', data = dat, type = 'stackedAreaChart',id='chart' )
p
Example 7:
require(rCharts)
> p1 <- rPlot(SOG ~ yearID, data = team_data,
+ type = "point",
+ size = list(const = 2),
+ color = list(const = "#888"),
+ tooltip = "#! function(item){
+ return item.SOG + ' ' + item.name + ' ' + item.yearID
+ } !#"
+ )
> p1
> myteam = "Boston Red Sox"
> p1$layer(data = team_data[team_data$name == myteam,],
+ color = list(const = 'red'),
+ copy_layer = T)
> p1$set(dom = 'chart3')
> p1
>
Example 8:
>
> library(rCharts)
> library(plyr)
> library(knitr)
> library(reshape2)
> library(scales)
> options(RCHART_WIDTH = 600, RCHART_HEIGHT = 400)
> knitr::opts_chunk$set(comment = NA, results = 'asis', tidy = F, message =
F)
> data(tips, package = 'reshape2')
p= rPlot(x = 'day', y = 'box(tip)', data = tips, type = 'box')
> p
nba = read.csv('http://datasets.flowingdata.com/ppg2008.csv')
> nba.m = ddply(melt(nba), .(variable), transform, rescale = rescale(value)
)
> p= rPlot(Name ~ variable, color = 'rescale', data = nba.m, type = 'tile',
height = 600)
> p
Example:
haireye = as.data.frame(HairEyeColor)
> dat = subset(haireye, Sex == "Female" & Eye == "Blue")
> haireye = as.data.frame(HairEyeColor)
> dat = subset(haireye, Sex == "Female" & Eye == "Blue")
> p1 = mPlot(x = 'Hair', y = list('Freq'), data = dat, type = 'Bar', labels = list("Cou
> p1
dat = subset(haireye, Sex == "Female")
p2 = mPlot(Freq ~ Eye, group = "Hair", data = dat, type = "Bar", labels = 1
:4)
p2
Example:
data(economics, package = 'ggplot2')
dat = transform(economics, date = as.character(date))
p3 <- mPlot(x = "date", y = list("psavert", "uempmed"), data = dat, type =
'Line',
pointSize = 0, lineWidth = 1)
p3$set(xLabelFormat = "#! function (x) {
return x.toString(); }
!#")
p3$set(type = 'Area')
p3
Example:
ecm = reshape2::melt(economics[,c('date', 'uempmed', 'psavert')], id = 'dat
e')
p7 = nPlot(value ~ date, group = 'variable', data = ecm, type = 'lineWithFo
cusChart')
p7$xAxis( tickFormat="#!function(d) {return d3.time.format('%b %Y')(new Dat
e( d * 86400000 ));}!#" )
p7
Example:
library(rpart.plot)
h= hPlot(x = "Wr.Hnd", y = "NW.Hnd", data = MASS::survey,
+ type = c("line", "bubble", "scatter"), group = "Clap", size =
"Age")
h
> map3 = Leaflet$new()
> map3$setView(c(41.7627, -72.6743), zoom = 13)
> map3$marker(c(41.7627, -72.6743), bindPopup = "<p> Hi. I am a popup </p>"
)
> map3$marker(c(41.70, -72.60), bindPopup = "<p> Hi. I am another popup </p
>")
> map3
> map3 = Leaflet$new()
> map3$setView(c(41.7627, -72.6743), zoom = 13)
> map3$marker(c(41.7627, -72.6743), bindPopup = "<p> Hi. I am a popup </p>"
)
> map3$marker(c(41.70, -72.60), bindPopup = "<p> Hi. I am another popup </p
>")
> map3
Example:
> map3 = Leaflet$new()
> map3$setView(c(41.7627, -72.6743), zoom = 13)
> map3$marker(c(41.7627, -72.6743), bindPopup = "<p> Hi. I am a popup </p>"
)
> map3$marker(c(41.70, -72.60), bindPopup = "<p> Hi. I am another popup </p
>")
> map3
Reference:
https://github.com/ramnathv/rCharts/tree/master/inst/libraries
http://www.rpubs.com/dnchari/rcharts
rCharts package by Ramnath Vaidyanathan

More Related Content

What's hot

Advanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part IIAdvanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part II
Dr. Volkan OBAN
 
Cache and Drupal
Cache and DrupalCache and Drupal
Cache and Drupal
Kornel Lugosi
 
Chapter7
Chapter7Chapter7
Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018
Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018
Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018
DevOpsDays Tel Aviv
 
Prgišče Lispa
Prgišče LispaPrgišče Lispa
Prgišče Lispa
Simon Belak
 
Как показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь дискуКак показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь диску
Андрей Шорин
 
Как показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь дискуКак показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь диску
CEE-SEC(R)
 
Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.
Dr. Volkan OBAN
 
strings and objects in JavaScript
strings and  objects in JavaScriptstrings and  objects in JavaScript
strings and objects in JavaScript
Михаил Петров
 
LINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tipsLINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tips
LINE Corporation
 
Database api
Database apiDatabase api
Database api
InternetDevels
 
Zf Zend Db by aida
Zf Zend Db by aidaZf Zend Db by aida
Zf Zend Db by aida
waraiotoko
 
R seminar dplyr package
R seminar dplyr packageR seminar dplyr package
R seminar dplyr package
Muhammad Nabi Ahmad
 
重回帰職人の朝は早い
重回帰職人の朝は早い重回帰職人の朝は早い
重回帰職人の朝は早い
Masahiro Hayashi
 
Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
Yoshiki Satotani
 
Hive Poster
Hive PosterHive Poster
Hive Poster
ragho
 
R meets Hadoop
R meets HadoopR meets Hadoop
R meets Hadoop
Hidekazu Tanaka
 
pROgRAN C++ ApLiKaSI Binery tree
pROgRAN C++ ApLiKaSI Binery treepROgRAN C++ ApLiKaSI Binery tree
pROgRAN C++ ApLiKaSI Binery tree
Naufal R Pradana
 
JSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why notJSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why not
ChengHui Weng
 
Building a horizontally scalable API in php
Building a horizontally scalable API in phpBuilding a horizontally scalable API in php
Building a horizontally scalable API in php
Wade Womersley
 

What's hot (20)

Advanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part IIAdvanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part II
 
Cache and Drupal
Cache and DrupalCache and Drupal
Cache and Drupal
 
Chapter7
Chapter7Chapter7
Chapter7
 
Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018
Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018
Wat.tf - Nati Cohen - DevOpsDays Tel Aviv 2018
 
Prgišče Lispa
Prgišče LispaPrgišče Lispa
Prgišče Lispa
 
Как показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь дискуКак показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь диску
 
Как показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь дискуКак показать 90 млн картинок и сохранить жизнь диску
Как показать 90 млн картинок и сохранить жизнь диску
 
Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.
 
strings and objects in JavaScript
strings and  objects in JavaScriptstrings and  objects in JavaScript
strings and objects in JavaScript
 
LINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tipsLINE iOS開発で実践しているGit tips
LINE iOS開発で実践しているGit tips
 
Database api
Database apiDatabase api
Database api
 
Zf Zend Db by aida
Zf Zend Db by aidaZf Zend Db by aida
Zf Zend Db by aida
 
R seminar dplyr package
R seminar dplyr packageR seminar dplyr package
R seminar dplyr package
 
重回帰職人の朝は早い
重回帰職人の朝は早い重回帰職人の朝は早い
重回帰職人の朝は早い
 
Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
 
Hive Poster
Hive PosterHive Poster
Hive Poster
 
R meets Hadoop
R meets HadoopR meets Hadoop
R meets Hadoop
 
pROgRAN C++ ApLiKaSI Binery tree
pROgRAN C++ ApLiKaSI Binery treepROgRAN C++ ApLiKaSI Binery tree
pROgRAN C++ ApLiKaSI Binery tree
 
JSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why notJSDC 2014 - functional java script, why or why not
JSDC 2014 - functional java script, why or why not
 
Building a horizontally scalable API in php
Building a horizontally scalable API in phpBuilding a horizontally scalable API in php
Building a horizontally scalable API in php
 

Similar to Some Examples in R- [Data Visualization--R graphics]

A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
Dr. Volkan OBAN
 
library(sparkline)
library(sparkline)library(sparkline)
library(sparkline)
Dr. Volkan OBAN
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
Eleanor McHugh
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
A Survey Of R Graphics
A Survey Of R GraphicsA Survey Of R Graphics
A Survey Of R Graphics
Dataspora
 
Joclad 2010 d
Joclad 2010 dJoclad 2010 d
Joclad 2010 d
a1000caroliveira
 
Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.
Workhorse Computing
 
Spark_Documentation_Template1
Spark_Documentation_Template1Spark_Documentation_Template1
Spark_Documentation_Template1
Nagavarunkumar Kolla
 
ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions
Dr. Volkan OBAN
 
Php functions
Php functionsPhp functions
Php functions
JIGAR MAKHIJA
 
Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013
Samir Bessalah
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
Eleanor McHugh
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
Tikal Knowledge
 
R for you
R for youR for you
R for you
Andreas Chandra
 
R (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support SystemR (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support System
Maithreya Chakravarthula
 
PHP record- with all programs and output
PHP record- with all programs and outputPHP record- with all programs and output
PHP record- with all programs and output
KavithaK23
 
Spark by Adform Research, Paulius
Spark by Adform Research, PauliusSpark by Adform Research, Paulius
Spark by Adform Research, Paulius
Vasil Remeniuk
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In Erlang
Sean Cribbs
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with Python
Han Lee
 
Abap basics 01
Abap basics 01Abap basics 01
Abap basics 01
yours4ever002
 

Similar to Some Examples in R- [Data Visualization--R graphics] (20)

A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
 
library(sparkline)
library(sparkline)library(sparkline)
library(sparkline)
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
A Survey Of R Graphics
A Survey Of R GraphicsA Survey Of R Graphics
A Survey Of R Graphics
 
Joclad 2010 d
Joclad 2010 dJoclad 2010 d
Joclad 2010 d
 
Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.
 
Spark_Documentation_Template1
Spark_Documentation_Template1Spark_Documentation_Template1
Spark_Documentation_Template1
 
ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions
 
Php functions
Php functionsPhp functions
Php functions
 
Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
R for you
R for youR for you
R for you
 
R (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support SystemR (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support System
 
PHP record- with all programs and output
PHP record- with all programs and outputPHP record- with all programs and output
PHP record- with all programs and output
 
Spark by Adform Research, Paulius
Spark by Adform Research, PauliusSpark by Adform Research, Paulius
Spark by Adform Research, Paulius
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In Erlang
 
Imugi: Compiler made with Python
Imugi: Compiler made with PythonImugi: Compiler made with Python
Imugi: Compiler made with Python
 
Abap basics 01
Abap basics 01Abap basics 01
Abap basics 01
 

More from Dr. Volkan OBAN

Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Dr. Volkan OBAN
 
Covid19py Python Package - Example
Covid19py  Python Package - ExampleCovid19py  Python Package - Example
Covid19py Python Package - Example
Dr. Volkan OBAN
 
Object detection with Python
Object detection with Python Object detection with Python
Object detection with Python
Dr. Volkan OBAN
 
Python - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriPython - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) Parametreleri
Dr. Volkan OBAN
 
Linear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesLinear Programming wi̇th R - Examples
Linear Programming wi̇th R - Examples
Dr. Volkan OBAN
 
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ..."optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
Dr. Volkan OBAN
 
k-means Clustering in Python
k-means Clustering in Pythonk-means Clustering in Python
k-means Clustering in Python
Dr. Volkan OBAN
 
Naive Bayes Example using R
Naive Bayes Example using  R Naive Bayes Example using  R
Naive Bayes Example using R
Dr. Volkan OBAN
 
R forecasting Example
R forecasting ExampleR forecasting Example
R forecasting Example
Dr. Volkan OBAN
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with R
Dr. Volkan OBAN
 
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingData Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Dr. Volkan OBAN
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
Dr. Volkan OBAN
 
Scikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-PythonScikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-Python
Dr. Volkan OBAN
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet
Dr. Volkan OBAN
 
Pandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheetPandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheet
Dr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
Dr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
Dr. Volkan OBAN
 
R-ggplot2 package Examples
R-ggplot2 package ExamplesR-ggplot2 package Examples
R-ggplot2 package Examples
Dr. Volkan OBAN
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)R Machine Learning packages( generally used)
R Machine Learning packages( generally used)
Dr. Volkan OBAN
 
treemap package in R and examples.
treemap package in R and examples.treemap package in R and examples.
treemap package in R and examples.
Dr. Volkan OBAN
 

More from Dr. Volkan OBAN (20)

Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
 
Covid19py Python Package - Example
Covid19py  Python Package - ExampleCovid19py  Python Package - Example
Covid19py Python Package - Example
 
Object detection with Python
Object detection with Python Object detection with Python
Object detection with Python
 
Python - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriPython - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) Parametreleri
 
Linear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesLinear Programming wi̇th R - Examples
Linear Programming wi̇th R - Examples
 
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ..."optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
 
k-means Clustering in Python
k-means Clustering in Pythonk-means Clustering in Python
k-means Clustering in Python
 
Naive Bayes Example using R
Naive Bayes Example using  R Naive Bayes Example using  R
Naive Bayes Example using R
 
R forecasting Example
R forecasting ExampleR forecasting Example
R forecasting Example
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with R
 
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingData Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision Making
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
 
Scikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-PythonScikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-Python
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet
 
Pandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheetPandas,scipy,numpy cheatsheet
Pandas,scipy,numpy cheatsheet
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
R-ggplot2 package Examples
R-ggplot2 package ExamplesR-ggplot2 package Examples
R-ggplot2 package Examples
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)R Machine Learning packages( generally used)
R Machine Learning packages( generally used)
 
treemap package in R and examples.
treemap package in R and examples.treemap package in R and examples.
treemap package in R and examples.
 

Recently uploaded

在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
Timothy Spann
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Fernanda Palhano
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
zsjl4mimo
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 

Recently uploaded (20)

在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 

Some Examples in R- [Data Visualization--R graphics]

  • 1. Some Examples in R- [Data Visualization--R graphics] and others.. library(rpart.plot),library(rCharts),library(plyr),library(knitr), library(reshape2),library(scales) Reference: https://github.com/ramnathv/rCharts/tree/master/inst/libraries http://www.rpubs.com/dnchari/rcharts rCharts package by Ramnath Vaidyanathan Prepared by Volkan OBAN
  • 2. CODES: require(rCharts)##Example 1 names(iris)=gsub(".","",names(iris)) rPlot(SepalLength~SepalWidth|Species,data= iris,color= 'Species',type = 'point') Example2- ## Example 2 FacettedBarplot hair_eye = as.data.frame(HairEyeColor) rPlot(Freq~Hair | Eye,color = 'Eye', data = hair_eye,type = 'bar')
  • 3. Example3- require(rCharts) > names(iris) = gsub(".", "", names(iris)) > rPlot(SepalLength ~ SepalWidth | Species, data = iris, color = 'Speci es', type = 'point') > ## Example 2 Facetted Barplot > hair_eye = as.data.frame(HairEyeColor) > rPlot(Freq ~ Hair | Eye, color = 'Eye', data = hair_eye, type = ' bar') > hair_eye = as.data.frame(HairEyeColor) > p2 <- nPlot(Freq ~ Hair, group = 'Eye', + data = subset(hair_eye, Sex == "Female"), + type = 'multiBarChart' + ) > p2$chart(color = c('brown', 'blue', '#594c26', 'green')) > p2
  • 4. Example 4: p <- nPlot(~ cyl, data = mtcars, type = 'pieChart') > p$chart(donut = TRUE > p5
  • 5. Example 5: data(economics, package = 'ggplot2') > p <- nPlot(uempmed ~ date, data = economics, type = 'lineChart') > p
  • 6. Example6: dat <- data.frame( t = rep(0:23, each= 4), var = rep(LETTERS[1:4],4), val = round(runif(4*24,0,50)) ) p<- nPlot(val ~t,group = 'var', data = dat, type = 'stackedAreaChart',id='chart' ) p
  • 7.
  • 8.
  • 9. Example 7: require(rCharts) > p1 <- rPlot(SOG ~ yearID, data = team_data, + type = "point", + size = list(const = 2), + color = list(const = "#888"), + tooltip = "#! function(item){ + return item.SOG + ' ' + item.name + ' ' + item.yearID + } !#" + ) > p1
  • 10. > myteam = "Boston Red Sox" > p1$layer(data = team_data[team_data$name == myteam,], + color = list(const = 'red'), + copy_layer = T) > p1$set(dom = 'chart3') > p1 >
  • 11. Example 8: > > library(rCharts) > library(plyr) > library(knitr) > library(reshape2) > library(scales) > options(RCHART_WIDTH = 600, RCHART_HEIGHT = 400) > knitr::opts_chunk$set(comment = NA, results = 'asis', tidy = F, message = F) > data(tips, package = 'reshape2') p= rPlot(x = 'day', y = 'box(tip)', data = tips, type = 'box') > p
  • 12. nba = read.csv('http://datasets.flowingdata.com/ppg2008.csv') > nba.m = ddply(melt(nba), .(variable), transform, rescale = rescale(value) ) > p= rPlot(Name ~ variable, color = 'rescale', data = nba.m, type = 'tile', height = 600) > p
  • 13. Example: haireye = as.data.frame(HairEyeColor) > dat = subset(haireye, Sex == "Female" & Eye == "Blue") > haireye = as.data.frame(HairEyeColor) > dat = subset(haireye, Sex == "Female" & Eye == "Blue") > p1 = mPlot(x = 'Hair', y = list('Freq'), data = dat, type = 'Bar', labels = list("Cou > p1
  • 14. dat = subset(haireye, Sex == "Female") p2 = mPlot(Freq ~ Eye, group = "Hair", data = dat, type = "Bar", labels = 1 :4) p2
  • 15. Example: data(economics, package = 'ggplot2') dat = transform(economics, date = as.character(date)) p3 <- mPlot(x = "date", y = list("psavert", "uempmed"), data = dat, type = 'Line', pointSize = 0, lineWidth = 1) p3$set(xLabelFormat = "#! function (x) { return x.toString(); } !#") p3$set(type = 'Area') p3
  • 16. Example: ecm = reshape2::melt(economics[,c('date', 'uempmed', 'psavert')], id = 'dat e') p7 = nPlot(value ~ date, group = 'variable', data = ecm, type = 'lineWithFo cusChart') p7$xAxis( tickFormat="#!function(d) {return d3.time.format('%b %Y')(new Dat e( d * 86400000 ));}!#" ) p7
  • 17. Example: library(rpart.plot) h= hPlot(x = "Wr.Hnd", y = "NW.Hnd", data = MASS::survey, + type = c("line", "bubble", "scatter"), group = "Clap", size = "Age") h > map3 = Leaflet$new() > map3$setView(c(41.7627, -72.6743), zoom = 13) > map3$marker(c(41.7627, -72.6743), bindPopup = "<p> Hi. I am a popup </p>" ) > map3$marker(c(41.70, -72.60), bindPopup = "<p> Hi. I am another popup </p >") > map3 > map3 = Leaflet$new() > map3$setView(c(41.7627, -72.6743), zoom = 13) > map3$marker(c(41.7627, -72.6743), bindPopup = "<p> Hi. I am a popup </p>" ) > map3$marker(c(41.70, -72.60), bindPopup = "<p> Hi. I am another popup </p >") > map3
  • 18. Example: > map3 = Leaflet$new() > map3$setView(c(41.7627, -72.6743), zoom = 13) > map3$marker(c(41.7627, -72.6743), bindPopup = "<p> Hi. I am a popup </p>" ) > map3$marker(c(41.70, -72.60), bindPopup = "<p> Hi. I am another popup </p >") > map3