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: 513b4fb

    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
    html fd4f5af annakrystalli 2018-08-20 Build site.
    Rmd 932f2ad annakrystalli 2018-08-20 correct ggplot2 version
    html cc0f6ba annakrystalli 2018-08-20 Build site.
    Rmd cc5a158 annakrystalli 2018-08-20 add here, correct missing comma
    html d876ce8 annakrystalli 2018-08-20 Build site.
    Rmd 2ebda4e annakrystalli 2018-08-20 add purrr
    html 2d44c5c annakrystalli 2018-08-20 Build site.
    Rmd 2561cab annakrystalli 2018-08-20 workflowr::wflow_publish(c(“analysis/setup.Rmd”))
    html 0093032 annakrystalli 2018-08-20 Build site.
    Rmd 943160f annakrystalli 2018-08-20 workflowr::wflow_publish(c(“analysis/index.Rmd”,
    Rmd 1163a5e annakrystalli 2018-08-20 workflowr::wflow_publish(c(“analysis/index.Rmd”,


Overview

This workshop is designed to be run on your local machine. To do this, you will need to install all of the software used in the workshop and obtain copies of the datasets.

Data

We’ll be working in an Rstudio project which is all setup with all the data you will need for the workshop. You can download the project directory by clicking this download link. Clicking the download link will automatically download all of the files to your default download directory as a single compressed (.zip) file. To expand this file, double click the folder icon in your file navigator application (for Macs, this is the Finder application).

Software

Software Install Manual Available for Description
GDAL Link Link Linux, MacOS, Windows Geospatial model for reading and writing a variety of formats
GEOS Link Link Linux, MacOS, Windows Geometry models and operations
PROJ.4 Link Link Linux, MacOS, Windows Coordinate reference system transformations
R Link Link Linux, MacOS, Windows Software environment for statistical and scientific computing
RStudio Link Linux, MacOS, Windows GUI for R
UDUNITS Link Link Linux, MacOS, Windows Unit conversions

QuickStart Software Installation Instructions

These are the QuickStart installation instructions. At points, they assume familiarity with the command line and with installation in general. As there are different operating systems and many different versions of operating systems and environments, these may not work on your computer. If an installation doesn’t work for you, please refer to the installation instructions for that software, listed in the table above.

R

Participants who do not already have R installed should download and install it.

Windows

To install R, Windows users should select “Download R for Windows” from RStudio and CRAN’s cloud download page, which will automatically detect a CRAN mirror for you to use. Select the base subdirectory after choosing the Windows download page. A .exe executable file containing the necessary components of base R can be downloaded by clicking on “Download R 3.x.x for Windows”.

macOS

To install R, macOS users should select “Download R for (Mac) OS X” from RStudio and CRAN’s cloud download page, which will automatically detect a CRAN mirror for you to use. A .pkg file containing the necessary components of base R can be downloaded by clicking on the first available link (this will be the most recent), which will read R-3.x.x.pkg.

Linux

To install R, Linux users should select “Download R for Linux” from RStudio and CRAN’s cloud download page, which will automatically detect a CRAN mirror for you to use. Instructions for a number of different Linux operating systems are available.

RStudio

RStudio is an GUI for using R that is available for Windows, macOS, and various Linux operating systems. It can be downloaded here. You will need the free Desktop version for your computer.

GDAL, GEOS, and PROJ.4

The installation of the geospatial libraries GDAL, GEOS, and PROJ.4 varies significantly based on operating system. These are all dependencies for sf, the R package that we will be using for spatial data operations throughout this workshop.

Windows

To install the geospatial libraries, install the latest version RTools

macOS

For participants who do not already have homebrew installed, and who may be less comfortable with the command line, the easiest was to obtain the geospatial libraries is to install the latest version of Kyng Chaos’s pre-built package for GDAL Complete. Be aware that several other libraries are also installed, including the UnixImageIO, SQLite3, and NumPy.

After downloading the package in the link above, you will need to double-click the cardbord box icon to complete the installation. Depending on your security settings, you may get an error message about “unidentified developers”. You can enable the installation by following these instructions for installing programs from unidentified developers.

Alternatively, participants who are comfortable with the command line can install the geospatial libraries individually using homebrew:

$ brew tap osgeo/osgeo4mac && brew tap --repair
$ brew install proj
$ brew install geos
$ brew install gdal2 --with-armadillo --with-complete --with-libkml --with-unsupported
$ brew link --force gdal2

Linux

Steps for installing the geospatial libraries will vary based on which form of Linux you are using. These instructions are adapted from the sf package’s README.

For Ubuntu:

$ sudo add-apt-repository ppa:ubuntugis
$ sudo apt-get update
$ sudo apt-get install libgdal-dev libgeos-dev libproj-dev

For Fedora:

$ sudo dnf install gdal-devel proj-devel proj-epsg proj-nad geos-devel

For Arch:

$ pacman -S gdal proj geos

For Debian: The rocker geospatial Dockerfiles may be helpful. Ubuntu Dockerfiles are found here.

UDUNITS

Linux users will have to install UDUNITS separately. Like the geospatial libraries discussed above, this is a dependency for the R package sf. Due to conflicts, it does not install properly on Linux machines when installed as part of the sf installation process. It is therefore necessary to install it using the command line ahead of time.

Linux

Steps for installing the geospatial will vary based on which form of Linux you are using. These instructions are adapted from the sf package’s README.

For Ubuntu:

$ sudo apt-get install libudunits2-dev

For Fedora:

$ sudo dnf install udunits2-devel

For Arch:

$ pacaur/yaourt/whatever -S udunits

For Debian:

$ sudo apt-get install -y libudunits2-dev

R Packages

The following R packages are used in the various geospatial lessons.

To install these packages in RStudio, do the following:
1. Open RStudio by double-clicking the RStudio application icon. You should see something like this:

RStudio layout

RStudio layout

  1. Type (or even better, copy and paste) the following into the console and hit enter.
install.packages(c(
    #data science
    "dplyr", "ggplot2", "readr", "purrr", "here",
    #geospatial
    "sf", "raster", "rgdal", "geosphere",
    # mapping / plotting
    "tmap", "rasterVis", "ggmap", "leaflet",  
    #data
    "spData"))

You will need ggplot2 version >= 3.0.0

You should see a status message starting with:

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/dplyr_0.7.6.tgz'
Content type 'application/x-gzip' length 5686536 bytes (5.4 MB)
==================================================
downloaded 5.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.5/ggplot2_3.0.0.tgz'
Content type 'application/x-gzip' length 3577658 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

When the installation is complete, you will see a status message like:

The downloaded binary packages are in
/var/folders/7g/r8_n81y534z0vy5hxc6dx1t00000gn/T//RtmpJECKXM/downloaded_packages

You are now ready for the workshop!



Setup instructions modified from Data Carpentry Geospatial Workshop. June 2018: https://github.com/datacarpentry/geospatial-workshop


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] workflowr_1.0.1   Rcpp_0.12.18      digest_0.6.15    
 [4] rprojroot_1.3-2   R.methodsS3_1.7.1 backports_1.1.2  
 [7] git2r_0.21.0      magrittr_1.5      evaluate_0.11    
[10] stringi_1.2.4     whisker_0.3-2     R.oo_1.21.0      
[13] R.utils_2.6.0     rmarkdown_1.10    tools_3.4.4      
[16] stringr_1.3.1     yaml_2.1.19       compiler_3.4.4   
[19] htmltools_0.3.6   knitr_1.20       

This reproducible R Markdown analysis was created with workflowr 1.0.1