View source: R/utils-spatial.R
filter_positions_at_range | R Documentation |
The points whose distance, .distance
, satisfies
dm <= .distance < dM
are kept (.exclude = FALSE
) or excluded (.exclude = TRUE
)
filter_positions_at_range(
df,
geo,
dm,
dM,
lon,
lat,
.exclude = FALSE,
.keep = FALSE
)
df |
a (trajectory) data frame |
geo |
a geographical location in lon/lat (WGS84) |
dm |
a distance in Nautical Miles |
dM |
a distance in Nautical Miles |
lon |
the column for longitude in |
lat |
the column for latitude in |
.exclude |
exclude the point in the ( |
.keep |
keep the calculated distance (in Nautical Miles)
in the |
a subset of df
Other spatial:
bbox_at_distance()
,
bounding_box()
,
crs_tc()
,
polygon_at_distance()
,
polygon_from_coords()
## Not run:
fra <- c(8.570556, 50.03333) # Frankfurt Airport (longitude, latitude)
# keep the points 40 NM from FRA
poss %>% filter_positions_at_range(fra, 0, 40, longitude, latitude)
# keep the points from 10 to 40 NM from FRA
poss %>% filter_positions_at_range(fra, 10, 40, longitude, latitude)
# exclude the points from 10 to 40 NM from FRA
poss %>% filter_positions_at_range(fra, 10, 40, longitude, latitude, .exclude = TRUE)
# keep the points further away of 40 NM from FRA
poss %>% filter_positions_at_range(fra, 0, 40, longitude, latitude, .exclude = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.