join_results: Join results from a database into an existing dataframe.

Description Usage Arguments Value Examples

Description

'join_results()' queries a database for matches to a column in the supplied dataset and returns it together with the matches found.

Usage

1
join_results(df, query_col, database, match_cols, select_cols = NULL)

Arguments

df

A data.frame or tibble. The data used for querying the database.

query_col

A character vector of length one. Name of the column in 'df' that will be used to query the database.

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'.

select_cols

A character vector of column names in the database that will be merged in the ouput.

Value

The input dataframe merged with the selected matching columns from the database.

Examples

1
2
3
4
d <- data.frame(a = 1:3, b = c("FLG", "SGK2", "CDK1"))
join_results(d, "b", hgnc,
  match_cols = c("symbol", "alias_symbol", "prev_symbol"),
  select_cols = c("entrez_id", "symbol", "refseq_accession"))

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