Filter-classes: Filter framework for the ATC database

NameFilter-classR Documentation

Filter framework for the ATC database

Description

The filter objects (extending the BasicFilter from the ensembldb package) listed on this page allow to customize the queries to the ATC database and retrieve specific entries. Filters can be passed with the filter argument to the atcs method. Multiple filters can be combined (and passed as a list to the beforementioned method). The supported filter objects are (in alphabetical order):

AdminrouteFilter

Filter results based on the administration route of (level 5) entries (such as "O" for oral).

KeyFilter

Filter results based on the ATC key.

LevelFilter

Filter results based on the ATC level.

NameFilter

Filter results based on the name of the entry.

KeyFilter and NameFilter both allow to perform also pattern matching queries by setting condition="like" and using a percentage sign as wild card (e.g. instead of *).

Usage


AdminrouteFilter(value, condition="==")
KeyFilter(value, condition="==")
LevelFilter(value, condition="==")
NameFilter(value, condition="==")

Arguments

(in alphabetic order)

condition

The condition for the filter. For character values: "=", "!=", "in", "not in", "like", for numeric values: "=", "<=", "<", ">", ">=", "in", "not in".

db

The AtcDb object from which the data should be retrieved.

object

A filter object (either AdminrouteFilter, KeyFilter, LevelFilter or NameFilter).

with.tables

Optional argument; for internal use.

value

The value for the filter (against which database entries are compared against, based on the filter's condition argument).

...

Presently not used.

Value

Refer to the method and function description above for detailed information on the returned result object.

Objects of the class

Filter objects should be created using the constructor functions KeyFilter, LevelFilter and NameFilter.

Methods

All classes inherit all methods from the AnnotationFilter class.

(in alphabetic order)

AdminrouteFilter

Creates and returns a new AdminrouteFilter instance.

KeyFilter

Creates and returns a new KeyFilter instance.

LevelFilter

Creates and returns a new LevelFilter instance.

NameFilter

Creates and returns a new NameFilter instance.

Author(s)

Johannes Rainer.

Examples


## Create a simple KeyFilter
kf <- KeyFilter("R07")
kf

## Define a filter for all keys starting with R07
kf <- KeyFilter("R07", condition = "startsWith")
kf


jotsetung/atc documentation built on July 29, 2022, 6:57 p.m.