SlideShare a Scribd company logo
1 of 13
Prepared by Volkan OBAN
Spatial data and Maps in R: Using R as
a GIS
Reference: https://pakillo.github.io/R-GIS-tutorial/
Basic packages
library(sp) # classes for spatial data
library(raster) # grids, rasters
library(rasterVis) # raster visualization
library(maptools)
library(rgeos)
library(dismo)
library(googleVis)
library(rworldmap)
library(RgoogleMaps)
library(dismo)
mycountry <- gmap("Turkey")
plot(mycountry)
>mycountry <- gmap("Turkey", type = "satellite")
> plot(mycountry)
>mycountry <- gmap("Turkey", type = "satellite",exp=3)
> plot(mycountry)
library(RgoogleMaps)
> newmap <- GetMap(center = c(41.112185,29.019965), zoom = 10, destfile = "new
map.png",
+ maptype = "satellite")
Izmir
library(RgoogleMaps)
newmap <- GetMap(center = c(38.423734,27.142826), zoom = 10, destfile = "newm
ap.png",
+ maptype = "satellite")
İstanbul Boğazı-Bosphorus:
newmap1 <- GetMap(center = c(41.046018,29.033891), zoom = 10, destfile = "n
ewmap1.png", maptype = "satellite")
> tmin <- getData("worldclim", var = "tmin", res = 10) # this will downloa
d
> # global data on minimum temperature at 10' resolution
> tmin1 <- raster(paste(getwd(), "/wc10/tmin1.bil", sep = "")) # Tmin for
January
> fromDisk(tmin1)
[1] TRUE
> tmin1 <- tmin1/10 # Worldclim temperature data come in decimal degrees
> tmin1
class : RasterLayer
dimensions : 900, 2160, 1944000 (nrow, ncol, ncell)
resolution : 0.1666667, 0.1666667 (x, y)
extent : -180, 180, -60, 90 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
data source : in memory
names : tmin1
values : -54.7, 26.6 (min, max)
> plot(tmin1)
> library(gtools)
> file.remove(paste(getwd(), "/wc10/", "tmin_10m_bil.zip", sep = ""))
[1] FALSE
> list.ras <- mixedsort(list.files(paste(getwd(), "/wc10/", sep = ""), full
.names = T,
+ pattern = ".bil"))
> list.ras # I have just collected a list of the files containing monthly
temperature values
list.ras <- mixedsort(list.files(paste(getwd(), "/wc10/", sep = ""), full.names =
T, pattern = ".bil")) list.ras # I have just collected a list of the files
containing monthly temperature values
>tmin.all <- stack(list.ras)
> tmin.all
class : RasterStack
dimensions : 900, 2160, 1944000, 12 (nrow, ncol, ncell, nlayers)
resolution : 0.1666667, 0.1666667 (x, y)
extent : -180, 180, -60, 90 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
names : tmin1, tmin2, tmin3, tmin4, tmin5, tmin6, tmin7, tmin8, tmin9
, tmin10, tmin11, tmin12
min values : -547, -525, -468, -379, -225, -170, -171, -178, -192
, -302, -449, -522
max values : 266, 273, 277, 283, 295, 312, 311, 312, 300
, 268, 267, 268
> tmin.all <- tmin.all/10
> plot(tmin.all)
> elevation <- getData("alt", country = "Turkey")
> x <- terrain(elevation, opt = c("slope", "aspect"), unit = "degrees")
> plot(x)
slope <- terrain(elevation, opt = "slope")
aspect <- terrain(elevation, opt = "aspect") hill <- hillShade(slope, aspect, 40, 270)
plot(hill, col = grey(0:100/100), legend = FALSE, main = "Türkiye")
plot(elevation, col = rainbow(25, alpha = 0.35), add = TRUE)
> library(ggmap)
> library(RgoogleMaps)
> mapImageData1 <- get_map(location = c(lon =29.019442, lat =41.103783),col
or = "color",source = "google",maptype = "satellite",zoom = 17)
>
> ggmap(mapImageData1,extent = "device", ylab = "Latitude",xlab = "Longitud
e")
İTÜ (Istanbul Technical University)

More Related Content

What's hot

Dtsn devnest9
Dtsn devnest9Dtsn devnest9
Dtsn devnest9
Angus Fox
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
MongoDB
 

What's hot (19)

The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: VisualizationThe Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
 
Dtsn devnest9
Dtsn devnest9Dtsn devnest9
Dtsn devnest9
 
Semantic search within Earth Observation products databases based on automati...
Semantic search within Earth Observation products databases based on automati...Semantic search within Earth Observation products databases based on automati...
Semantic search within Earth Observation products databases based on automati...
 
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Webinar: Secrets of ClickHouse Query Performance, by Robert HodgesWebinar: Secrets of ClickHouse Query Performance, by Robert Hodges
Webinar: Secrets of ClickHouse Query Performance, by Robert Hodges
 
Three Functional Programming Technologies for Big Data
Three Functional Programming Technologies for Big DataThree Functional Programming Technologies for Big Data
Three Functional Programming Technologies for Big Data
 
Advanced R Graphics
Advanced R GraphicsAdvanced R Graphics
Advanced R Graphics
 
La R Users Group Survey Of R Graphics
La R Users Group Survey Of R GraphicsLa R Users Group Survey Of R Graphics
La R Users Group Survey Of R Graphics
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
 
Sorter
SorterSorter
Sorter
 
Coq for ML users
Coq for ML usersCoq for ML users
Coq for ML users
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
 
Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?Data warehouse or conventional database: Which is right for you?
Data warehouse or conventional database: Which is right for you?
 
Bayesian learning
Bayesian learning Bayesian learning
Bayesian learning
 
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
 
Python Coding Examples for Drive Time Analysis
Python Coding Examples for Drive Time AnalysisPython Coding Examples for Drive Time Analysis
Python Coding Examples for Drive Time Analysis
 
GeoTuple a Framework for Web Based Geo-Analytics with R and PostGIS
GeoTuple a Framework for Web Based Geo-Analytics with R and PostGISGeoTuple a Framework for Web Based Geo-Analytics with R and PostGIS
GeoTuple a Framework for Web Based Geo-Analytics with R and PostGIS
 
Ordered Record Collection
Ordered Record CollectionOrdered Record Collection
Ordered Record Collection
 
Team ElectricGo: 2013 Apache Cassandra Hackathon at McGill University
Team ElectricGo: 2013 Apache Cassandra Hackathon at McGill UniversityTeam ElectricGo: 2013 Apache Cassandra Hackathon at McGill University
Team ElectricGo: 2013 Apache Cassandra Hackathon at McGill University
 
OTTER 2017-12-03
OTTER 2017-12-03OTTER 2017-12-03
OTTER 2017-12-03
 

Similar to R Data Visualization-Spatial data and Maps in R: Using R as a GIS

Extending lifespan with Hadoop and R
Extending lifespan with Hadoop and RExtending lifespan with Hadoop and R
Extending lifespan with Hadoop and R
Radek Maciaszek
 
Climate data in r with the raster package
Climate data in r with the raster packageClimate data in r with the raster package
Climate data in r with the raster package
Alberto Labarga
 

Similar to R Data Visualization-Spatial data and Maps in R: Using R as a GIS (20)

CLUSTERGRAM
CLUSTERGRAMCLUSTERGRAM
CLUSTERGRAM
 
Spark_Documentation_Template1
Spark_Documentation_Template1Spark_Documentation_Template1
Spark_Documentation_Template1
 
Python grass
Python grassPython grass
Python grass
 
Practical data science_public
Practical data science_publicPractical data science_public
Practical data science_public
 
Genomic Graphics
Genomic GraphicsGenomic Graphics
Genomic Graphics
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
Rcommands-for those who interested in R.
Rcommands-for those who interested in R.Rcommands-for those who interested in R.
Rcommands-for those who interested in R.
 
Extending lifespan with Hadoop and R
Extending lifespan with Hadoop and RExtending lifespan with Hadoop and R
Extending lifespan with Hadoop and R
 
Haskell
HaskellHaskell
Haskell
 
Clustering and Visualisation using R programming
Clustering and Visualisation using R programmingClustering and Visualisation using R programming
Clustering and Visualisation using R programming
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul DixFlux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
 
Machine Learning in R
Machine Learning in RMachine Learning in R
Machine Learning in R
 
Using a mobile phone as a therapist - Superweek 2018
Using a mobile phone as a therapist - Superweek 2018Using a mobile phone as a therapist - Superweek 2018
Using a mobile phone as a therapist - Superweek 2018
 
Joclad 2010 d
Joclad 2010 dJoclad 2010 d
Joclad 2010 d
 
Spatial Analysis with R - the Good, the Bad, and the Pretty
Spatial Analysis with R - the Good, the Bad, and the PrettySpatial Analysis with R - the Good, the Bad, and the Pretty
Spatial Analysis with R - the Good, the Bad, and the Pretty
 
Climate data in r with the raster package
Climate data in r with the raster packageClimate data in r with the raster package
Climate data in r with the raster package
 
Using R Tool for Probability and Statistics
Using R Tool for Probability and Statistics Using R Tool for Probability and Statistics
Using R Tool for Probability and Statistics
 
PART 5: RASTER DATA
PART 5: RASTER DATAPART 5: RASTER DATA
PART 5: RASTER DATA
 
ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions ggtimeseries-->ggplot2 extensions
ggtimeseries-->ggplot2 extensions
 
imager package in R and examples..
imager package in R and examples..imager package in R and examples..
imager package in R and examples..
 

More from 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

一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理
pyhepag
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
ppy8zfkfm
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Stephen266013
 
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
ju0dztxtn
 
如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一
如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一
如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一
0uyfyq0q4
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理
pyhepag
 
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
pyhepag
 
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
pyhepag
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
cyebo
 

Recently uploaded (20)

一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
 
Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
 
Aggregations - The Elasticsearch "GROUP BY"
Aggregations - The Elasticsearch "GROUP BY"Aggregations - The Elasticsearch "GROUP BY"
Aggregations - The Elasticsearch "GROUP BY"
 
Artificial_General_Intelligence__storm_gen_article.pdf
Artificial_General_Intelligence__storm_gen_article.pdfArtificial_General_Intelligence__storm_gen_article.pdf
Artificial_General_Intelligence__storm_gen_article.pdf
 
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Call2024 Q1 Tableau User Group Leader Quarterly Call
2024 Q1 Tableau User Group Leader Quarterly Call
 
如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一
如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一
如何办理滑铁卢大学毕业证(Waterloo毕业证)成绩单本科学位证原版一比一
 
How I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonHow I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prison
 
Heaps & its operation -Max Heap, Min Heap
Heaps & its operation -Max Heap, Min  HeapHeaps & its operation -Max Heap, Min  Heap
Heaps & its operation -Max Heap, Min Heap
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理
 
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
一比一原版加利福尼亚大学尔湾分校毕业证成绩单如何办理
 
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
一比一原版(Monash毕业证书)莫纳什大学毕业证成绩单如何办理
 
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
 
AI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdfAI Imagen for data-storytelling Infographics.pdf
AI Imagen for data-storytelling Infographics.pdf
 
一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理一比一原版麦考瑞大学毕业证成绩单如何办理
一比一原版麦考瑞大学毕业证成绩单如何办理
 

R Data Visualization-Spatial data and Maps in R: Using R as a GIS

  • 1. Prepared by Volkan OBAN Spatial data and Maps in R: Using R as a GIS Reference: https://pakillo.github.io/R-GIS-tutorial/ Basic packages library(sp) # classes for spatial data library(raster) # grids, rasters library(rasterVis) # raster visualization library(maptools) library(rgeos) library(dismo) library(googleVis) library(rworldmap) library(RgoogleMaps)
  • 3. >mycountry <- gmap("Turkey", type = "satellite") > plot(mycountry)
  • 4. >mycountry <- gmap("Turkey", type = "satellite",exp=3) > plot(mycountry)
  • 5. library(RgoogleMaps) > newmap <- GetMap(center = c(41.112185,29.019965), zoom = 10, destfile = "new map.png", + maptype = "satellite")
  • 6. Izmir library(RgoogleMaps) newmap <- GetMap(center = c(38.423734,27.142826), zoom = 10, destfile = "newm ap.png", + maptype = "satellite")
  • 7. İstanbul Boğazı-Bosphorus: newmap1 <- GetMap(center = c(41.046018,29.033891), zoom = 10, destfile = "n ewmap1.png", maptype = "satellite")
  • 8. > tmin <- getData("worldclim", var = "tmin", res = 10) # this will downloa d > # global data on minimum temperature at 10' resolution > tmin1 <- raster(paste(getwd(), "/wc10/tmin1.bil", sep = "")) # Tmin for January > fromDisk(tmin1) [1] TRUE > tmin1 <- tmin1/10 # Worldclim temperature data come in decimal degrees > tmin1 class : RasterLayer dimensions : 900, 2160, 1944000 (nrow, ncol, ncell) resolution : 0.1666667, 0.1666667 (x, y) extent : -180, 180, -60, 90 (xmin, xmax, ymin, ymax) coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs data source : in memory names : tmin1 values : -54.7, 26.6 (min, max) > plot(tmin1)
  • 9. > library(gtools) > file.remove(paste(getwd(), "/wc10/", "tmin_10m_bil.zip", sep = "")) [1] FALSE > list.ras <- mixedsort(list.files(paste(getwd(), "/wc10/", sep = ""), full .names = T, + pattern = ".bil")) > list.ras # I have just collected a list of the files containing monthly temperature values list.ras <- mixedsort(list.files(paste(getwd(), "/wc10/", sep = ""), full.names = T, pattern = ".bil")) list.ras # I have just collected a list of the files containing monthly temperature values >tmin.all <- stack(list.ras) > tmin.all class : RasterStack dimensions : 900, 2160, 1944000, 12 (nrow, ncol, ncell, nlayers) resolution : 0.1666667, 0.1666667 (x, y) extent : -180, 180, -60, 90 (xmin, xmax, ymin, ymax) coord. ref. : +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs names : tmin1, tmin2, tmin3, tmin4, tmin5, tmin6, tmin7, tmin8, tmin9 , tmin10, tmin11, tmin12
  • 10. min values : -547, -525, -468, -379, -225, -170, -171, -178, -192 , -302, -449, -522 max values : 266, 273, 277, 283, 295, 312, 311, 312, 300 , 268, 267, 268 > tmin.all <- tmin.all/10 > plot(tmin.all)
  • 11. > elevation <- getData("alt", country = "Turkey") > x <- terrain(elevation, opt = c("slope", "aspect"), unit = "degrees") > plot(x)
  • 12. slope <- terrain(elevation, opt = "slope") aspect <- terrain(elevation, opt = "aspect") hill <- hillShade(slope, aspect, 40, 270) plot(hill, col = grey(0:100/100), legend = FALSE, main = "Türkiye") plot(elevation, col = rainbow(25, alpha = 0.35), add = TRUE)
  • 13. > library(ggmap) > library(RgoogleMaps) > mapImageData1 <- get_map(location = c(lon =29.019442, lat =41.103783),col or = "color",source = "google",maptype = "satellite",zoom = 17) > > ggmap(mapImageData1,extent = "device", ylab = "Latitude",xlab = "Longitud e") İTÜ (Istanbul Technical University)