Plant ch 02

Ed Harris

Ch 02 R programming environment


Plant 2019

Ch 02 content

  • R and book setup

  • R ‘Basics’

  • Programming concepts

  • Handling data in R (including geospatial)

  • Write your own functions

  • Aspects of graphics

  • Exercises

This is meant for beginners, but…

R and book setup


  • Code editors (most use RStudio)

  • The data (links on the Harper Data Science page)

  • Libraries needed

  • Chapter scripts

(Be aware of {sp} versus {sf})

R ‘Basics’


  • Syntax

  • Data types

  • Functions

  • Packages

  • Programming concepts, like loops

(similar content to module 1 of the R Stats Bootcamp, but MORE CONDENSED)

Handling data in R (including geospatial)


  • Data Frames, lists

  • Spatial data structures

(the spatial data objects are complex)

  • Coordinate reference system concept

  • Spatial polygons, etc.

Aspects of graphics


  • Plot(), ggplot(), {lattice}

  • The examples are fairly advanced!

Chapter code, exercises