threshold_distance2 | R Documentation |
Computes the distance between rows of left_df
(old data)
and right_df
(new data) and returns those that fall below threshold
.
threshold_distance2(
left_df,
right_df,
threshold,
cols = c("x", "y"),
id_col = "ID",
extra_columns = NULL,
as_dataframe = FALSE,
check_id = FALSE,
distance_type = c("euclidean", "haversine")
)
left_df |
|
right_df |
|
threshold |
Maximum distance to return |
cols |
Names of columns of numeric data. The data will first be sorted on the first of these. |
id_col |
Name of column holding ID data |
extra_columns |
Names of other columns to expand into the results based on indices. |
as_dataframe |
|
check_id |
Whether the ID variable should be checked for inclusion |
distance_type |
What distance function to use |
Either a list
or data.frame
showing which IDs matched with other
IDs, the distance between them and the rows numbers where the pairs occured.
Michael Beigelmacher
left_df <- data.frame(
x = c(0, 1, 1, 0),
y = c(0, 1, 3, 2)
)
right_df <- data.frame(
x = c(0, 0, 2),
y = c(1, 3, 2)
)
threshold_distance2(left_df, right_df, threshold = 1.5, as_dataframe=FALSE)
threshold_distance2(left_df, right_df, threshold = 1.5, as_dataframe=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.