do.add.cols: do.add.cols

Description Usage Arguments Value Author(s) References Examples

View source: R/do.add.cols.R

Description

do.add.cols

Usage

1
do.add.cols(dat, base.col, add.dat, add.by, rmv.ext)

Arguments

dat

NO DEFAULT. A data.table (or data.frame) containing the data to have new values added to.

base.col

NO DEFAULT. Name of the column containing values that new values will be matched to.

add.dat

NO DEFAULT. A data table of new values to embed as a new columns, with one column containing values used for matching with the target data.table.

add.by

NO DEFAULT. Character, name of the column in add.dat that is used for matching to the taret dataset.

rmv.ext

DEFAULTS TO FALSE. Logical, can be TRUE or FALSE. Removes a ".csv" or ".fcs" extension from a the 'match.to' vector – especially useful if 'match.to' is a list of sample names that end in .csv or .fcs.

mem.ctrl

DEFAULT = TRUE. Runs gc() (garbage collection) after a number of steps to free up memory that hasn't been released quickly enough.

Value

Returns the data.table with new columns embedded.

Author(s)

Thomas M Ashhurst, thomas.ashhurst@sydney.edu.au

References

https://sydneycytometry.org.au/spectre.

Examples

1
2
3
4
5
6
7
add.dt <- data.table('Files' = unique(Spectre::demo.asinh$FileName),
                     'SampleNumber' = c(1:12))

cell.dat <- do.add.cols(dat = Spectre::demo.asinh,
                        base.col = "FileName",
                        add.dat = add.dt,
                        add.by = "Files")

sydneycytometry/Spectre documentation built on March 20, 2021, 2:15 a.m.