filter_database: Performs filtering on a dataset

View source: R/prepare_data.R

filter_databaseR Documentation

Performs filtering on a dataset

Description

Apply a list of filters to a database

Usage

filter_database(
  db,
  filters = NULL,
  columns = NULL,
  use_default_filters = TRUE,
  db_type = NULL,
  filters_first = FALSE
)

Arguments

db

PARAM_DESCRIPTION

filters

a list of filters. Each entry should have a name that represents a column name, associated with the values you want to keep. Please see check_columns to see what column names are accepted, Default: NULL

columns

A dataframe that contains equivalence between Gamebirds columns and the package ones. This will be passed to check_columns Default: NULL

use_default_filters

Should the function add a default value to the filters? See the object DEFAULT_LINCOLN_VALUES for the default values. Default: TRUE

db_type

The type of database used if database specific filters are defined, Default: NULL

filters_first

If default filters or database specific filters are used, should they be treated first?, Default: FALSE

Details

For time columns, i.e. 'year', 'month_code' and 'day_code', it is possible to select a period by providing a vector with two named values 'start' and 'end'. If a filter is NULL, it will be skipped.

Value

A filtered dataframe


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