Making Maps: Salamander Species in US. Read in the Data

Size: px
Start display at page:

Download "Making Maps: Salamander Species in US. Read in the Data"

Transcription

1 Anything Arc can do, R can do better OR How to lose Arc in 10 days (part 1/n) UA Summer R Workshop: Week 3 Nicholas M. Caruso Christina L. Staudhammer 14 June 2016 Making Maps: Salamander Species in US To demonstrate making maps, we will use IUCN range maps to map out the number of salamander species in the United States. These range map shapefiles, as well as many others, can be found on IUCN s website here. As with other plotting we will use the ggplot2 package, which requires the data to be in a data frame, so we must convert it before plotting. We will also be using the maptools, raster, rgeos, and rgdal, sp, and maps packages, which will likely need to be installed first. # install.packages(c('maptools','raster','rgeos','rgdal','sp','maps')) library(maptools) library(raster) library(rgeos) library(rgdal) library(sp) library(tidyr) library(dplyr) library(maps) Read in the Data We will use the readshapepoly() function and call the path to our range map shapefile. Next, we will use map() to get a reference map of the United States counties (not including Alaska or Hawaii). Because we are dealing with spatial data, we need to give our maps a projection, we will define a coordinate reference system using CRS() set the projection for the caudate shapefile. We could plot these range maps, but in their current format, they aren t very informative. caudates <- readshapepoly('e:/idrive-sync/documents/r workshop Summer 2016/CAUDATA.shp') usa <- map("county", fill=true) 1

2 albers.proj <- CRS("+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +datum=nad83 +units=m +no_defs") projection(caudates) <- albers.proj plot(caudates) 2

3 Convert Map to SpatialPolygon Before we work with these two maps, we need to convert our county USA map to a SpatialPolygon. We want to preserve the identity of the county and states polygons (for plotting), so we ll use the preserve the ID variable and give the usa map the same projection as our range map. IDs <- usa$names usa <- map2spatialpolygons(usa, IDs=IDs, proj4string=albers.proj) Number of Salamanders in Each County For this map, we want to know how many polygons falls within the boundaries of each county. This can be accomplished using sapply(), over(), geometry(). We will retrieve the geometry from our composite range map shapefile, and overlay our county map with our range map. This overlay function will return a list for every county with a vector of all of the species from our range map that are within that county (each entry of the the vector corresponds to a species). We then use sapply() to find the length of each of those vectors, convert to a dataframe and use the rownames to create a new column of county ids. counts <- sapply(over(usa, geometry(caudates), returnlist=true), length) counts.df <- as.data.frame(counts) counts.df$id <- rownames(counts.df) rownames(counts.df) <- NULL 3

4 Combine Datasets Now we can combine our dataframe of counts of number of species per county, we can join these data back into our county map data so that we can plot the county polygons. First we will convert our SpatialPolygon-class US county map into a dataframe for joining and plotting. We will then use left_join to join our count dataframe into our county maps dataframe, matching by the unique county id. states.df <- fortify(usa, region = "ID") sallys.counties <- left_join(states.df, counts.df, by='id') head(sallys.counties) ## long lat order hole piece id group ## FALSE 1 alabama,autauga alabama,autauga.1 ## FALSE 1 alabama,autauga alabama,autauga.1 ## FALSE 1 alabama,autauga alabama,autauga.1 ## FALSE 1 alabama,autauga alabama,autauga.1 ## FALSE 1 alabama,autauga alabama,autauga.1 ## FALSE 1 alabama,autauga alabama,autauga.1 ## counts ## 1 22 ## 2 22 ## 3 22 ## 4 22 ## 5 22 ##

5 Plot the map We will use the ggmap, scales, and RColorBrewer packages along with ggplot2 to map our data. First, we ll plot the new counties dataframe with counts of salamanders using geom_polygon(); our aesthetics are defined as the longitude (x), latitude (y), the county ids (group), the number of salamander species within each county (fill). The remaining changes it the map are superficial and include, adjusting the map projection, changing the fill gradient, changing the theme, legend position, appearence of the x-axis, and the labels for both axes. # install.packages(c('ggmap','scales','rcolorbrewer')) library(ggplot2) library(ggmap) library(scales) library(rcolorbrewer) ggplot() + geom_polygon(data=sallys.counties, aes(x=long, y=lat, group=id, fill=counts), color="black", size=0.25) + coord_equal() + scale_fill_gradient2(name="number of\nspecies", low="white", high='navyblue') + theme_bw() + theme(legend.position=c(0.92, 0.27), legend.background=element_rect('transparent')) + scale_x_continuous(breaks=c(-120,-100,-80), labels=c(120,100,80), expression(paste('longitude (', degree, 'W)'))) + ylab(expression(paste('latitude (', degree, 'N)'))) 5

6 50 45 Latitude ( N) Number of Species Longitude ( W) 6

