% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/left_join_raster.R
\name{left_join_raster}
\alias{left_join_raster}
\title{Function for extracting values from a raster object based on points contained
within a data frame.}
\usage{
left_join_raster(
  df,
  latitude = "latitude",
  longitude = "longitude",
  projection = "+proj=longlat +datum=WGS84 +no_defs",
  raster,
  name = "raster_value"
)
}
\arguments{
\item{df}{Data frame containing latitude and longitude (or other coordinate
pair) variables.}

\item{latitude}{\code{df}'s latitude variable name.}

\item{longitude}{\code{df}'s longitude variable name.}

\item{projection}{\code{df}'s latitude and longitude projection system. 
Default is WGS84.}

\item{raster}{A raster object to be joined to \code{df}.}

\item{name}{The name of \code{df}'s new variable sourced from \code{raster}. 
Default is \code{"raster_value"}.}
}
\description{
\code{left_join_raster} tests if a point is within a raster object and returns
the raster's object value if \code{TRUE}. This process is analogous to a SQL 
left join but with a raster object. In raster applications, this is also 
called an \emph{extraction} or \emph{location} process.
}
\details{
Points to be tested are generally stored in a data frame with latitude and 
longitude pairs (or any other projection system) and the raster object must 
have the same projection system. The result is the input data frame, with
the joined raster values. Observations which do not match are filled with 
\code{NA}. 

Currently only one layer is used with no buffer. No interpolation or
aggregation functions are used either. 

\code{raster::extract} is used for the join.
}
\examples{
\dontrun{
# Get ozone concentrations from a raster object
data_select <- left_join_raster(data_select, raster = raster_ozone, 
                                name = "ozone")

}

}
\author{
Stuart K. Grange
}
