db_getLinkColumns: retrieves the specified columns from the 'right' table when...

View source: R/dbAccess.R

db_getLinkColumnsR Documentation

retrieves the specified columns from the 'right' table when the IDs from the 'left' table are provided or vice versa. So gets the columns from the other table that where the ID's are linked/matched

Description

retrieves the specified columns from the 'right' table when the IDs from the 'left' table are provided or vice versa. So gets the columns from the other table that where the ID's are linked/matched

Usage

db_getLinkColumns(
  db,
  linkedTableName,
  hasPrimaryKey = FALSE,
  tableName,
  columns = NA,
  primaryKey = defaultPrimaryKey(),
  left = TRUE,
  leftID = NA,
  rightID = NA,
  IDs = NA
)

Arguments

db

database access 'handle'

linkedTableName

name of the 'link' table to use

hasPrimaryKey

specifies if the 'link' table has a primary key, default is FALSE

tableName

specfies the name of the table from where to get the columns via the ID's specified by the 'link' table

columns

specifies which columns to retrieve from the table specified by tableName

primaryKey

specifies the name of the primary key of the table specified by tableName. These will be used to retrieve the right rows from the table

left

if TRUE then the provided ID's are from the 'left' table and the corresponding ID's from the 'right' table are retrieved. If FALSE then it's vice versa

leftID

name of the ID column in the left table to be used, if NA, the column 1 is used

rightID

name of the ID column in the right table to be used, if NA, the column 2 is used

IDs

integer vector specifying the IDs that need to be 'matched'. If an ID is not present, then it will not generate anything

Value

integer vector

Note

if not specified, then leftID is always column 1, rightID is always column 2


BenBruyneel/BBPersonalR documentation built on Aug. 23, 2024, 8:28 p.m.