The data tutorials in this series cover how to open, work with and plot
vector-format spatial data (points, lines and polygons) in `R`

. Additional
topics include working with spatial metadata (extent and coordinate reference
system), working with spatial attributes and plotting data by attribute.

Data used in this series cover NEON Harvard Forest Field Site and are in
shapefile and .csv formats.

# Series Goals / Objectives

After completing the series you will:

**Vector 00:**
- Know the difference between point, line, and polygon vector elements.
- Understand the differences between opening point, line and polygon shapefiles
in R.

**Vector 01:**
- Understand the components of a spatial object in R.
- Be able to query shapefile attributes.
- Be able to subset shapefiles using specific attribute values.
- Know how to plot a shapefile, colored by unique attribute values.

**Vector 02:**
- Be able to plot multiple shapefiles using base
`plot()`

.
- Be able to apply custom symbology to spatial objects in a plot in R.
- Be able to customize a baseplot legend in R.

**Vector 03:**
- Know how to identify the CRS of a spatial dataset.
- Be familiar with geographic vs. projected coordinate reference systems.
- Be familiar with the proj4 string format which is one format used used to
store / reference the CRS of a spatial object.

**Vector 04:**
- Be able to import .csv files containing x,y coordinate locations into R.
- Know how to convert a .csv to a spatial object.
- Understand how to project coordinate locations provided in a Geographic
Coordinate System (Latitude, Longitude) to a projected coordinate system (UTM).
- Be able to plot raster and vector data in the same plot to create a map.

**Vector 05:**
- Be able to crop a raster to the extent of a vector layer.
- Be able to extract values from raster that correspond to a vector file overlay.

## Things You’ll Need To Complete This Series

### Setup RStudio

To complete the tutorial series you will need an updated version of `R`

and,
preferably, RStudio installed on your computer.

R
is a programming language that specializes in statistical computing. It is a
powerful tool for exploratory data analysis. To interact with `R`

, we strongly
recommend
RStudio,
an interactive development environment (IDE).

### Install R Packages

You can chose to install packages with each lesson or you can download all
of the necessary `R`

packages now.

**raster:** `install.packages("raster")`

**rgdal:** `install.packages("rgdal")`

**sp:** `install.packages("sp")`

More on Packages in R - Adapted from Software Carpentry.

### Download Data

These vector data provide information on the site characterization and
infrastructure at the
National Ecological Observatory Network’s
Harvard Forest
field site.
The Harvard Forest shapefiles are from the
Harvard Forest GIS & Map
archives. US Country and State Boundary layers are from the
US Census Bureau.

The LiDAR and imagery data used to create this raster teaching data subset
were collected over the
National Ecological Observatory Network’s
Harvard Forest
and
San Joaquin Experimental Range
field sites and processed at
NEON headquarters.
The entire dataset can be accessed by request from the
NEON Airborne Data Request Page on the NEON website.

**Set Working Directory:** This lesson assumes that you have set your working
directory to the location of the downloaded and unzipped data subsets. An overview
of setting the working directory in `R`

can be found here.

**R Script & Challenge Code:** NEON data lessons often contain challenges that reinforce
learned skills. If available, the code for challenge solutions is found in the
downloadable `R`

script of the entire lesson, available in the footer of each lesson page.

**Working with Spatio-temporal Data in R Series:** This tutorial series is
part of a larger
spatio-temporal tutorial series and Data Carpentry workshop.
Included series are
introduction to spatio-temporal data and data management,
working With raster data in R,
working with vector data in R
and
working with tabular time series in R.