get_obs_label: Create a vector of each sample's selected phenotye...

View source: R/pipeline_functions.R

get_obs_labelR Documentation

Create a vector of each sample's selected phenotye descriptive information.

Description

get_obs_label creates a vector of each sample's selected phenotype descriptive information. This is a helper function for data visualization.

Usage

get_obs_label(phe_info, use_col, collapse = "|")

Arguments

phe_info

data.frame, the phenotype data of the samples. It is a data frame that can store any number of descriptive columns (covariates) for each sample row. To get the phenotype data, using the accessor function pData.

use_col

a vector of numerics or characters. Users can select the interested descriptive column(s) by calling index or name of the column(s).

collapse

character, an optional character string to separate the results when the length of use_col is more than 1. Not NA_character. Default is "|".

Value

Return a vector of selected phenotype descriptive information (covariates) for each sample. Vector name is the sample name.

Examples

analysis.par <- list()
analysis.par$out.dir.DATA <- system.file('demo1','driver/DATA/',package = "NetBID2")
NetBID.loadRData(analysis.par=analysis.par,step='ms-tab')
phe_info <- Biobase::pData(analysis.par$cal.eset)
use_obs_class <- get_obs_label(phe_info = phe_info,'subgroup')
print(use_obs_class)
## Not run: 


jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.