7 Inset Map: Alabama Salamander Richness To demonstrate an inset map, we will visualize Alabama species richness compared to the rest of the US. First we ll filter our county map by only the state of Alabama using grepl which searches for a pattern (alabama) in our id column. Filter Data bama.rich <- sallys.counties[grepl('alabama,', sallys.counties$id),] Define Map Similarly to the US map, we will create a map of the number of salamander species in Alabama and store it. Because The scale is much smaller, we will adjust the fill gradient. Just to make it look fancy, we ll add an off-centered gray polygon to make it look like the plot has a shadow. To show a different x and y axes labels, we adjusted the x and y scale pasting the N/W directly after the number. bama.map <- ggplot() + geom_polygon(data=bama.rich, aes(x=long+0.05, y=lat-0.05, group=id), fill='gray80') + geom_polygon(data=bama.rich, aes(x=long, y=lat, group=id, fill=counts), color="black", size=0.25) + coord_equal() + scale_fill_gradient2(name="number of\nspecies", low="white", high='darkblue', midpoint=22, mid='steelblue1') + theme_bw() + scale_x_continuous(breaks=c(-88,-87,-86,-85), labels=c(paste(c(88:85), ' W', sep=''))) + scale_y_continuous(limits=c(29.8,35.25), breaks=c(seq(30, 35, 1)), labels=c(paste(seq(30, 35, 1), ' N', sep=''))) + labs(x='', y='') Define Inset We will use the states.df to plot our inset map. To define our zoomed-in map of Alabama, by plotting the state of Alabama with darker red lines. states <- map("state", fill=true, plot=false) states.df2 <- fortify(states, region='id') inset.map <- ggplot() + geom_polygon(data=states.df2, aes(long, lat, group=group), color='black', fill='white', size=0.25) + geom_polygon(data=states.df2[states.df2$region=='alabama',], aes(long, lat, group=group), color='darkred', fill='white', size=1) + coord_equal() + theme_bw() + labs(x=null, y=null) + 7

8 theme(axis.text.x=element_blank(), axis.text.y=element_blank(), axis.ticks=element_blank(), axis.title.x=element_blank()) Plot Map and Inset We will need the gridextra package to plot these two maps together. Here we can define the areas and placement for each plot. We will place the zoomed-in map in the middle of the plot, while we will place our inset map in the lower right hand corner. # install.packages('gridextra') library(gridextra) library(grid) library(gistools) grid.newpage() map.viewport <- viewport(width=1, height=1, x=0.5, y=0.5) inset.viewport <- viewport(width=0.45, height=0.55, x=0.57, y=0.3) print(bama.map, vp=map.viewport) print(inset.map, vp=inset.viewport) 8

9 35 N 34 N 33 N 32 N Number of Species N 30 N 88 W 87 W 86 W 85 W 9

10 Add Points Let s say that we randomly sampled the state of Alabama, and we want to visualize the proportion of species that we found at each site. We will use the dismo package to create the random sampling locations throughout the state. To create a random sampling of points, we need to use a raster object as the mask. We will also create a proportion species found column. Thus, when we add these data points to our previous plot we can scale the symbol size to be proportional to the proportion of species we found at that site. Random Sampling Sites library(dismo) r <- raster(ncol=200, nrow=200) extent(r) <- c(-88,-85.5, 31, 35) set.seed( ) sampling.sites <- as.data.frame(randompoints(r, 20)) sampling.sites$prop.spp.found <- runif(nrow(sampling.sites), 0.5, 1) head(sampling.sites) ## x y prop.spp.found ## ## ## ## ## ##

11 Plot Points with Proportional Symbol Size Now we can create a new map with our points, and plot it similarly as above. bama.map2 <- ggplot() + geom_polygon(data=bama.rich, aes(x=long+0.05, y=lat-0.05, group=id), fill='gray80') + geom_polygon(data=bama.rich, aes(x=long, y=lat, group=id, fill=counts), color="black", size=0.25) + geom_point(data=sampling.sites, aes(x=x, y=y, size=prop.spp.found)) + coord_equal() + scale_fill_gradient2(name="number of\nspecies", low="white", high='darkblue', midpoint=22, mid='steelblue1') + theme_bw() + scale_x_continuous(breaks=c(-88,-87,-86,-85), labels=c(paste(c(88:85), ' W', sep=''))) + scale_y_continuous(limits=c(29.8,35.25), breaks=c(seq(30, 35, 1)), labels=c(paste(seq(30, 35, 1), ' N', sep=''))) + labs(x='', y='') + scale_size(name='proportion of\nspecies Found', range=c(0.5,7)) library(grid) grid.newpage() map.viewport <- viewport(width=1, height=1, x=0.5, y=0.5) inset.viewport <- viewport(width=0.45, height=0.65, x=0.56, y=0.22) print(bama.map2, vp=map.viewport) print(inset.map, vp=inset.viewport) 11

12 35 N 34 N 33 N 32 N Number of Species Proportion of Species Found N 30 N 88 W 87 W 86 W 85 W 12

Using R as a GIS. Alan R. Pearse. 31 July 2017

Using R as a GIS. Alan R. Pearse. 31 July 2017 Using R as a GIS Alan R. Pearse 31 July 2017 Contact Email: ar.pearse@qut.edu.au Contents Data sources A note on syntax What is R? Why do GIS in R? Must-have R packages Overview of spatial data types in

More information

Package redlistr. May 11, 2018

Package redlistr. May 11, 2018 Package redlistr May 11, 2018 Title Tools for the IUCN Red List of Ecosystems and Species Version 1.0.1 A toolbox created by members of the International Union for Conservation of Nature (IUCN) Red List

More information

