Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SOC 4650 & SOC 5650 - Lecture 11

SOC 4650 & SOC 5650 - Lecture 11

Slides for Lecture 11 of the Saint Louis University Course Introduction to GIS. These slides introduce concepts related to binding tabular and spatial data

Christopher Prener

April 02, 2018
Tweet

More Decks by Christopher Prener

Other Decks in Education

Transcript

  1. AGENDA INTRO TO GISC / WEEK 12 / LECTURE 11

    1. Front Matter 2. Binding Tables in R 3. Team Meetings 4. Lab Work 5. Back Matter
  2. Lab 10, Problem Set 07, and Lecture Prep 11 are

    due next Monday! WELCOME! GETTING STARTED Feedback on draft materials will be returned by next week.
  3. KEY TERM A bind combines
 the observations of two
 tables

    that share identically
 named and formatted variables.
  4. 3. TABLE JOINS IN R CONCEPTUALIZING BINDS id a 4

    44 5 55 id a 1 11 2 22 3 33 == ✔
  5. 3. TABLE JOINS IN R CONCEPTUALIZING BINDS id a a

    44 b 55 id a 1 11 2 22 3 33 != ✘
  6. 3. TABLE JOINS IN R CONCEPTUALIZING BINDS id a 4

    dd 5 ee id a 1 11 2 22 3 33 != ✘
  7. 3. TABLE JOINS IN R CONCEPTUALIZING BINDS id a 5

    44 6 55 id a 1 11 2 22 3 33 id a 1 11 2 22 3 33 5 44 6 55 + =
  8. 3. TABLE JOINS IN R CONCEPTUALIZING BINDS id geo 5

    6 id geo 1 2 3 id geo 1 2 3 5 6 + =
  9. 3. TABLE JOINS IN R CONCEPTUALIZING BINDS Use to combine

    observations or features of the 
 same type but that are stored in separate files. id geo 1 2 3 5 6 ➜ 1 5 6 3 2
  10. ▸ x and y are both data frames or tibbles

    with matching columns Available in dplyr
 Download via CRAN 3. TABLE JOINS IN R BINDING TABULAR DATA Parameters: bind_rows(x, y) f(x)
  11. ▸ x and y are both data frames or tibbles

    with matching columns 3. TABLE JOINS IN R BINDING TABULAR DATA Parameters: bind_rows(x, y) f(x)
  12. BINDING TABULAR DATA 3. TABLE JOINS IN R bind_rows(x, y)

    Using sample data from the lecture-11 repo: > x <- read_csv(“November2017.csv”) > y <- read_csv(“December2017.csv”) > crimes <- bind_rows(x, y) The x and y tables must have matching column names and formats! f(x)
  13. ▸ x and y are both sf objects with matching

    columns Available in base
 Download via CRAN 3. TABLE JOINS IN R BINDING GEOMETRIC DATA Parameters: rbind(x, y) f(x)
  14. ▸ x and y are both sf objects with matching

    columns 3. TABLE JOINS IN R BINDING GEOMETRIC DATA Parameters: rbind(x, y) f(x)
  15. BINDING GEOMETRIC DATA 3. TABLE JOINS IN R rbind(x, y)

    Using sample data from the lecture-11 repo: > x <- st_read(“St_Louis_City.shp”) > y <- st_read(“St_Louis_County.shp”) > counties <- rbind(x, y) The x and y tables must have matching column names and formats! f(x)