Spatial Data Analysis with R
Society for Conservation GIS, July 2021

Introduction

About Me…

Some of My R Work

T-LoCoH

Home range constructor and spatial-temporal pattern analysis for wildlife tracking data

http://tlocoh.r-forge.r-project.org/

uasimg

Data management utilities for drone mapping.

https://ucanr-igis.github.io/uasimg/



Bring climate data from Cal-Adapt into R using the API

https://ucanr-igis.github.io/caladaptr/



Shiny Apps

Chill Portions Under Climate Change Calculator
https://igis.shinyapps.io/chill/

Drone Mission Planner for Reforestation Monitoring Protocol
https://ucanr-igis.shinyapps.io/uav_stocking_survey/

Stock Pond Volume Calculator
https://ucanr-igis.shinyapps.io/PondCalc/

Calculator for Estimating Costs and Benefits of Medusahead Control
https://ucanr.shinyapps.io/medusahead_ipm/

About You…

https://forms.gle/pK5usnFz4Q5hu8WY9

Workshop Goals

Get better at:


Wind up a little higher on the learning curve!

Strategy: Copy and Adapt

foundational concepts
+ code recipes
+ working examples
+ practice
+ a good search engine

functional pRoficiency!


Advice for Beginners

  1. Try to get working code
  2. Focus on adapting code rather than starting from scratch
  3. Pay attention to syntax
  4. Use meaningful variable names
  5. Ask for help for cryptic error messages
  6. Comment your code liberally

Workshop Materials

Slides

Keyboard shortcuts for slides:

A: toggle display of current vs all slides
S: make fonts smaller
B: make fonts larger
F: toggle display of the footer
C: Show table of contents


Practice


Community Forum

  • questions
  • code
  • resources


Virtual Environment


Data

  1. create a workshop folder

  2. download data folder

usethis::use_course("bit.ly/rspatial-data", destdir = ".")

or download zip from https://bit.ly/rspatial-data and extract


Other Resources & Cheatsheets


Getting Help

Sample Data

Yosemite National Park data

R & RStudio

RStudio Cloud

Workshop Project

RStudio Cloud project for this workshop: https://rstudio.cloud/project/2709500

RStudio Tour

R Notebooks

R Notebooks are written in “R Markdown”, which combines text and R code.

We’ll be using R Notebooks for many of the workshop exercises.

When you’re in a R Notebook, the working directory is where the notebook Rmd file resides.


Download the Notebooks for today:

zip_url <- "https://github.com/ucanr-igis/rspatial_data/raw/master/scgis21_nb_sect01.zip"
temp_fn <- tempfile()
download.file(zip_url, destfile=temp_fn, mode="wb")
unzip(temp_fn, exdir = ".")
unlink(temp_fn)

Practice using R Notebook:

## Warning in if (is.na(nb_desc_chr)) {: the condition has length > 1 and only the first element will be used

nb_intro_scgis21.Rmd
Introduction to R Notebooks

nb_intro_scgis21.Rmd
NA

preview notebook | answer key

R Studio Shortcuts



Next: Syntax Review