Prepared by Volkan OBAN
Treemap Examples in R
Treemap Package.
Reference:https://cran.r-project.org/web/packages/treemap/treemap.pdf
1. > data(GNI2014)
> treemap(GNI2014,
index=c("continent","iso3"),
vSize="population",
vColor="GNI",
type="value")
2- >data(business)
> treemap(business,
index=c("NACE1","NACE2","NACE3"),
vSize="turnover",
type="depth")
3- > business<- transform(business,data.available =factor(!is.na(turnover)),x = 1)
> treemap(business,
index=c("NACE1","NACE2"),
vSize="x",
vColor="data.available",
type="categorical")
4- > business$color<- rainbow(nlevels(business$NACE2))[business$NACE2]
> treemap(business,
index=c("NACE1","NACE2"),
vSize="x",
vColor="color",
type="color")
5- treemap(business,
index=c("NACE1","NACE2"),
vSize="employees",
fontsize.labels=c(12,8),
align.labels=list(c("center","center"),c("left","top")),lowerbound.cex.labels=1)
6-treemap(business,
index=c("NACE1","NACE2"),
vSize="employees",
vColor="employees.growth",
type="value",
palette="-RdGy",
range=c(-20000,30000))
7-> treemap(business,
index=c("NACE1","NACE2"),
vSize="employees",
vColor="employees.growth",
type="value",
palette="RdYlGn",
range=c(-20000,30000), # this isshownin the legend
mapping=c(-30000, 10000, 40000))
Reference:https://cran.r-project.org/web/packages/treemap/treemap.pdf

More Related Content

PPTX
Set Theory and its Applications
PPT
Gregory mankiw macroeconomic 7th edition chapter (11)
PPTX
Googlevis examples
DOCX
Naive Bayes Example using R
DOCX
ggplot2 extensions-ggtree.
PPTX
HDFS metadata (fsimage and edits) difference CDH3 and CDH4
PPTX
Scaling HDFS with a Strongly Consistent Relational Model for Metadata
DOCX
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs
Set Theory and its Applications
Gregory mankiw macroeconomic 7th edition chapter (11)
Googlevis examples
Naive Bayes Example using R
ggplot2 extensions-ggtree.
HDFS metadata (fsimage and edits) difference CDH3 and CDH4
Scaling HDFS with a Strongly Consistent Relational Model for Metadata
ggExtra Package-ggMarginal and Example -Shiny and Shinyjs

More from Dr. Volkan OBAN (20)

PDF
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
PDF
Covid19py Python Package - Example
PDF
Object detection with Python
PDF
Python - Rastgele Orman(Random Forest) Parametreleri
DOCX
Linear Programming wi̇th R - Examples
DOCX
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
DOCX
k-means Clustering in Python
DOCX
R forecasting Example
DOCX
k-means Clustering and Custergram with R
PDF
Data Science and its Relationship to Big Data and Data-Driven Decision Making
DOCX
Data Visualization with R.ggplot2 and its extensions examples.
PDF
Scikit-learn Cheatsheet-Python
PDF
Python Pandas for Data Science cheatsheet
PDF
Pandas,scipy,numpy cheatsheet
PPTX
ReporteRs package in R. forming powerpoint documents-an example
PPTX
ReporteRs package in R. forming powerpoint documents-an example
DOCX
R-ggplot2 package Examples
DOCX
R Machine Learning packages( generally used)
DOCX
Mosaic plot in R.
DOCX
imager package in R and examples..
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Covid19py Python Package - Example
Object detection with Python
Python - Rastgele Orman(Random Forest) Parametreleri
Linear Programming wi̇th R - Examples
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
k-means Clustering in Python
R forecasting Example
k-means Clustering and Custergram with R
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Visualization with R.ggplot2 and its extensions examples.
Scikit-learn Cheatsheet-Python
Python Pandas for Data Science cheatsheet
Pandas,scipy,numpy cheatsheet
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
R-ggplot2 package Examples
R Machine Learning packages( generally used)
Mosaic plot in R.
imager package in R and examples..
Ad

Recently uploaded (20)

PPTX
Chapter security of computer_8_v8.1.pptx
PPTX
DATA MODELING, data model concepts, types of data concepts
PDF
©️ 01_Algorithm for Microsoft New Product Launch - handling web site - by Ale...
PPTX
PPT for Diseases (1)-2, types of diseases.pptx
PDF
Session 11 - Data Visualization Storytelling (2).pdf
PDF
technical specifications solar ear 2025.
PPTX
ai agent creaction with langgraph_presentation_
PPTX
Statisticsccdxghbbnhhbvvvvvvvvvv. Dxcvvvhhbdzvbsdvvbbvv ccc
PDF
book-34714 (2).pdfhjkkljgfdssawtjiiiiiujj
PPTX
ifsm.pptx, institutional food service management
PDF
REPORT CARD OF GRADE 2 2025-2026 MATATAG
PPTX
langchainpptforbeginners_easy_explanation.pptx
PPTX
Hushh.ai: Your Personal Data, Your Business
PDF
Concepts of Database Management, 10th Edition by Lisa Friedrichsen Test Bank.pdf
PPTX
Stats annual compiled ipd opd ot br 2024
PPTX
865628565-Pertemuan-2-chapter-03-NUMERICAL-MEASURES.pptx
PDF
2025-08 San Francisco FinOps Meetup: Tiering, Intelligently.
PPT
dsa Lec-1 Introduction FOR THE STUDENTS OF bscs
PPTX
transformers as a tool for understanding advance algorithms in deep learning
PDF
General category merit rank list for neet pg
Chapter security of computer_8_v8.1.pptx
DATA MODELING, data model concepts, types of data concepts
©️ 01_Algorithm for Microsoft New Product Launch - handling web site - by Ale...
PPT for Diseases (1)-2, types of diseases.pptx
Session 11 - Data Visualization Storytelling (2).pdf
technical specifications solar ear 2025.
ai agent creaction with langgraph_presentation_
Statisticsccdxghbbnhhbvvvvvvvvvv. Dxcvvvhhbdzvbsdvvbbvv ccc
book-34714 (2).pdfhjkkljgfdssawtjiiiiiujj
ifsm.pptx, institutional food service management
REPORT CARD OF GRADE 2 2025-2026 MATATAG
langchainpptforbeginners_easy_explanation.pptx
Hushh.ai: Your Personal Data, Your Business
Concepts of Database Management, 10th Edition by Lisa Friedrichsen Test Bank.pdf
Stats annual compiled ipd opd ot br 2024
865628565-Pertemuan-2-chapter-03-NUMERICAL-MEASURES.pptx
2025-08 San Francisco FinOps Meetup: Tiering, Intelligently.
dsa Lec-1 Introduction FOR THE STUDENTS OF bscs
transformers as a tool for understanding advance algorithms in deep learning
General category merit rank list for neet pg
Ad

treemap package in R and examples.