Last updated: 2018-09-05

workflowr checks: (Click a bullet for more information)
  • R Markdown file: up-to-date

    Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

  • Environment: empty

    Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

  • Seed: set.seed(20180820)

    The command set.seed(20180820) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

  • Session information: recorded

    Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

  • Repository version: fd226bf

    Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

    Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
    
    Ignored files:
        Ignored:    .DS_Store
        Ignored:    .Rhistory
        Ignored:    .Rproj.user/
        Ignored:    analysis/.DS_Store
        Ignored:    analysis/assets/
        Ignored:    data-raw/
        Ignored:    data/csv/
        Ignored:    data/raster/
        Ignored:    data/sf/
        Ignored:    docs/.DS_Store
    
    Untracked files:
        Untracked:  .Rbuildignore
        Untracked:  analysis/mapping.Rmd
    
    Unstaged changes:
        Modified:   .gitignore
        Modified:   analysis/_site.yml
    
    
    Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
Expand here to see past versions:
    File Version Author Date Message
    Rmd fd226bf annakrystalli 2018-09-05 workflowr::wflow_publish(c(“analysis/intro.Rmd”, “analysis/index.Rmd”,
    html 12437d6 annakrystalli 2018-09-05 Build site.
    Rmd 372c5e6 annakrystalli 2018-09-05 workflowr::wflow_publish(“analysis/intro.Rmd”)
    html 2b36d92 annakrystalli 2018-09-05 Build site.
    html a8bba98 annakrystalli 2018-09-05 Build site.
    Rmd 592790b annakrystalli 2018-09-05 workflowr::wflow_publish(“analysis/intro.Rmd”)
    html acb8236 annakrystalli 2018-09-04 Build site.
    Rmd 37ee106 annakrystalli 2018-09-04 workflowr::wflow_publish(“analysis/intro.Rmd”)
    html aacbdfc annakrystalli 2018-09-04 Build site.
    html b1c1223 annakrystalli 2018-09-04 Build site.
    Rmd e410fc8 annakrystalli 2018-09-04 workflowr::wflow_publish(c(“analysis/index.Rmd”,


👋 Hello and welcome

me: Dr Anna Krystalli

  • Research Software Engineer, University of Sheffield
    • twitter @annakrystalli
    • github @annakrystalli
    • email a.krystalli[at]sheffield.ac.uk
  • Not a GIS expert! but
    • have used a lot of GIS in my work
    • ❤️ GIS in R!

Workshop materials

Data

On github: https://github.com/annakrystalli/gis-workshop

  • click on Clone or download

  • click on Download ZIP

  • Unzip the file

Workshop approach

Rstudio

We will be working in an Rstudio project. I recommend this workflow for all your projects because it keeps your work portable and self contained.

We will also be using Rmd notebooks. I like them because you can see the outputs of code as you write. You can also make notes around your code using markdown. See further resources for more details.

Live coding

The majority of the workshop I will be live coding 😨 so that you can follow along. You will get a lot more out of the workshop if you do.


Workshop aims and objectives

  • Understand the basics of GIS

  • Understand spatial data types and formats

  • Be able to work with, manipulate, combine and extract spatial data in R

  • Be able to plot geospatial data


Why GIS in R

  1. It’s free
  2. It’s powerful especially in terms of spatial analysis and statistics
  3. It’s a scripted language so encourages reusable, reproducible workflows
  4. Recent additions to the R geospatial ecosystem (in particular package sf) have drastically simplified spatial data classes and workflows.

Let’s dive in!

Session information

sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18      rstudioapi_0.7    knitr_1.20       
 [4] whisker_0.3-2     magrittr_1.5      workflowr_1.0.1  
 [7] rlang_0.2.1       stringr_1.3.1     tools_3.4.4      
[10] R.oo_1.21.0       git2r_0.21.0      htmltools_0.3.6  
[13] yaml_2.1.19       rprojroot_1.3-2   digest_0.6.15    
[16] assertthat_0.2.0  crayon_1.3.4      purrr_0.2.5      
[19] R.utils_2.6.0     glue_1.2.0.9000   evaluate_0.11    
[22] rmarkdown_1.10    emo_0.0.0.9000    stringi_1.2.4    
[25] compiler_3.4.4    backports_1.1.2   R.methodsS3_1.7.1
[28] lubridate_1.7.4  

This reproducible R Markdown analysis was created with workflowr 1.0.1