Spatial Ecology Lab 6: Landscape Pattern Analysis

Spatial Ecology Lab 6: Landscape Pattern Analysis Spatial Ecology Lab 6: Landscape Pattern Analysis Damian Maddalena Spring 2015 1 Introduction This week in lab we will begin to explore basic landscape metrics. We will simply calculate percent of total

More information

Advanced Plotting Di Cook, Eric Hare May 14, 2015

Advanced Plotting Di Cook, Eric Hare May 14, 2015 Advanced Plotting Di Cook, Eric Hare May 14, 2015 California Dreaming - ASA Travelling Workshop Back to the Oscars oscars

More information

ggplot2 and maps Marcin Kierczak 11/10/2016

ggplot2 and maps Marcin Kierczak 11/10/2016 11/10/2016 The grammar of graphics Hadley Wickham s ggplot2 package implements the grammar of graphics described in Leland Wilkinson s book by the same title. It offers a very flexible and efficient way

More information

plot(seq(0,10,1), seq(0,10,1), main = "the Title", xlim=c(1,20), ylim=c(1,20), col="darkblue");

plot(seq(0,10,1), seq(0,10,1), main = the Title, xlim=c(1,20), ylim=c(1,20), col=darkblue); R for Biologists Day 3 Graphing and Making Maps with Your Data Graphing is a pretty convenient use for R, especially in Rstudio. plot() is the most generalized graphing function. If you give it all numeric

More information

Visualising Spatial Data UCL Geography R Spatial Workshop Tuesday 9 th November 2010 rspatialtips.org.uk

Visualising Spatial Data UCL Geography R Spatial Workshop Tuesday 9 th November 2010 rspatialtips.org.uk Visualising Spatial Data UCL Geography R Spatial Workshop Tuesday 9 th November 2010 james.cheshire@ucl.ac.uk rspatialtips.org.uk The previous workshop served as an in depth introduction to R's spatial

More information

Maps & layers. Hadley Wickham. Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University.

Maps & layers. Hadley Wickham. Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University. Maps & layers Hadley Wickham Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University July 2010 1. Introduction to map data 2. Map projections 3. Loading & converting

More information

Practical 11: Interpolating Point Data in R

Practical 11: Interpolating Point Data in R Practical 11: Interpolating Point Data in R This practical provides an introduction to some techniques which are useful for interpolating point data across space in R. Interpolation describes a means of

More information

Package mapr. April 11, 2017

Package mapr. April 11, 2017 Title Visualize Species Occurrence Data Package mapr April 11, 2017 Utilities for visualizing species occurrence data. Includes functions to visualize occurrence data from 'spocc', 'rgbif', and other packages.

More information

Working with Geospatial Data in R. Introducing sp objects

Working with Geospatial Data in R. Introducing sp objects Introducing sp objects Data frames aren t a great way to store spatial data > head(ward_sales) ward lon lat group order num_sales avg_price 1 1-123.3128 44.56531 0.1 1 159 311626.9 2 1-123.3122 44.56531

More information

Package Grid2Polygons

Package Grid2Polygons Package Grid2Polygons February 15, 2013 Version 0.1-2 Date 2013-01-28 Title Convert Spatial Grids to Polygons Author Jason C. Fisher Maintainer Jason C. Fisher Depends R (>= 2.15.0),

More information

Spatial data. Spatial data in R

Spatial data. Spatial data in R Spatial data Spatial data in R What do we want to do? What do we want to do? What do we want to do? Today s plan Geographic data types in R Projections Important large-scale data sources Geographic Data

More information

Reproducible Homerange Analysis

Reproducible Homerange Analysis Reproducible Homerange Analysis (Sat Aug 09 15:28:43 2014) based on the rhr package This is an automatically generated file with all parameters and settings, in order to enable later replication of the

More information

Package mapr. March 21, 2018

Package mapr. March 21, 2018 Title Visualize Species Occurrence Data Package mapr March 21, 2018 Utilities for visualizing species occurrence data. Includes functions to visualize occurrence data from 'spocc', 'rgbif', and other packages.

More information

Exploring Maps with ggplot2 1 Draft: Do not Cite

Exploring Maps with ggplot2 1 Draft: Do not Cite Exploring Maps with ggplot2 1 Draft: Do not Cite John Kane and William H. Rogers May 12, 2011 1 We thank Josh Ulrich for his helpful comments and corrections. All remaining errors are the those of the

More information

Zev Ross President, ZevRoss Spatial Analysis

Zev Ross President, ZevRoss Spatial Analysis SPATIAL ANALYSIS IN R WITH SF AND RASTER Welcome! Zev Ross President, ZevRoss Spatial Analysis Packages we will use in this course Two key packages sf for vectors raster for grids Additional packages discussed

More information

Package BIEN. R topics documented: May 9, 2018

Package BIEN. R topics documented: May 9, 2018 Package BIEN May 9, 2018 Title Tools for Accessing the Botanical Information and Ecology Network Database Version 1.2.3 Provides Tools for Accessing the Botanical Information and Ecology Network Database.

More information

Zev Ross President, ZevRoss Spatial Analysis

Zev Ross President, ZevRoss Spatial Analysis SPATIAL ANALYSIS IN R WITH SF AND RASTER A quick refresher on the coordinate Zev Ross President, ZevRoss Spatial Analysis reference system Coordinate reference system A place on the earth is specified

