Skip to contents

This function takes a list of signature objects (each containing a named numeric vector under Signature) and combines them into a single data frame. Each column in the resulting data frame represents one signature, and the column names are assigned based on a specified identifier field.

Usage

SigList2df(SigList, SigName = "id")

Arguments

SigList

A list of signature objects, each containing an id, PrimaryName, SecondaryName, and a named numeric vector Signature.

SigName

A character string specifying which identifier to use as column names in the output data frame. Must be one of "id", "PrimaryName", or "SecondaryName". Default is "id". "id" is recommended for consistence in the following use.

Value

A data frame where each column corresponds to a signature, and each row corresponds to a detector channel.

Examples

if (FALSE) { # \dontrun{
sig1 <- list(id = "FITC_CD3", PrimaryName = "FITC", SecondaryName = "CD3",
             Signature = c(D1 = 0.2, D2 = 0.8))
sig2 <- list(id = "PE_CD4", PrimaryName = "PE", SecondaryName = "CD4",
             Signature = c(D1 = 0.5, D2 = 0.5))
sig_df <- SigList2df(list(sig1, sig2), SigName = "id")
} # }