addVariable {scRepertoire} | R Documentation

## Adding variables after the combination of contigs.

### Description

This function adds variables to the product of combineTCR() combineBCR() or expression2List() to be used in later visualizations. For each element, the function will add a column (labled by name) with the variable. The length of the variable paramater needs to match the length of the combined object.

### Usage

    addVariable(df, name = NULL, variables = NULL)

### Arguments

`df` | The product of combineTCR() combineBCR() or expression2List().
`name` | The column header to add.
`variables` | The exact values to add to each element of the list.

### Value

list of contigs with a new column (name).

### Examples

    x <- contig_list
    combined <- combineTCR(x, rep(c("PX", "PY", "PZ"), each=2),
    rep(c("P", "T"), 3), cells ="T-AB")
    combined <- addVariable(combined, name = "batch", variables = c(1,1,1,1,2,2))

[Package scRepertoire version 1.0.0 Index]