More information

Spatial data analysis with

Spatial data analysis with Spatial data analysis with Spatial is special Complex: geometry and attributes The earth is not flat Size: lots and lots of it, multivariate, time series Special plots: maps First Law of Geography: nearby

More information

Section 2-2. Histograms, frequency polygons and ogives. Friday, January 25, 13

Section 2-2. Histograms, frequency polygons and ogives. Friday, January 25, 13 Section 2-2 Histograms, frequency polygons and ogives 1 Histograms 2 Histograms The histogram is a graph that displays the data by using contiguous vertical bars of various heights to represent the frequencies

More information

Package windfarmga. March 25, 2018

Package windfarmga. March 25, 2018 Package windfarmga March 25, 2018 Title Genetic Algorithm for Wind Farm Layout Optimization Version 1.2.1 Date 2018-03-24 Author Maintainer The genetic algorithm is designed

More information

Advanced Plotting with ggplot2. Algorithm Design & Software Engineering November 13, 2016 Stefan Feuerriegel

Advanced Plotting with ggplot2. Algorithm Design & Software Engineering November 13, 2016 Stefan Feuerriegel Advanced Plotting with ggplot2 Algorithm Design & Software Engineering November 13, 2016 Stefan Feuerriegel Today s Lecture Objectives 1 Distinguishing different types of plots and their purpose 2 Learning

More information

Package velox. R topics documented: December 1, 2017

Package velox. R topics documented: December 1, 2017 Type Package Title Fast Raster Manipulation and Extraction Version 0.2.0 Date 2017-11-30 Author Philipp Hunziker Package velox December 1, 2017 Maintainer Philipp Hunziker BugReports

More information

Using R as a Geographical Information System

Using R as a Geographical Information System Using R as a Geographical Information System F. Vanwindekens Gembloux June 2016 Contents 1 Shapefiles 2 1.1 Definitions............................... 2 1.2 Loading data............................. 2

More information

Tinn-R - [C:\Users\admin2\Documents\Enseignements\IRSAE-2014\Course\R-script spatial data in ecology.r]

Tinn-R - [C:\Users\admin2\Documents\Enseignements\IRSAE-2014\Course\R-script spatial data in ecology.r] 1/5 # Set the working directory (change the path to locate your files) setwd("c:/users/admin2/documents/enseignements/irsae-2014") # Load the maptools package library(maptools) # Load the dataset "wrld_simpl"

More information

Lecture 14: ggmap and lubridate packages : Exploring and Visualizing Data 2/01/2018

Lecture 14: ggmap and lubridate packages : Exploring and Visualizing Data 2/01/2018 Lecture 14: ggmap and lubridate packages 95-868: Exploring and Visualizing Data 2/01/2018 Agenda First we ll do an example of interactions. Then, let s take a break from stats and just learn some R :)

More information

Combining Spatial Data *

Combining Spatial Data * Combining Spatial Data * Roger Bivand March 25, 2017 1 Introduction 2 Checking Topologies In this vignette, we look at a practical example involving the cleaning of spatial objects originally read into

More information

Spatial Data in R. Release 1.0. Robert Hijmans

Spatial Data in R. Release 1.0. Robert Hijmans Spatial Data in R Release 1.0 Robert Hijmans Sep 16, 2018 CONTENTS 1 1. Introduction 1 2 2. Spatial data 3 2.1 2.1 Introduction............................................. 3 2.2 2.2 Vector data..............................................

More information

An introduction to ggplot: An implementation of the grammar of graphics in R

An introduction to ggplot: An implementation of the grammar of graphics in R An introduction to ggplot: An implementation of the grammar of graphics in R Hadley Wickham 00-0-7 1 Introduction Currently, R has two major systems for plotting data, base graphics and lattice graphics

More information

Government of Alberta. Find Your Farm. Alberta Soil Information Viewer. Alberta Agriculture and Forestry [Date]

Government of Alberta. Find Your Farm. Alberta Soil Information Viewer. Alberta Agriculture and Forestry [Date] Government of Alberta Find Your Farm Alberta Soil Information Viewer Alberta Agriculture and Forestry [Date] Contents Definitions... 1 Getting Started... 2 Area of Interest... 3 Search and Zoom... 4 By

More information

Introduction to using R for Spatial Analysis

Introduction to using R for Spatial Analysis Introduction to using R for Spatial Analysis Learning outcomes: Tools & techniques: Use R to read in spatial data (pg. 5) read.csv (pg. 4) Know how to Plot spatial data using R (pg. 6) readshapespatial()

More information

How to convert coordinate system in R

How to convert coordinate system in R How to convert coordinate system in R Dasapta Erwin Irawan 17 June 2014 Affiliation: Applied Geology Research Division, Faculty of Earth Sciences and Technology, Institut Teknologi Bandung Faculty of Agriculture

More information

Mapping Great Circles Tutorial

Mapping Great Circles Tutorial Mapping Great Circles Tutorial Charles DiMaggio February 21, 2012 I came across what may very well be one of my all time favorite uses of R graphics. It was by Paul Butler, and presents a visualization

More information

Analysis of species distribution data with R

