View source: R/table_getDistanceFromTarget.R
table_getDistanceFromTarget | R Documentation |
Returns a tibble with the same number of rows as locationTbl
containing the distance and direction from the target location specified by
longitude
and latitude
to each known location found in
locationTbl
.
table_getDistanceFromTarget(
locationTbl = NULL,
longitude = NULL,
latitude = NULL,
measure = c("geodesic", "haversine", "vincenty", "cheap")
)
locationTbl |
Tibble of known locations. |
longitude |
Target longitude in decimal degrees E. |
latitude |
Target latitude in decimal degrees N. |
measure |
One of "geodesic", "haversine", "vincenty" or "cheap" specifying desired method of geodesic distance calculation. |
Tibble of distances in meters and cardinal directions from a target location.
Only a single target location is allowed.
library(MazamaLocationUtils)
locationTbl <- get(data("wa_monitors_500"))
locationTbl %>%
table_getDistanceFromTarget(
longitude = -117.3647,
latitude = 47.6725
) %>%
dplyr::glimpse()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.