Description Usage Arguments Functions Examples
View source: R/polygon_operations.R
based on: https://en.wikipedia.org/wiki/Even
1 2 3 | is_point_in_path(x, y, poly)
is_point_df_in_path(point_df, poly_df)
|
x |
The x coordinates of point. |
y |
The y coordinates of point. |
poly |
a list of numeric vectors defining the polygon list(c(x, y), c(x, y), ...) or a data.frame data.frame(x = c(0,0,1), y = c(0,1,1)) |
point_df |
a data.frame defining the points to check, column names are expected |
poly_df |
a data.frame defining a polygon, column are expected |
is_point_df_in_path
: Find wether points are inside a polygon, defining
both as data frames with matching names
1 2 3 4 5 6 7 8 9 10 11 12 13 | poly_selection <- data.frame(
Petal.Length = c(2, 4, 6),
Sepal.Width = c(2, 4, 2)
)
dplyr::mutate(
iris,
point_in_poly = is_point_in_path(
Petal.Length,
Sepal.Width,
poly_selection
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.