Analysis of species distribution data with R Analysis of species distribution data with R Robert J. Hijmans March 28, 2013 1 Introduction In this vignette I show some techniques that can be used to analyze species distribution data with R. Before

More information

Package gfcanalysis. August 29, 2016

Package gfcanalysis. August 29, 2016 Package gfcanalysis August 29, 2016 Version 1.4 Date 2015-11-20 Title Tools for Working with Hansen et al. Global Forest Change Dataset Maintainer Alex Zvoleff Depends R (>=

More information

EXST 7014, Lab 1: Review of R Programming Basics and Simple Linear Regression

EXST 7014, Lab 1: Review of R Programming Basics and Simple Linear Regression EXST 7014, Lab 1: Review of R Programming Basics and Simple Linear Regression OBJECTIVES 1. Prepare a scatter plot of the dependent variable on the independent variable 2. Do a simple linear regression

More information

Spatial Data Analysis: Introduction to Raster Processing: Part-3

Spatial Data Analysis: Introduction to Raster Processing: Part-3 Spatial Data Analysis: Introduction to Raster Processing: Part-3 Background Geospatial data is becoming increasingly used to solve numerous real-life problems (check out some examples here.) In turn, R

More information

An introduction to R Graphics 4. ggplot2

An introduction to R Graphics 4. ggplot2 An introduction to R Graphics 4. ggplot2 Michael Friendly SCS Short Course March, 2017 http://www.datavis.ca/courses/rgraphics/ Resources: Books Hadley Wickham, ggplot2: Elegant graphics for data analysis,

More information

Zev Ross President, ZevRoss Spatial Analysis

Zev Ross President, ZevRoss Spatial Analysis SPATIAL ANALYSIS IN R WITH SF AND RASTER Buffers and centroids Zev Ross President, ZevRoss Spatial Analysis Use a projected coordinate reference system for spatial analysis As a general rule your layers

More information

Introduction to district compactness using QGIS

Introduction to district compactness using QGIS Introduction to district compactness using QGIS Mira Bernstein, Metric Geometry and Gerrymandering Group Designed for MIT Day of Engagement, April 18, 2017 1) First things first: before the session Download

More information

Graphing Bivariate Relationships

Graphing Bivariate Relationships Graphing Bivariate Relationships Overview To fully explore the relationship between two variables both summary statistics and visualizations are important. For this assignment you will describe the relationship

More information

Review of Cartographic Data Types and Data Models

Review of Cartographic Data Types and Data Models Review of Cartographic Data Types and Data Models GIS Data Models Raster Versus Vector in GIS Analysis Fundamental element used to represent spatial features: Raster: pixel or grid cell. Vector: x,y coordinate

More information

Package gridextra. September 9, 2017

Package gridextra. September 9, 2017 License GPL (>= 2) Package gridextra September 9, 2017 Title Miscellaneous Functions for ``Grid'' Graphics Type Package Provides a number of user-level functions to work with ``grid'' graphics, notably

More information

Introduction to using R for Spatial Analysis Nick Bearman

Introduction to using R for Spatial Analysis Nick Bearman Introduction to using R for Spatial Analysis Nick Bearman Learning Outcomes: R Functions & Libraries: Use R to read in CSV data (pg. 4) read.csv() (pg. 4) Use R to read in spatial data (pg. 5) readshapespatial()

More information

CSE 512 Course Project Operation Requirements

CSE 512 Course Project Operation Requirements CSE 512 Course Project Operation Requirements 1. Operation Checklist 1) Geometry union 2) Geometry convex hull 3) Geometry farthest pair 4) Geometry closest pair 5) Spatial range query 6) Spatial join

More information

Rich Majerus Assistant Vice President, Colby College

Rich Majerus Assistant Vice President, Colby College INTERACTIVE MAPS WITH LEAFLET IN R Introduction to leaflet Rich Majerus Assistant Vice President, Colby College leaflet Open-source JavaScript library Popular option for creating interactive mobile-friendly

More information

How to calculate population and jobs within ½ mile radius of site

How to calculate population and jobs within ½ mile radius of site How to calculate population and jobs within ½ mile radius of site Caltrans Project P359, Trip Generation Rates for Transportation Impact Analyses of Smart Growth Land Use Projects SECTION PAGE Population

More information

Graphics in R. There are three plotting systems in R. base Convenient, but hard to adjust after the plot is created

Graphics in R. There are three plotting systems in R. base Convenient, but hard to adjust after the plot is created Graphics in R There are three plotting systems in R base Convenient, but hard to adjust after the plot is created lattice Good for creating conditioning plot ggplot2 Powerful and flexible, many tunable

More information

Properties of Data. Digging into Data: Jordan Boyd-Graber. University of Maryland. February 11, 2013

Properties of Data. Digging into Data: Jordan Boyd-Graber. University of Maryland. February 11, 2013 Properties of Data Digging into Data: Jordan Boyd-Graber University of Maryland February 11, 2013 Digging into Data: Jordan Boyd-Graber (UMD) Properties of Data February 11, 2013 1 / 43 Roadmap Munging

More information

Geographic Aggregation Tool R Version 1.33

Geographic Aggregation Tool R Version 1.33 Geographic Aggregation Tool R Version 1.33 User Guide May 14, 2015 Environmental Health Surveillance Section New York State Department of Health Albany, NY Contact Information: Please send comments and

