Skip to contents

Reduce data frame to a single spatial reliability within a context

Usage

reduce_geo_rel(
  df,
  dist_col = "rel_metres",
  dist_min = 100,
  dist_max = 250,
  context,
  extra_cols = "taxa",
  over_ride_na = NULL,
  over_ride_metres = NULL
)

Arguments

df

Dataframe.

dist_col

Character. Name of the column containing the spatial reliability.

dist_min

Numeric. In the same units as dist_col. The target spatial reliability that will be filtered on later.

dist_max

Numeric. In the same units as dist_col. In some cases, there is good reason to believe that dist_col is an under estimate of spatial reliability. These cases are identified by over_ride_metres where those instances have dist_col <= dist_max . In those cases, dist_col_adj will contain dist_min rather than dist_col. Only needed if over_ride_metres is used

context

Character. column names defining the context.

extra_cols

Character. Extra columns added to context.

over_ride_na

Named list. List names must be the same as column names. Any names in over_ride_na will be matched to column names in df and any values in that list element will be given the value dist_min. This is mainly used to prevent filtering data sources that do not have a concept equivalent to rel_metres.

over_ride_metres

Named list. List names must be the same as column names. Any names in over_ride_metres will be matched to column names in df and any values in that list element will be given the value dist_min.

Value

dataframe with a single rel_metres_adj value per context.