% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/summaries.R
\name{coverage}
\alias{coverage}
\title{Create a summary of the coverage between two dataframes}
\usage{
coverage(nearest_df, to_df, distance_cutoff = 100, ...)
}
\arguments{
\item{nearest_df}{dataframe containing latitude and longitude}

\item{to_df}{dataframe containing latitude and longitude}

\item{distance_cutoff}{integer the distance threshold you are interested
in assessing coverage at}

\item{...}{extra arguments to pass to nearest}
}
\value{
a dataframe containing information about the distance threshold
uses (distance_within), the number of events covered and not covered
(n_cov, n_not_cov), the percentage covered and not covered
(pct_cov, pct_not_cov), and the average distance and sd distance.
}
\description{
In the york building and york crime context, writing
\code{nearest(york_crime,york)} reads as "find the nearest crime in york to
each building in york, and returns a dataframe with every building in
york, the nearest york_crime to each building, and the distance in
metres between the two."
}
\examples{

library(dplyr)

# already existing locations
york_selected <- york \%>\% filter(grade == "I")

# proposed locations
york_unselected <- york \%>\% filter(grade != "I")
coverage(york_selected, york_crime)
coverage(york_crime, york_selected)


}
