iterative_select: Iteratively query a database for matches to a query vector.

Description Usage Arguments Value Examples

View source: R/select.R

Description

'iterative_select()' returns a tibble with all entries of the database that match the query vector in any of the selected columns.

Usage

1
iterative_select(query, database, match_cols, return_all = FALSE)

Arguments

query

A character vector.

database

A data.frame or tibble A database to be queried. See [databases()] for a list of included databases.

match_cols

A character vector. The columns in the data to look for matches with the query. In order of preference, if matches to a column are found, matches to subsequent columns are not reported by default, unless return_all is 'TRUE'.

return_all

A logical indicating whether matches to subsequent columns, after a match has already been found, should also be returned.

Value

A tibble containing all rows of the dataframe that matched a query. The new column 'match__' contains the name of the column that matched the query for this row.

Examples

1
2
3
iterative_select(c("FLG", "SGK2"),
                 hgnc,
                 c("symbol", "alias_symbol", "prev_symbol"))

datarail/genebabel documentation built on Sept. 20, 2019, 3:50 p.m.