More information

Creating Geo model from Live HANA Calculation View

Creating Geo model from Live HANA Calculation View Creating Geo model from Live HANA Calculation View This document provides instructions for how to prepare a calculation view on a live HANA system with location dimensions for use in the SAP Analytics

More information

Spatial Data Analysis with R

Spatial Data Analysis with R Spatial Data Analysis with R Release 0.1 Robert Hijmans April 12, 2018 CONTENTS 1 1. Introduction 1 2 2. Spatial data 3 2.1 2.1 Introduction............................................. 3 2.2 2.2 Vector

More information

DATA VISUALIZATION WITH GGPLOT2. Grid Graphics

DATA VISUALIZATION WITH GGPLOT2. Grid Graphics DATA VISUALIZATION WITH GGPLOT2 Grid Graphics ggplot2 internals Explore grid graphics 35 30 Elements of ggplot2 plot 25 How do graphics work in R? 2 plotting systems mpg 20 15 base package grid graphics

More information

Geography 281 Map Making with GIS Project Three: Viewing Data Spatially

Geography 281 Map Making with GIS Project Three: Viewing Data Spatially Geography 281 Map Making with GIS Project Three: Viewing Data Spatially This activity introduces three of the most common thematic maps: Choropleth maps Dot density maps Graduated symbol maps You will

More information

The Average and SD in R

The Average and SD in R The Average and SD in R The Basics: mean() and sd() Calculating an average and standard deviation in R is straightforward. The mean() function calculates the average and the sd() function calculates the

More information

Introduction to idistance Data Structures.

Introduction to idistance Data Structures. Introduction to idistance Data Structures. idistance Workshop CREEM, University of St Andrews March 18, 2016 Contents 1 Introduction 2 2 Load the Package 3 3 Data Assessment 3 3.1 Checking the data......................................

More information

Data visualization with ggplot2

Data visualization with ggplot2 Data visualization with ggplot2 Visualizing data in R with the ggplot2 package Authors: Mateusz Kuzak, Diana Marek, Hedi Peterson, Dmytro Fishman Disclaimer We will be using the functions in the ggplot2

More information

Geographic Information System and its Application in Hydro-Meteorology Exercises using SavGIS

Geographic Information System and its Application in Hydro-Meteorology Exercises using SavGIS Geographic Information System and its Application in Hydro-Meteorology Exercises using SavGIS Jothiganesh Shanmugasundaram Decision Support Tool Development Specialist COPY DATABASE FOLDER BHUTAN in to

More information

Geographic Information Systems. using QGIS

Geographic Information Systems. using QGIS Geographic Information Systems using QGIS 1 - INTRODUCTION Generalities A GIS (Geographic Information System) consists of: -Computer hardware -Computer software - Digital Data Generalities GIS softwares

More information

Exercise 1: An Overview of ArcMap and ArcCatalog

Exercise 1: An Overview of ArcMap and ArcCatalog Exercise 1: An Overview of ArcMap and ArcCatalog Introduction: ArcGIS is an integrated collection of GIS software products for building a complete GIS. ArcGIS enables users to deploy GIS functionality

More information

TV Broadcast Contours

