Learn R Programming

strvalidator (version 0.3.0)

addData: Adds new data columns to a data frame

Description

addData Adds columns in 'newData' to 'data' by column 'byCol'.

Usage

addData(data, newData, byCol, thenByCol = NULL,
    exact = TRUE, ignoreCase = TRUE, debug = FALSE)

Arguments

data
Data frame containing your main data.
newData
Data frame containing information you want to add to 'data'.
byCol
character, key column.
thenByCol
character, key column level 2.
exact
logical, TRUE matches keys exact.
ignoreCase
logical, TRUE ignore case.
debug
logical indicating printing debug information.

Value

  • data.frame the original data frame containing additional columns.

Details

Information in columns in data frame 'newData' is added to data frame 'data' based on value in column 'byCol' and optionally on 'thenByCol'.

Examples

Run this code
# Get marker names for Promega PowerPlex ESX 17.
x <- data.frame(Marker = getKit("ESX17")$locus)
# Get offsets for Promega PowerPlex ESX 17.
y <- data.frame(Marker = getKit("ESX17")$locus, Offset = getKit("ESX17")$offset)
# Get other kit information using string name.
z <- addData(data=x, newData=y, byCol="Marker")
print(x)
print(y)
print(z)

Run the code above in your browser using DataLab