View source: R/rbind_score_list.R
| rbind_score_list | R Documentation |
Allows data from multiple exstra_score objects to be combined, similarly to
rbindlist (data.table) and rbind.
The exstra_score objects may either be given directly to rbind_score, or
as a list to rbind_score_list that is easier to use when the number of objects
to combine is not known in advance.
rbind_score_list( strscore_list, idcol = "data_group", allow_sample_clash = FALSE, fill = FALSE ) rbind_score( ..., idcol = "data_group", allow_sample_clash = FALSE, fill = FALSE )
strscore_list |
A list containing |
idcol |
The name of the column giving the names of |
allow_sample_clash |
If TRUE, allows a sample name to occur multiple times in the
|
fill |
If TRUE, missing columns are filled with NAs. Default FALSE. |
... |
|
An exstra_score object.
rbindlist, rbind
# create a list of distinct samples
score_list <- list(group1 = exstra_wgs_pcr_2[, "WGSrpt_20"],
controls = exstra_wgs_pcr_2[, c("WGSrpt_02", "WGSrpt_04")],
group2 = exstra_wgs_pcr_2[, c("WGSrpt_15", "WGSrpt_16")]
)
combined_scores <- rbind_score_list(score_list)
combined_scores$samples
# Without using a list:
rbind_score(group1 = exstra_wgs_pcr_2[, "WGSrpt_20"],
controls = exstra_wgs_pcr_2[, c("WGSrpt_02", "WGSrpt_04")],
group2 = exstra_wgs_pcr_2[, c("WGSrpt_15", "WGSrpt_16")]
)$samples
# Combining with a repeated sample name, possibly due to multiple experiments.
# Splitting data for this example:
score_1 <- exstra_wgs_pcr_2["DM1", "WGSrpt_15"]
score_2 <- exstra_wgs_pcr_2["HD", "WGSrpt_15"]
# Combine with the sample name repeated across exstra_score objects:
rbind_score_list(list(score_1, score_2), allow_sample_clash = TRUE)
# or
rbind_score(score_1, score_2, allow_sample_clash = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.