TV Broadcast Contours TV Broadcast Contours Identification Information: Citation: Citation Information: Title: TV Broadcast Contours Geospatial Data Presentation Form: vector digital data Online Linkage: HIFLD Open Data (https://gii.dhs.gov/hifld/data/open)

More information

Tutorial 1 Exploring ArcGIS

Tutorial 1 Exploring ArcGIS Tutorial 1 Exploring ArcGIS Before beginning this tutorial, you should make sure your GIS network folder is mapped on the computer you are using. Please refer to the How to map your GIS server folder as

More information

How Green Was My Valley

How Green Was My Valley How Green Was My Valley Joe Conway joe.conway@crunchydata.com mail@joeconway.com Crunchy Data May 15, 2018 Introduction Prerequisites Agenda Spatial Analytics Overview Analytics Joe Conway FOSS4G NA 2018

More information

Statistical transformations

Statistical transformations Statistical transformations Next, let s take a look at a bar chart. Bar charts seem simple, but they are interesting because they reveal something subtle about plots. Consider a basic bar chart, as drawn

More information

Getting spatial data into shape for Species Distribution Modelling (SDMs)

Getting spatial data into shape for Species Distribution Modelling (SDMs) Getting spatial data into shape for Species Distribution Modelling (SDMs) Prepared by: Dr Pia Lentini, Research Fellow, School of BioSciences, The University of Melbourne. pia.lentini@unimelb.edu.au December

More information

The mapmisc package. Patrick Brown. August 28, 2017

The mapmisc package. Patrick Brown. August 28, 2017 The mapmisc package Patrick Brown August 28, 2017 This document will be incomplete if rgdal is unavailable or there is on internet connection when this document is compiled. The full document is at http://diseasemapping.

More information

How to Wrangle Data. using R with tidyr and dplyr. Ken Butler. March 30, / 44

How to Wrangle Data. using R with tidyr and dplyr. Ken Butler. March 30, / 44 1 / 44 How to Wrangle Data using R with tidyr and dplyr Ken Butler March 30, 2015 It is said that... 2 / 44 80% of data analysis: getting the data into the right form maybe 20% is making graphs, fitting

More information

User manual forggsubplot

User manual forggsubplot User manual forggsubplot Garrett Grolemund September 3, 2012 1 Introduction ggsubplot expands the ggplot2 package to help users create multi-level plots, or embedded plots." Embedded plots embed subplots

More information

Chapter 2. Frequency Distributions and Graphs. Bluman, Chapter 2

Chapter 2. Frequency Distributions and Graphs. Bluman, Chapter 2 Chapter 2 Frequency Distributions and Graphs 1 Chapter 2 Overview Introduction 2-1 Organizing Data 2-2 Histograms, Frequency Polygons, and Ogives 2-3 Other Types of Graphs 2 Chapter 2 Objectives 1. Organize

More information

Courtesy :

Courtesy : STATISTICS The Nature of Statistics Introduction Statistics is the science of data Statistics is the science of conducting studies to collect, organize, summarize, analyze, and draw conclusions from data.

More information

Package smoothr. April 4, 2018

Package smoothr. April 4, 2018 Type Package Title Smooth and Tidy Spatial Features Version 0.1.0 Package smoothr April 4, 2018 Tools for smoothing and tidying spatial features (i.e. lines and polygons) to make them more aesthetically

More information

Introduction to Geospatial Analysis

Introduction to Geospatial Analysis Introduction to Geospatial Analysis Introduction to Geospatial Analysis 1 Descriptive Statistics Descriptive statistics. 2 What and Why? Descriptive Statistics Quantitative description of data Why? Allow

More information

Getting started with ggplot2

Getting started with ggplot2 Getting started with ggplot2 STAT 133 Gaston Sanchez Department of Statistics, UC Berkeley gastonsanchez.com github.com/gastonstat/stat133 Course web: gastonsanchez.com/stat133 ggplot2 2 Resources for

More information

Downloading 2010 Census Data

Downloading 2010 Census Data Downloading 2010 Census Data These instructions cover downloading the Census Tract polygons and the separate attribute data. After that, the attribute data will need additional formatting in Excel before

More information

Data Visualization Using R & ggplot2. Karthik Ram October 6, 2013

Data Visualization Using R & ggplot2. Karthik Ram October 6, 2013 Data Visualization Using R & ggplot2 Karthik Ram October 6, 2013 Some housekeeping Install some packages install.packages("ggplot2", dependencies = TRUE) install.packages("plyr") install.packages("ggthemes")

More information

Welcome to the Surface Water Data Viewer!

Welcome to the Surface Water Data Viewer! 1 Welcome to the Surface Water Data Viewer! The Surface Water Data Viewer is a mapping tool for the State of Wisconsin. It provides interactive web mapping tools for a variety of datasets, including chemistry,

More information

4/7/2009. Model: Abstraction of reality following formal rules e.g. Euclidean space for physical space

4/7/2009. Model: Abstraction of reality following formal rules e.g. Euclidean space for physical space Model: Abstraction of reality following formal rules e.g. Euclidean space for physical space At different levels: mathematical model (Euclidean space) conceptual design model (ER model) data model (design)

More information

Analysing Spatial Data in R: Representing Spatial Data

Analysing Spatial Data in R: Representing Spatial Data Analysing Spatial Data in R: Representing Spatial Data Roger Bivand Department of Economics Norwegian School of Economics and Business Administration Bergen, Norway 31 August 2007 Object framework To begin

More information

Package TPD. June 14, 2018

Package TPD. June 14, 2018 Type Package Package TPD June 14, 2018 Title Methods for Measuring Functional Diversity Based on Trait Probability Density Version 1.0.0 Date 2018-06-13 Author Carlos P. Carmona

More information

Data Assembly, Part II. GIS Cyberinfrastructure Module Day 4

Data Assembly, Part II. GIS Cyberinfrastructure Module Day 4 Data Assembly, Part II GIS Cyberinfrastructure Module Day 4 Objectives Continuation of effective troubleshooting Create shapefiles for analysis with buffers, union, and dissolve functions Calculate polygon

More information

Some methods for the quantification of prediction uncertainties for digital soil mapping: Universal kriging prediction variance.

Some methods for the quantification of prediction uncertainties for digital soil mapping: Universal kriging prediction variance. Some methods for the quantification of prediction uncertainties for digital soil mapping: Universal kriging prediction variance. Soil Security Laboratory 2018 1 Universal kriging prediction variance In

More information

Plotting: Customizing the Page Display

Plotting: Customizing the Page Display Plotting: Customizing the Page Display Setting the Page Orientation Graphs can be viewed in landscape or portrait page orientation. To change the page orientation of the active graph window, select File:Page

More information

Package panelview. April 24, 2018

Package panelview. April 24, 2018 Type Package Package panelview April 24, 2018 Title Visualizing Panel Data with Dichotomous Treatments Version 1.0.1 Date 2018-04-23 Author Licheng Liu, Yiqing Xu Maintainer Yiqing Xu

More information

Introduction to GIS. Geographic Information Systems SOCR-377 9/24/2015. R. Khosla Fall Semester The real world. What in the world is GIS?

Introduction to GIS. Geographic Information Systems SOCR-377 9/24/2015. R. Khosla Fall Semester The real world. What in the world is GIS? Introduction to GIS Geographic Information Systems SOCR-377 What in the world is GIS? GIS is simultaneously the telescope, the microscope, the computer and the Xerox machine of regional analysis and synthesis

More information

vdmr: Generating web-based visual data mining tools with R

vdmr: Generating web-based visual data mining tools with R vdmr: Generating web-based visual data mining tools with R Tomokazu Fujino November 24, 2017 1 Outline of usage 1.1 Installation and Sample dataset The vdmr pakcage can be loaded as following command.

More information

Geoapplications development Control work 1 (2017, Fall)

Geoapplications development Control work 1 (2017, Fall) Page 1 Geoapplications development Control work 1 (2017, Fall) Author: Antonio Rodriges, Oct. 2017 http://rgeo.wikience.org/ Surname, name, patronymic: Group: Date: Signature: Select all correct statements.

More information

Package tiler. June 9, 2018

Package tiler. June 9, 2018 Version 0.2.0 Package tiler June 9, 2018 Title Create Geographic and Non-Geographic Map Tiles Creates geographic map tiles from geospatial map files or nongeographic map tiles from simple image files.

More information

social data science Data Visualization Sebastian Barfort August 08, 2016 University of Copenhagen Department of Economics 1/86

social data science Data Visualization Sebastian Barfort August 08, 2016 University of Copenhagen Department of Economics 1/86 social data science Data Visualization Sebastian Barfort August 08, 2016 University of Copenhagen Department of Economics 1/86 Who s ahead in the polls? 2/86 What values are displayed in this chart? 3/86

More information

Rstudio GGPLOT2. Preparations. The first plot: Hello world! W2018 RENR690 Zihaohan Sang

Rstudio GGPLOT2. Preparations. The first plot: Hello world! W2018 RENR690 Zihaohan Sang Rstudio GGPLOT2 Preparations There are several different systems for creating data visualizations in R. We will introduce ggplot2, which is based on Leland Wilkinson s Grammar of Graphics. The learning

More information

Spatial data and QGIS

Spatial data and QGIS Spatial data and QGIS Xue Jingbo IT Center 2017.08.07 A GIS consists of: Spatial Data. Computer Hardware. Computer Software. Longitude Latitude Disease Date 26.870436-31.909519 Mumps 13/12/2008 26.868682-31.909259

More information

Visual Studies Exercise.Topic08 (Architectural Paleontology) Geographic Information Systems (GIS), Part I

Visual Studies Exercise.Topic08 (Architectural Paleontology) Geographic Information Systems (GIS), Part I ARCH1291 Visual Studies II Week 8, Spring 2013 Assignment 7 GIS I Prof. Alihan Polat Visual Studies Exercise.Topic08 (Architectural Paleontology) Geographic Information Systems (GIS), Part I Medium: GIS

More information

Chapter 2. Frequency distribution. Summarizing and Graphing Data

Chapter 2. Frequency distribution. Summarizing and Graphing Data Frequency distribution Chapter 2 Summarizing and Graphing Data Shows how data are partitioned among several categories (or classes) by listing the categories along with the number (frequency) of data values

More information

Package ggsubplot. February 15, 2013

Package ggsubplot. February 15, 2013 Package ggsubplot February 15, 2013 Maintainer Garrett Grolemund License GPL Title Explore complex data by embedding subplots within plots. LazyData true Type Package Author Garrett

More information

file:///c:/users/c_harmak/appdata/local/temp/arc8f36/tmp308d.tmp.htm

file:///c:/users/c_harmak/appdata/local/temp/arc8f36/tmp308d.tmp.htm Page 1 of 6 FireDistricts_CoB Shapefile Tags Bradenton, boundary, fire districts Summary The best current representation of the City of Bradenton Florida's fire districts and sub-districts. Description

More information

Intro to GIS (requirements: basic Windows computer skills and a flash drive)

Intro to GIS (requirements: basic Windows computer skills and a flash drive) Introduction to GIS Intro to GIS (requirements: basic Windows computer skills and a flash drive) Part 1. What is GIS. 1. System: hardware (computers, devices), software (proprietary or free), people. 2.

More information

Building Vector Layers

Building Vector Layers Building Vector Layers in QGIS Introduction: Spatially referenced data can be separated into two categories, raster and vector data. This week, we focus on the building of vector features. Vector shapefiles

More information

QGIS Tutorials Documentation

QGIS Tutorials Documentation QGIS Tutorials Documentation Release 0.1 Nathaniel Roth November 30, 2016 Contents 1 Installation 3 1.1 Basic Installation............................................. 3 1.2 Advanced Installation..........................................

More information

QGIS & R intro. Anto Aasa 07/03/

QGIS & R intro. Anto Aasa 07/03/ QGIS & R intro Anto Aasa 07/03/2017 http://www.qgis.org/ https://cran.r-project.org/ https://www.rstudio.com/ QGIS Desktop Project plugins Layers Vector Layer Print Composer Add map export geolayers data

More information

Len Preston Chief, Labor Market Information New Jersey Department of Labor & Workforce Development

Len Preston Chief, Labor Market Information New Jersey Department of Labor & Workforce Development Len Preston Chief, Labor Market Information New Jersey Department of Labor & Workforce Development Cooperative project of the State of New Jersey and the U.S. Bureau of the Census serving data users in

More information