Description Usage Arguments Value Examples
Aggregate data using data.table functions – summarises the mean, median, or sum expression of each marker on each cluster/population
1 | do.aggregate(dat, use.cols, by, func, dt)
|
dat |
NO DEFAULT. A data.table (or data.frame) containing the data to be aggregated. |
use.cols |
NO DEFAULT. The columns to be used for aggregation. |
by |
NO DEFAULT. The column that contains the cluster/population identities. |
func |
DEFAULT = 'median'. Character, method of aggregation. Can be 'median', 'mean', or 'sum'. |
dt |
DEFAULT = TRUE. If TRUE returns data.table with observations and the use.cols, if false returns data.frame with use.cols, and rownames as the observations |
Returns a new data.table with values of use.cols aggregated per cluster/population.
1 2 3 4 5 6 7 8 9 10 | exp <- do.aggregate(dat = Spectre::demo.clustered,
use.cols = names(demo.clustered)[c(11:19)],
by = "Population")
# Typically followed up by making an expression heatmap
Spectre::make.pheatmap(dat = exp,
file.name = "Pheatmap.png",
plot.title = "Pheatmap",
sample.col = "Population",
plot.cols = names(exp)[c(2:10)])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.