Description Usage Arguments Value See Also Examples
geographic_filter
returns the indexes of all points in data
that are not within bufferdistance
of the filter_data
.
1 2 | geographic_filter(data, filter_data, buffer_distance = 200*1000,
lonlat = TRUE)
|
data |
Matrix or dataframe. The first two columns should represent the
longitude and latitude (or x,y coordinates if |
filter_data |
Matrix or dataframe. The first two columns should
represent the longitude and latitude (or x,y coordinates if |
buffer_distance |
Positive numeric. The minimal distance a point in
|
lonlat |
Logical. If |
Vector of integer with the indexes of the rows in data that are not within bufferdistance of the filter_data.
1 2 3 4 5 6 7 8 9 10 | set.seed(42)
data <- cbind(runif(10, -180, 180), runif(10, -90, 90))
filter_data <- cbind(runif(10, -180, 180), runif(10, -90, 90))
# remove points from data data are within a 1000km buffer around
# the points in filter_data
filtered <- geographic_filter(data, filter_data, buffer_distance = 1000*1000,
lonlat = TRUE)
data_filtered <- data[filtered,]
data_removed <- data[-filtered,]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.