do.add.cols | R Documentation |
do.add.cols
do.add.cols(dat, base.col, add.dat, add.by, rmv.ext)
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. |
Returns the data.table with new columns embedded.
Thomas M Ashhurst, thomas.ashhurst@sydney.edu.au
https://github.com/ImmuneDynamics/Spectre.
library(data.table)
dat <- Spectre::demo.clustered[,1:19]
add.dt <- data.table('Files' = unique(dat$FileName),
'SampleNumber' = c(1:12))
cell.dat <- do.add.cols(dat = dat,
base.col = "FileName",
add.dat = add.dt,
add.by = "Files")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.