Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Suggests:
maps,
IRanges,
covr
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ export(stringdist_left_join)
export(stringdist_right_join)
export(stringdist_semi_join)
importFrom(dplyr,"%>%")
importFrom(dplyr,common_by)
importFrom(dplyr,data_frame)
importFrom(utils,data)
7 changes: 5 additions & 2 deletions R/geo_join.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#'
#' @param x A tbl
#' @param y A tbl
#' @param by Columns by which to join the two tables
#' @param by Columns by which to join the two tables. Must contain 'lon'
#' for longitute, and 'lat' for latitude, such as 'lat', or
#' 'lat.y', or 'latitude'.
#' @param max_dist Maximum distance to use for joining
#' @param method Method to use for computing distance: one of
#' "haversine" (default), "geo", "cosine", "meeus", "vincentysphere",
Expand All @@ -29,6 +31,7 @@
#' \code{fuzzy_join}.
#'
#' @importFrom utils data
#' @importFrom dplyr common_by data_frame
#'
#' @examples
#'
Expand Down Expand Up @@ -74,7 +77,7 @@ geo_join <- function(x, y, by = NULL, max_dist,
unit <- match.arg(unit)

# make sure longitude and latitude are in the right order
by <- common_by(by, x, y)
by <- dplyr::common_by(by, x, y)
by <- lapply(by, function(e) {
if (length(e) != 2) {
stop("Trying to join on ", paste(e, collapse = ", "),
Expand Down
99 changes: 95 additions & 4 deletions man/geo_join.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.