add_db_filters: Add database specific filters

View source: R/prepare_data.R

add_db_filtersR Documentation

Add database specific filters

Description

This functions looks into a filter list to add database specific filters (e.g. filters only applied to a banding dataset). The database specific fitlers should be defined in their own list. This function allows to define some filters applied only to a single database without having to define multiple objects.

Usage

add_db_filters(filters, db_type, filters_first = FALSE)

Arguments

filters

The filters list

db_type

A database type. Must be a valid entry for get_db_type

filters_first

Should the database filters be placed at the beginning of the list?, Default: FALSE

Details

The function looks in the filters list for entries following the "DBTYPE_filters" pattern where DBTYPE is a long identifier returned by get_db_type. For example, for filters only applied to the banding database, the filters should be named "banding_filters". If a relevant filter is found, it is added to the filters list.

Value

A filters list with the database specific filters added. All other database specific filters are removed if present.

See Also

get_db_type

Examples


filters <-  list(SPEC = "ATBR",
                banding_filters=list(b.year=2010:2019, b.state_name = "Nunavut"),
                recoveries_filters = list(e.country_code = 'US', r.flyway_code = 1))

add_db_filters(filters, "b")
add_db_filters(filters, "r")


Vin985/gblincoln documentation built on April 21, 2022, 1:49 a.m.