SlideShare a Scribd company logo
Reference: http://zevross.com/blog/2014/08/04/beautiful-plotting-in-r-a-ggplot2-cheatsheet-3/
http://www.cookbook-r.com/
http://moderndata.plot.ly/trisurf-plots-in-r-using-plotly/
Prepared by Volkan OBAN
Some R Examples
[R table and Graphics]
Advanced Data Visualization in R (Some Examples)
Example:
> library(ggmap)
> map1 = suppressMessages(get_map(
+ location = 'Istanbul', zoom = 14, #zoom-in level
+ maptype="satellite")) #map type
> ggmap(map1)
>
 
 
Example:
> library(ggmap)
> map = suppressMessages(get_map(location = 'Turkey', zoom = 4))
> ggmap(map)
Example:
trk = suppressMessages(geocode(c(
+ "Erzurum, Turkey",
+ "Istanbul,Turkey",
+ "Izmir,Turkey",
+ "Bursa,Turkey"), source="google"))
> ggmap(map) + geom_point(aes(x=trk$lon, y = trk$lat),
+ lwd = 4, colour = "red") + ggtitle("Ziyaret ettiğ
im iller")
Example: Table
 
Code: 
library(hwriter) 
 
fdir <‐ "C:/Users/lenovo/Documents/Calısma/Yeni klasör" 
 
data <‐ textConnection("Name,A,B,C,D,E 
                       Volkan OBAN,1,2,5,4,3 
                       Alan Turing,8,12,24,38,7 
                       Virginia Woolf,15,8,7,28,32 
                       Bertnard Russel ,25,28,32,27,42 
                       Thomas Edison,268,321,9,43,21 
                       Albert Einstein,335,316,26,50,64 
                       Abdulhak Hamit Tarhan,10,7,5,3,8 
                       Maria Curie,337,309,25,27,60 
                       Ahmet Hasim,357,305,16,34,57 
                       Cahit Arf,348,302,24,39,56 
                       Omer Seyfettin,324,302,14,63,53 
                       Fizuli,296,301,12,14,40 
                       Gazali,338,299,18,21,62 
                       Asik Veysel,317,297,32,61,99 
                       Erzurumlu Emrah,353,289,11,60,76 
                       Sair Nefi,296,284,14,30,63 
                       Asik Mahsuni Serif,292,284,11,59,37 
                       Tarik Akan,297,283,5,35,26 
                       Cemal Sureyya,307,280,4,35,49 
                       Orhan Veli,358,279,17,29,82 
                       Ahmet Arif,299,271,12,37,71 
                       Sezai Karakoc,332,271,16,31,92 
                       Ozdemir Asaf,293,270,17,33,72 
                       Ahmet Kutsi Tecer,383,269,13,53,75 
                       Tevfik Fikret,276,264,8,40,37 
                       Cenap Sahabettin,280,261,7,26,38 
                       Ahmet Muhip Diranas,337,258,21,62,90 
                       Faruk Nafiz Camlibel,294,255,28,68,74 
                       Necip Fazil Kisakurek,336,250,24,39,84 
                       Nazim Hikmet, 349,246,30,73,113 
                       Can Yucel,361,224,19,35,99") 
 
 
data <‐ read.csv(data, h=T) 
 
row.colours <‐ rep(c("white", "#C0C0C0"), nrow(data)/2+1) 
 
hwrite(data[1:nrow(data), 1:6], 
       paste(fdir, "AlternatingRowsTable.html", sep="/"), 
       center=TRUE, 
       row.bgcolor=row.colours) 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Example:
 
 
 
Code: 
library(hwriter) 
 
fdir <‐ "C:/Users/lenovo/Documents/Calısma/Yeni klasör" 
 
data <‐ textConnection("Name,A,B,C,D,E 
                       Volkan OBAN,1,2,5,4,3 
                       Alan Turing,8,12,24,38,7 
                       Virginia Woolf,15,8,7,28,32 
                       Bertnard Russel ,25,28,32,27,42 
                       Thomas Edison,268,321,9,43,21 
                       Albert Einstein,335,316,26,50,64 
                       Abdulhak Hamit Tarhan,10,7,5,3,8 
                       Maria Curie,337,309,25,27,60 
                       Ahmet Hasim,357,305,16,34,57 
                       Cahit Arf,348,302,24,39,56 
                       Omer Seyfettin,324,302,14,63,53 
                       Fizuli,296,301,12,14,40 
                       Gazali,338,299,18,21,62 
                       Asik Veysel,317,297,32,61,99 
                       Erzurumlu Emrah,353,289,11,60,76 
                       Sair Nefi,296,284,14,30,63 
                       Asik Mahsuni Serif,292,284,11,59,37 
                       Tarik Akan,297,283,5,35,26 
                       Cemal Sureyya,307,280,4,35,49 
                       Orhan Veli,358,279,17,29,82 
                       Ahmet Arif,299,271,12,37,71 
                       Sezai Karakoc,332,271,16,31,92 
                       Ozdemir Asaf,293,270,17,33,72 
                       Ahmet Kutsi Tecer,383,269,13,53,75 
                       Tevfik Fikret,276,264,8,40,37 
                       Cenap Sahabettin,280,261,7,26,38 
                       Ahmet Muhip Diranas,337,258,21,62,90 
                       Faruk Nafiz Camlibel,294,255,28,68,74 
                       Necip Fazil Kisakurek,336,250,24,39,84 
                       Nazim Hikmet, 349,246,30,73,113 
                       Can Yucel,361,224,19,35,99") 
data <‐ read.csv(data, h=T) 
 
data$Name_cell_color <‐ "white" 
for(col in names(data[,c(‐1, ‐7)])) { 
  ntiles <‐ quantile(data[,c(col)], probs=c(.25, .75)) 
  color_col <‐ paste(col, "cell_color", sep="_") 
  columnData <‐ data[,c(col)] 
  data[,c(color_col)] <‐ ifelse(columnData<=ntiles[1], "red", 
                                ifelse(columnData>=ntiles[2], "green", 
                                       "white")) 
} 
 
# transpose the color columns of the data frame and convert it to a list 
# goes from dataframe to matrix to dataframe to list 
# see http://stackoverflow.com/questions/3492379/data‐frame‐rows‐to‐a‐list 
row.colours <‐ as.list(as.data.frame(t(data[1:nrow(data),7:12]))) 
 
hwrite(data[1:nrow(data), 1:6], 
       paste(fdir, "QuartilesTable.html", sep="/"), 
       center=TRUE, 
       row.bgcolor=row.colours) 
 
 
 
 
 
Example:
>library(reshape2)
> head(tips)
total_bill tip sex smoker day time size
1 16.99 1.01 Female No Sun Dinner 2
2 10.34 1.66 Male No Sun Dinner 3
3 21.01 3.50 Male No Sun Dinner 3
4 23.68 3.31 Male No Sun Dinner 2
5 24.59 3.61 Female No Sun Dinner 4
6 25.29 4.71 Male No Sun Dinner 4
> # A histogram of bill sizes
> hp <- ggplot(tips, aes(x=total_bill)) + geom_histogram(binwidth=2,colour=
"white")
>
> # Histogram of total_bill, divided by sex and smoker
> hp + facet_grid(sex ~ smoker)
>
> # Same as above, with scales="free_y"
> hp + facet_grid(sex ~ smoker, scales="free_y")
>
> # With panels that have the same scaling, but different range (and theref
ore different physical sizes)
> hp + facet_grid(sex ~ smoker, scales="free", space="free")
 
 
Example: 
library(ggplot2) 
df1 <‐ data.frame( 
    sex = factor(c("Female","Female","Male","Male")), 
    time = factor(c("Lunch","Dinner","Lunch","Dinner"), levels=c("Lunch","Dinner")), 
    total_bill = c(13.53, 16.81, 16.24, 17.42) 
) 
 
# A basic graph 
lp <‐ ggplot(data=df1, aes(x=time, y=total_bill, group=sex, shape=sex)) + geom_line() + 
geom_point() 
lp 
 
# Change the legend 
lp + scale_shape_discrete(name  ="Payer", 
                          breaks=c("Female", "Male"), 
                          labels=c("Woman", "Man")) 
 
 
 
lp1 + scale_colour_discrete(name  ="Payer", 
                            breaks=c("Female", "Male"), 
                            labels=c("Woman", "Man")) + 
      scale_shape_discrete(name  ="Payer", 
                           breaks=c("Female", "Male"), 
                           labels=c("Woman", "Man")) 
 
Multiplot---
 
>library(ggplot2) 
>bp <‐ ggplot(data=PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() 
> a1<‐bp + theme(legend.position=c(.5, .5)) 
>  
> # Set the "anchoring point" of the legend (bottom‐left is 0,0; top‐right is 1,1) 
> # Put bottom‐left corner of legend box in bottom‐left corner of graph 
> a2<‐bp + theme(legend.justification=c(0,0), legend.position=c(0,0)) 
>  
> # Put bottom‐right corner of legend box in bottom‐right corner of graph 
> a3<‐bp + theme(legend.justification=c(1,0), legend.position=c(1,0)) 
 
 
> multiplot <‐ function(..., plotlist=NULL, file, cols=1, layout=NULL) { 
+     require(grid) 
+      
+     # Make a list from the ... arguments and plotlist 
+     plots <‐ c(list(...), plotlist) 
+      
+     numPlots = length(plots) 
+      
+     # If layout is NULL, then use 'cols' to determine layout 
+     if (is.null(layout)) { 
+         # Make the panel 
+         # ncol: Number of columns of plots 
+         # nrow: Number of rows needed, calculated from # of cols 
+         layout <‐ matrix(seq(1, cols * ceiling(numPlots/cols)), 
+                          ncol = cols, nrow = ceiling(numPlots/cols)) 
+     } 
+      
+     if (numPlots==1) { 
+         print(plots[[1]]) 
+          
+     } else { 
+         # Set up the page 
+         grid.newpage() 
+         pushViewport(viewport(layout = grid.layout(nrow(layout), ncol(layout)))) 
+          
+         # Make each plot, in the correct location 
+         for (i in 1:numPlots) { 
+             # Get the i,j matrix positions of the regions that contain this subp
lot 
+             matchidx <‐ as.data.frame(which(layout == i, arr.ind = TRUE)) 
+              
+             print(plots[[i]], vp = viewport(layout.pos.row = matchidx$row, 
+                                             layout.pos.col = matchidx$col)) 
+         } 
+     } 
+ } 
> multiplot(a1,a2,a3) 
 
 
Example: 
library(ggplot2)
> nmmaps<-read.csv("chicago-nmmaps.csv", as.is=T)
> nmmaps$date<-as.Date(nmmaps$date)
> nmmaps<-nmmaps[nmmaps$date>as.Date("1996-12-31"),]
> nmmaps$year<-substring(nmmaps$date,1,4)
> head(nmmaps)
city date death temp dewpoint pm10 o3 time season ye
ar
3654 chic 1997-01-01 137 36.0 37.50 13.052268 5.659256 3654 winter 19
97
3655 chic 1997-01-02 123 45.0 47.25 41.948600 5.525417 3655 winter 19
97
3656 chic 1997-01-03 127 40.0 38.00 27.041751 6.288548 3656 winter 19
97
3657 chic 1997-01-04 146 51.5 45.50 25.072573 7.537758 3657 winter 19
97
3658 chic 1997-01-05 102 27.0 11.25 15.343121 20.760798 3658 winter 19
97
3659 chic 1997-01-06 127 17.0 5.75 9.364655 14.940874 3659 winter 19
97
>g<-ggplot(nmmaps, aes(date, temp))+geom_point(color="firebrick")
> g
>g<-ggplot(nmmaps, aes(date, temp))+geom_point(color="firebrick")
> g + ylim(c(0,60))
 
 
> g<-ggplot(nmmaps, aes(date, temp, color=factor(season)))+geom_point()
> g
 
 
g+theme(legend.title = element_text(colour="chocolate", size=16, face="bold
"))+
+ scale_color_discrete(name="This color isncalled chocolate!?")
 
 
 
 
> ggplot(nmmaps, aes(x=date, y=o3))+geom_line(color="grey")+geom_point(colo
r="red")
 
 
> ggplot(nmmaps, aes(date,temp))+geom_point(color="chartreuse4")+
+ facet_wrap(~year, ncol=2)
 
 
 
> ggplot(nmmaps, aes(date,temp))+geom_point(color="chartreuse4")+
+ facet_wrap(~year, ncol=2, scales="free")
 
 
 
 
 
> library(grid)
> pushViewport(viewport(layout = grid.layout(1, 2)))
> print(myplot1, vp = viewport(layout.pos.row = 1, layout.pos.col = 1))
> print(myplot2, vp = viewport(layout.pos.row = 1, layout.pos.col = 2))
>
> # alternative, a little easier
> library(gridExtra)
> grid.arrange(myplot1, myplot2, ncol=2)
 
 
 
 
> library(ggthemes)
> ggplot(nmmaps, aes(date, temp, color=factor(season)))+
+ geom_point()+ggtitle("This plot looks a lot different from the defaul
t")+
+ theme_economist()+scale_colour_economist()
 
 
 
> ggplot(nmmaps, aes(date, temp, color=factor(season)))+
+ geom_point() +
+ scale_color_manual(values=c("dodgerblue4", "darkolivegreen4",
+ "darkorchid3", "goldenrod1"))
 
 
 
 
> library(ggthemes)
> ggplot(nmmaps, aes(date, temp, color=factor(season)))+
+ geom_point() +
+ scale_colour_tableau()
 
 
 
 
 
> ggplot(nmmaps, aes(date, temp, color=o3))+geom_point()+
+ scale_color_gradient(low="darkkhaki", high="darkgreen")
> mid<-mean(nmmaps$o3)
> ggplot(nmmaps, aes(date, temp, color=o3))+geom_point()+
+ scale_color_gradient2(midpoint=mid,
+ low="blue", mid="white", high="red" )
 
 
> library(grid)
>
> my_grob = grobTree(textGrob("This text stays in place!", x=0.1, y=0.95,
hjust=0,
+ gp=gpar(col="blue", fontsize=12, fontface="it
alic")))
>
> ggplot(nmmaps, aes(temp, o3))+geom_point(color="firebrick")+facet_wrap(~s
eason, scales="free")+
+ annotation_custom(my_grob)
 
 
 
> g<-ggplot(nmmaps, aes(x=season, y=o3))
> g+geom_jitter(alpha=0.5, aes(color=season),position = position_jitter(wid
th = .2))
> g+geom_violin(alpha=0.5, color="gray")
> g+geom_violin(alpha=0.5, color="gray")+geom_jitter(alpha=0.5, aes(color=s
eason),
+ position = position_ji
tter(width = 0.1))+coord_flip()
> nmmaps$o3run<-as.numeric(filter(nmmaps$o3, rep(1/30,30), sides=2))
> ggplot(nmmaps, aes(date, o3run))+geom_line(color="lightpink4", lwd=1)
> ggplot(nmmaps, aes(date, o3run))+geom_ribbon(aes(ymin=0, ymax=o3run), fil
l="lightpink3", color="lightpink3")+
+ geom_line(color="lightpink4", lwd=1)
> ggplot(nmmaps, aes(date, temp))+
+ geom_point(color="grey")+
+ stat_smooth(method="gam", formula=y~s(x,k=10), col="darkolivegreen2",
se=FALSE, size=1)+
+ stat_smooth(method="gam", formula=y~s(x,k=30), col="red", se=FALSE, s
ize=1)+
+ stat_smooth(method="gam", formula=y~s(x,k=500), col="dodgerblue4", se
=FALSE, size=1)
Examples:
> library(plotly)
> library(geometry)
>
> g <- expand.grid(
+ u = seq(0, 2 * pi, length.out = 24),
+ v = seq(-1, 1, length.out = 8)
+ )
> tp <- 1 + 0.5 * g$v * cos(g$u / 2)
> m <- matrix(
+ c(tp * cos(g$u), tp * sin(g$u), 0.5 * g$v * sin(g$u / 2)),
+ ncol = 3, dimnames = list(NULL, c("x", "y", "z"))
+ )
>
> # the key though is running delaunayn on g rather than m
> d <- delaunayn(g)
> td <- t(d)
> # but using m for plotting rather than the 2d g
>
> # define layout options
> axs <- list(
+ backgroundcolor="rgb(230,230,230)",
+ gridcolor="rgb(255,255,255)",
+ showbackground=TRUE,
+ zerolinecolor="rgb(255,255,255"
+ )
>
> # now figure out the colormap
> # start by determining the mean of z for each row
> # of the Delaunay vertices
> zmean <- apply(d, MARGIN=1, function(row){mean(m[row,3])})
>
> library(scales)
> # result will be slighlty different
> # since colour_ramp uses CIELAB instead of RGB
> # could use colorRamp for exact replication
> facecolor = colour_ramp(
+ brewer_pal(palette="RdBu")(9)
+ )(rescale(x=zmean))
>
>
> plot_ly(
+ x = m[, 1], y = m[, 2], z = m[, 3],
+ # JavaScript is 0 based index so subtract 1
+ i = d[, 1]-1, j = d[, 2]-1, k = d[, 3]-1,
+ facecolor = facecolor,
+ type = "mesh3d"
+ ) %>%
+ layout(
+ title="Moebius band triangulation",
+ scene=list(xaxis=axs,yaxis=axs,zaxis=axs),
+ aspectratio=list(x=1,y=1,z=0.5)
+ )
 
 
Example:
 
n <- 12
h <- 1/(n-1)
r = seq(h, 1, length.out=n)
theta = seq(0, 2*pi, length.out=36)
g <- expand.grid(r=r, theta=theta)
x <- c(g$r * cos(g$theta),0)
y <- c(g$r * sin(g$theta),0)
z <- sin(x*y)
m <- matrix(
c(x,y,z),
ncol = 3,
dimnames = list(NULL, c("x", "y", "z"))
)
tri <- delaunayn(m[,1:2])
# now figure out the colormap
zmean <- apply(tri,MARGIN=1,function(row){mean(m[row,3])})
library(scales)
library(rje)
facecolor = colour_ramp(
cubeHelix(12)
)(rescale(x=zmean))
plot_ly(
x=x, y=y, z=z,
i=tri[,1]-1, j=tri[,2]-1, k=tri[,3]-1,
facecolor=facecolor,
type="mesh3d"
) %>%
layout(
title="Triangulated surface",
scene=list(
xaxis=axs,
yaxis=axs,
zaxis=axs,
camera=list(
eye=list(x=1.75,y=-0.7,z=0.75)
)
),
aspectratio=list(x=1,y=1,z=0.5)
)
Example:
Code:
> library(geomorph)
> plyFile <- 'http://people.sc.fsu.edu/~jburkardt/data/ply/chopper.ply'
> dest <- basename(plyFile)
> if (!file.exists(dest)) {
+ download.file(plyFile, dest)
+ }
>
> mesh <- read.ply(dest)
> # see getS3method("shade3d", "mesh3d") for details on how to plot
>
> # plot point cloud
> x <- mesh$vb["xpts",]
> y <- mesh$vb["ypts",]
> z <- mesh$vb["zpts",]
> m <- matrix(c(x,y,z), ncol=3, dimnames=list(NULL,c("x","y","z")))
>
> # now figure out the colormap
> zmean <- apply(t(mesh$it),MARGIN=1,function(row){mean(m[row,3])})
>
> library(scales)
> facecolor = colour_ramp(
+ brewer_pal(palette="RdBu")(9)
+ )(rescale(x=zmean))
>
> plot_ly(
+ x = x, y = y, z = z,
+ i = mesh$it[1,]-1, j = mesh$it[2,]-1, k = mesh$it[3,]-1,
+ facecolor = facecolor,
+ type = "mesh3d"
+ )
>
Subplot example:
> library(plotly)
> p <- subplot(
+ plot_ly(economics, x = date, y = uempmed),
+ plot_ly(economics, x = date, y = unemploy),
+ margin = 0.05,
+ nrows=2
+ ) %>% layout(showlegend = FALSE)
> p
Some R Examples[R table and Graphics] -Advanced Data Visualization in R (Some Examples)
Example:
> data(iris)
> iris$id <- as.integer(iris$Species)
> p <- plot_ly(iris, x = Petal.Length, y = Petal.Width, group = Species,
+ xaxis = paste0("x", id), mode = "markers")
> p <- plotly_build(subplot(p))
> p$filename <- "overwrite_subplot"
> p
Example:
> library(plotly)
> df <- read.csv('https://raw.githubusercontent.com/plotly/datasets/master/
1962_2006_walmart_store_openings.csv')
>
> # common map properties
> g <- list(scope = 'usa', showland = T, landcolor = toRGB("gray90"), showc
ountries = F, subunitcolor = toRGB("white"))
>
> # year text labels
> yrs <- unique(df$YEAR)
> id <- seq_along(yrs)
> df2 <- data.frame(
+ YEAR = yrs,
+ id = id
+ )
>
> # id for anchoring traces on different plots
> df$id <- as.integer(factor(df$YEAR))
>
> p <- plot_ly(df, type = 'scattergeo', lon = LON, lat = LAT, group = YEAR,
+ geo = paste0("geo", id),
+ showlegend = F, marker = list(color = toRGB("blue"), opacity
= 0.5)) %>%
+ add_trace(lon = -78, lat = 47, mode = 'text', group = YEAR,
+ geo = paste0("geo", id),
+ text = YEAR, data = df2) %>%
+ layout(title = 'New Walmart Stores per year 1962-2006<br> Source: <a
href="http://www.econ.umn.edu/~holmes/data/WalMart/index.html">University o
f Minnesota</a>',
+ geo = g,
+ autosize = F,
+ width = 1000,
+ height = 900,
+ hovermode = F)
>
> p <- subplot(p, nrows = 9)
> p
Example:
> library(plotly)
> p <- plot_ly(plotly::mic, r = r, t = t, color = nms, mode =
"lines")
> layout(p, title = "Mic Patterns", orientation = -90)
Example: Waterfall Chart
> library(ggplot2)
> library(reshape2)
>
> data <- textConnection("Step,Value,Change
+ Start,100
+ Step 1,80,20
+ Step 2,70,10
+ Step 3,62,8
+ Step 4,52,10
+ Final result,52
+ ")
> data <- read.csv(data, h=T)
>
> data$id <- 1:nrow(data)
>
> naChange <- is.na(data$Change)
> data[naChange,]$Change <- data[is.na(data$Change),]$Value
> data[naChange,]$Value <- 0
>
> data$start <- data$Value
> data$end <- data$start+data$Change
>
> p <- ggplot(data, aes(Step, fill = "blue"))
> p + geom_rect(aes(x = Step, xmin = id - 0.45, xmax = id + 0.45,
+ ymin = start, ymax = end)) +
+ scale_fill_identity("Metric Name") +
+ labs(x="X Label", y="Y Label", title="Waterfall Chart Example")
Example: Basic Table.
library(xtable)
fdir <- "C:/Users/lenovo/Documents/Calisma/Yeni klasör"
data <- textConnection("Name,A,B,C,D,E
Volkan OBAN,0,2,4,6,8
Volkan OBAN,3,5,7,9,11
Volkan OBAN,11,13,15,17,19
Volkan OBAN,20,22,24,26,28
Volkan OBAN,1,2,3,4,5
VOLKAN OBAN,1,5,25,125,625
VOLKAN OBAN,0,-1,-2,-3,0
VOLKAN OBAN,2,4,6,8,10")
data <- read.csv(data, h=T)
table_as_html <- print(xtable(data), type="html", print.results = FALSE)
table_as_latex <- print(xtable(data), print.results = FALSE)
cat(table_as_html, file=paste(fdir, "BasicTable.html", sep="/"))
cat(table_as_latex, file=paste(fdir, "BasicTable.tex", sep="/"))
Ad

Recommended

ggplot2 extensions-ggtree.
ggplot2 extensions-ggtree.
Dr. Volkan OBAN
 
Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.
Dr. Volkan OBAN
 
Basic Calculus in R.
Basic Calculus in R.
Dr. Volkan OBAN
 
Advanced Data Visualization Examples with R-Part II
Advanced Data Visualization Examples with R-Part II
Dr. Volkan OBAN
 
imager package in R and examples..
imager package in R and examples..
Dr. Volkan OBAN
 
Genomic Graphics
Genomic Graphics
Dr. Volkan OBAN
 
ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions
Dr. Volkan OBAN
 
R-ggplot2 package Examples
R-ggplot2 package Examples
Dr. Volkan OBAN
 
CLUSTERGRAM
CLUSTERGRAM
Dr. Volkan OBAN
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
Dr. Volkan OBAN
 
RHadoop の紹介
RHadoop の紹介
Hidekazu Tanaka
 
R meets Hadoop
R meets Hadoop
Hidekazu Tanaka
 
Introduction to R
Introduction to R
Sander Kieft
 
Oh Composable World!
Oh Composable World!
Brian Lonsdorf
 
Script jantung copy
Script jantung copy
Nurwahidah Abidin
 
Palestra sobre Collections com Python
Palestra sobre Collections com Python
pugpe
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,on
Dr. Volkan OBAN
 
Let’s Talk About Ruby
Let’s Talk About Ruby
Ian Bishop
 
Geolocation on Rails
Geolocation on Rails
nebirhos
 
Data visualization using the grammar of graphics
Data visualization using the grammar of graphics
Rupak Roy
 
Dplyr and Plyr
Dplyr and Plyr
Paul Richards
 
Day 4a iteration and functions.pptx
Day 4a iteration and functions.pptx
Adrien Melquiond
 
PLOTCON NYC: Behind Every Great Plot There's a Great Deal of Wrangling
PLOTCON NYC: Behind Every Great Plot There's a Great Deal of Wrangling
Plotly
 
Day 4b iteration and functions for-loops.pptx
Day 4b iteration and functions for-loops.pptx
Adrien Melquiond
 
Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2
Rupak Roy
 
Geo Spatial Plot using R
Geo Spatial Plot using R
Rupak Roy
 
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
Dr. Volkan OBAN
 
Numpy python cheat_sheet
Numpy python cheat_sheet
Nishant Upadhyay
 
R forecasting Example
R forecasting Example
Dr. Volkan OBAN
 
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs
Dr. Volkan OBAN
 

More Related Content

What's hot (20)

CLUSTERGRAM
CLUSTERGRAM
Dr. Volkan OBAN
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
Dr. Volkan OBAN
 
RHadoop の紹介
RHadoop の紹介
Hidekazu Tanaka
 
R meets Hadoop
R meets Hadoop
Hidekazu Tanaka
 
Introduction to R
Introduction to R
Sander Kieft
 
Oh Composable World!
Oh Composable World!
Brian Lonsdorf
 
Script jantung copy
Script jantung copy
Nurwahidah Abidin
 
Palestra sobre Collections com Python
Palestra sobre Collections com Python
pugpe
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,on
Dr. Volkan OBAN
 
Let’s Talk About Ruby
Let’s Talk About Ruby
Ian Bishop
 
Geolocation on Rails
Geolocation on Rails
nebirhos
 
Data visualization using the grammar of graphics
Data visualization using the grammar of graphics
Rupak Roy
 
Dplyr and Plyr
Dplyr and Plyr
Paul Richards
 
Day 4a iteration and functions.pptx
Day 4a iteration and functions.pptx
Adrien Melquiond
 
PLOTCON NYC: Behind Every Great Plot There's a Great Deal of Wrangling
PLOTCON NYC: Behind Every Great Plot There's a Great Deal of Wrangling
Plotly
 
Day 4b iteration and functions for-loops.pptx
Day 4b iteration and functions for-loops.pptx
Adrien Melquiond
 
Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2
Rupak Roy
 
Geo Spatial Plot using R
Geo Spatial Plot using R
Rupak Roy
 
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
Dr. Volkan OBAN
 
Numpy python cheat_sheet
Numpy python cheat_sheet
Nishant Upadhyay
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
Dr. Volkan OBAN
 
Palestra sobre Collections com Python
Palestra sobre Collections com Python
pugpe
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,on
Dr. Volkan OBAN
 
Let’s Talk About Ruby
Let’s Talk About Ruby
Ian Bishop
 
Geolocation on Rails
Geolocation on Rails
nebirhos
 
Data visualization using the grammar of graphics
Data visualization using the grammar of graphics
Rupak Roy
 
Day 4a iteration and functions.pptx
Day 4a iteration and functions.pptx
Adrien Melquiond
 
PLOTCON NYC: Behind Every Great Plot There's a Great Deal of Wrangling
PLOTCON NYC: Behind Every Great Plot There's a Great Deal of Wrangling
Plotly
 
Day 4b iteration and functions for-loops.pptx
Day 4b iteration and functions for-loops.pptx
Adrien Melquiond
 
Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2
Rupak Roy
 
Geo Spatial Plot using R
Geo Spatial Plot using R
Rupak Roy
 
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
BOXPLOT EXAMPLES in R And An Example for BEESWARM:
Dr. Volkan OBAN
 

Viewers also liked (15)

R forecasting Example
R forecasting Example
Dr. Volkan OBAN
 
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs
Dr. Volkan OBAN
 
treemap package in R and examples.
treemap package in R and examples.
Dr. Volkan OBAN
 
A Shiny Example-- R
A Shiny Example-- R
Dr. Volkan OBAN
 
The Building Block of Calculus - Chapter 2 Derivatives
The Building Block of Calculus - Chapter 2 Derivatives
Tenri Ashari Wanahari
 
Green chemistry - english version
Green chemistry - english version
classe4ach
 
Application of derivatives
Application of derivatives
Seyid Kadher
 
Naive Bayes Example using R
Naive Bayes Example using R
Dr. Volkan OBAN
 
Differentiation powerpoint for tuesday pd
Differentiation powerpoint for tuesday pd
mclaringbold
 
lecture1 introduction to computer graphics(Computer graphics tutorials)
lecture1 introduction to computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
introduction-to-numerical-methods-in-chemical-engineering
introduction-to-numerical-methods-in-chemical-engineering
Talal Ashraf
 
Chemical reaction engineering handbook of solved problems
Chemical reaction engineering handbook of solved problems
Juan Monroy
 
Lesson 2: Vectors and the Dot Product
Lesson 2: Vectors and the Dot Product
Matthew Leingang
 
Eclipse 100 - Petroleum reservoir simulation course
Eclipse 100 - Petroleum reservoir simulation course
Mohammad Massah
 
IT101 lecture1 and 2
IT101 lecture1 and 2
Khizer Aslam
 
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs
Dr. Volkan OBAN
 
treemap package in R and examples.
treemap package in R and examples.
Dr. Volkan OBAN
 
The Building Block of Calculus - Chapter 2 Derivatives
The Building Block of Calculus - Chapter 2 Derivatives
Tenri Ashari Wanahari
 
Green chemistry - english version
Green chemistry - english version
classe4ach
 
Application of derivatives
Application of derivatives
Seyid Kadher
 
Naive Bayes Example using R
Naive Bayes Example using R
Dr. Volkan OBAN
 
Differentiation powerpoint for tuesday pd
Differentiation powerpoint for tuesday pd
mclaringbold
 
introduction-to-numerical-methods-in-chemical-engineering
introduction-to-numerical-methods-in-chemical-engineering
Talal Ashraf
 
Chemical reaction engineering handbook of solved problems
Chemical reaction engineering handbook of solved problems
Juan Monroy
 
Lesson 2: Vectors and the Dot Product
Lesson 2: Vectors and the Dot Product
Matthew Leingang
 
Eclipse 100 - Petroleum reservoir simulation course
Eclipse 100 - Petroleum reservoir simulation course
Mohammad Massah
 
IT101 lecture1 and 2
IT101 lecture1 and 2
Khizer Aslam
 
Ad

Similar to Some R Examples[R table and Graphics] -Advanced Data Visualization in R (Some Examples) (20)

Data visualization-2.1
Data visualization-2.1
RenukaRajmohan
 
Data Visualization with ggplot2.pdf
Data Visualization with ggplot2.pdf
CarlosTrujillo199971
 
VISIALIZACION DE DATA.pdf
VISIALIZACION DE DATA.pdf
Ivan Bautista Fuentes
 
R workshop iii -- 3 hours to learn ggplot2 series
R workshop iii -- 3 hours to learn ggplot2 series
Vivian S. Zhang
 
data-visualization.pdf
data-visualization.pdf
Juan José Rivas
 
Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Paul Richards
 
Graphics in R
Graphics in R
Kamal Gupta Roy
 
Ggplot2 cheatsheet-2.1
Ggplot2 cheatsheet-2.1
Dieudonne Nahigombeye
 
Download full ebook of Datacamp Ggplot2 Cheatsheet Itebooks instant download pdf
Download full ebook of Datacamp Ggplot2 Cheatsheet Itebooks instant download pdf
miatalafeer
 
NUTS AND SECTORAL LOANS DEFAULT CHART OF TURKEY: Graphical Data-Mining Analys...
NUTS AND SECTORAL LOANS DEFAULT CHART OF TURKEY: Graphical Data-Mining Analys...
Fatma ÇINAR
 
Ggplot2 ch2
Ggplot2 ch2
heba_ahmad
 
Ggplot
Ggplot
Jhojan Diaz Roa
 
RBootcamp Day 4
RBootcamp Day 4
Olga Scrivner
 
ggplot2: An Extensible Platform for Publication-quality Graphics
ggplot2: An Extensible Platform for Publication-quality Graphics
Claus Wilke
 
R Visualization Assignment
R Visualization Assignment
Vassilis Kapatsoulias
 
Q plot tutorial
Q plot tutorial
Abhik Seal
 
Broom: Converting Statistical Models to Tidy Data Frames
Broom: Converting Statistical Models to Tidy Data Frames
Work-Bench
 
Stata cheat sheet: Data visualization
Stata cheat sheet: Data visualization
Laura Hughes
 
How to combine interpolation and regression graphs in R
How to combine interpolation and regression graphs in R
DougLoqa
 
Table of Useful R commands.
Table of Useful R commands.
Dr. Volkan OBAN
 
Data visualization-2.1
Data visualization-2.1
RenukaRajmohan
 
Data Visualization with ggplot2.pdf
Data Visualization with ggplot2.pdf
CarlosTrujillo199971
 
R workshop iii -- 3 hours to learn ggplot2 series
R workshop iii -- 3 hours to learn ggplot2 series
Vivian S. Zhang
 
Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Intro to ggplot2 - Sheffield R Users Group, Feb 2015
Paul Richards
 
Download full ebook of Datacamp Ggplot2 Cheatsheet Itebooks instant download pdf
Download full ebook of Datacamp Ggplot2 Cheatsheet Itebooks instant download pdf
miatalafeer
 
NUTS AND SECTORAL LOANS DEFAULT CHART OF TURKEY: Graphical Data-Mining Analys...
NUTS AND SECTORAL LOANS DEFAULT CHART OF TURKEY: Graphical Data-Mining Analys...
Fatma ÇINAR
 
ggplot2: An Extensible Platform for Publication-quality Graphics
ggplot2: An Extensible Platform for Publication-quality Graphics
Claus Wilke
 
Q plot tutorial
Q plot tutorial
Abhik Seal
 
Broom: Converting Statistical Models to Tidy Data Frames
Broom: Converting Statistical Models to Tidy Data Frames
Work-Bench
 
Stata cheat sheet: Data visualization
Stata cheat sheet: Data visualization
Laura Hughes
 
How to combine interpolation and regression graphs in R
How to combine interpolation and regression graphs in R
DougLoqa
 
Table of Useful R commands.
Table of Useful R commands.
Dr. Volkan OBAN
 
Ad

More from Dr. Volkan OBAN (20)

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 - Example
Dr. Volkan OBAN
 
Object detection with Python
Object detection with Python
Dr. Volkan OBAN
 
Python - 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 - 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 ...
Dr. Volkan OBAN
 
k-means Clustering in Python
k-means Clustering in Python
Dr. Volkan OBAN
 
k-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 Making
Dr. Volkan OBAN
 
Scikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-Python
Dr. Volkan OBAN
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet
Dr. Volkan OBAN
 
Pandas,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 example
Dr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
Dr. Volkan OBAN
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)
Dr. Volkan OBAN
 
Mosaic plot in R.
Mosaic plot in R.
Dr. Volkan OBAN
 
R-Data table Cheat Sheet
R-Data table Cheat Sheet
Dr. Volkan OBAN
 
Rcommands-for those who interested in R.
Rcommands-for those who interested in R.
Dr. Volkan OBAN
 
Leaflet package in R-Example
Leaflet package in R-Example
Dr. Volkan OBAN
 
R Data Visualization-Spatial data and Maps in R: Using R as a GIS
R Data Visualization-Spatial data and Maps in R: Using R as a GIS
Dr. Volkan OBAN
 
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 - Example
Dr. Volkan OBAN
 
Object detection with Python
Object detection with Python
Dr. Volkan OBAN
 
Python - 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 - 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 ...
Dr. Volkan OBAN
 
k-means Clustering in Python
k-means Clustering in Python
Dr. Volkan OBAN
 
k-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 Making
Dr. Volkan OBAN
 
Scikit-learn Cheatsheet-Python
Scikit-learn Cheatsheet-Python
Dr. Volkan OBAN
 
Python Pandas for Data Science cheatsheet
Python Pandas for Data Science cheatsheet
Dr. Volkan OBAN
 
Pandas,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 example
Dr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
Dr. Volkan OBAN
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)
Dr. Volkan OBAN
 
R-Data table Cheat Sheet
R-Data table Cheat Sheet
Dr. Volkan OBAN
 
Rcommands-for those who interested in R.
Rcommands-for those who interested in R.
Dr. Volkan OBAN
 
Leaflet package in R-Example
Leaflet package in R-Example
Dr. Volkan OBAN
 
R Data Visualization-Spatial data and Maps in R: Using R as a GIS
R Data Visualization-Spatial data and Maps in R: Using R as a GIS
Dr. Volkan OBAN
 

Recently uploaded (20)

Residential Zone 4 for industrial village
Residential Zone 4 for industrial village
MdYasinArafat13
 
Predicting Titanic Survival Presentation
Predicting Titanic Survival Presentation
praxyfarhana
 
PPT2 W1L2.pptx.........................................
PPT2 W1L2.pptx.........................................
palicteronalyn26
 
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
Taqyea
 
Mynd company all details what they are doing a
Mynd company all details what they are doing a
AniketKadam40952
 
NASA ESE Study Results v4 05.29.2020.pptx
NASA ESE Study Results v4 05.29.2020.pptx
CiroAlejandroCamacho
 
Allotted-MBBS-Student-list-batch-2021.pdf
Allotted-MBBS-Student-list-batch-2021.pdf
subhansaifi0603
 
All the DataOps, all the paradigms .
All the DataOps, all the paradigms .
Lars Albertsson
 
Flextronics Employee Safety Data-Project-2.pptx
Flextronics Employee Safety Data-Project-2.pptx
kilarihemadri
 
Model Evaluation & Visualisation part of a series of intro modules for data ...
Model Evaluation & Visualisation part of a series of intro modules for data ...
brandonlee626749
 
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Mahmoud Shoush
 
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
jed P
 
Shifting Focus on AI: How it Can Make a Positive Difference
Shifting Focus on AI: How it Can Make a Positive Difference
1508 A/S
 
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
taqyed
 
美国毕业证范本中华盛顿大学学位证书CWU学生卡购买
美国毕业证范本中华盛顿大学学位证书CWU学生卡购买
Taqyea
 
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
 
最新版意大利米兰大学毕业证(UNIMI毕业证书)原版定制
最新版意大利米兰大学毕业证(UNIMI毕业证书)原版定制
taqyea
 
Boost Business Efficiency with Professional Data Entry Services
Boost Business Efficiency with Professional Data Entry Services
eloiacs eloiacs
 
25 items quiz for practical research 1 in grade 11
25 items quiz for practical research 1 in grade 11
leamaydayaganon81
 
RESEARCH-FINAL-GROUP-3, about the final .pptx
RESEARCH-FINAL-GROUP-3, about the final .pptx
gwapokoha1
 
Residential Zone 4 for industrial village
Residential Zone 4 for industrial village
MdYasinArafat13
 
Predicting Titanic Survival Presentation
Predicting Titanic Survival Presentation
praxyfarhana
 
PPT2 W1L2.pptx.........................................
PPT2 W1L2.pptx.........................................
palicteronalyn26
 
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
Taqyea
 
Mynd company all details what they are doing a
Mynd company all details what they are doing a
AniketKadam40952
 
NASA ESE Study Results v4 05.29.2020.pptx
NASA ESE Study Results v4 05.29.2020.pptx
CiroAlejandroCamacho
 
Allotted-MBBS-Student-list-batch-2021.pdf
Allotted-MBBS-Student-list-batch-2021.pdf
subhansaifi0603
 
All the DataOps, all the paradigms .
All the DataOps, all the paradigms .
Lars Albertsson
 
Flextronics Employee Safety Data-Project-2.pptx
Flextronics Employee Safety Data-Project-2.pptx
kilarihemadri
 
Model Evaluation & Visualisation part of a series of intro modules for data ...
Model Evaluation & Visualisation part of a series of intro modules for data ...
brandonlee626749
 
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Prescriptive Process Monitoring Under Uncertainty and Resource Constraints: A...
Mahmoud Shoush
 
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
jed P
 
Shifting Focus on AI: How it Can Make a Positive Difference
Shifting Focus on AI: How it Can Make a Positive Difference
1508 A/S
 
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
英国毕业证范本利物浦约翰摩尔斯大学成绩单底纹防伪LJMU学生证办理学历认证
taqyed
 
美国毕业证范本中华盛顿大学学位证书CWU学生卡购买
美国毕业证范本中华盛顿大学学位证书CWU学生卡购买
Taqyea
 
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
 
最新版意大利米兰大学毕业证(UNIMI毕业证书)原版定制
最新版意大利米兰大学毕业证(UNIMI毕业证书)原版定制
taqyea
 
Boost Business Efficiency with Professional Data Entry Services
Boost Business Efficiency with Professional Data Entry Services
eloiacs eloiacs
 
25 items quiz for practical research 1 in grade 11
25 items quiz for practical research 1 in grade 11
leamaydayaganon81
 
RESEARCH-FINAL-GROUP-3, about the final .pptx
RESEARCH-FINAL-GROUP-3, about the final .pptx
gwapokoha1
 

Some R Examples[R table and Graphics] -Advanced Data Visualization in R (Some Examples)