Extends dplyr::pull() to extract a column from the sampleTable of a qseaSet.

# S3 method for class 'qseaSet'
pull(.data, var = -1, name = NULL, ...)

Arguments

.data

qseaSet. A qseaSet object whose sampleTable column should be extracted.

var

Column to extract (name or position). Default: -1 (last column).

name

Optional column to use for names in the returned vector. Default: NULL (no names).

...

Additional arguments passed to dplyr::pull(). Default: none.

Value

A vector with length equal to the number of samples in the qseaSet. If name is provided, the vector is named accordingly.

Examples

data(exampleTumourNormal, package = "mesa")

# Pull the 'group' column as a vector
exampleTumourNormal %>% pull(group)
#>  [1] "Colon1_N" "Colon1_T" "Colon2_N" "Colon2_T" "Lung1_N"  "Lung1_T" 
#>  [7] "Lung2_N"  "Lung2_T"  "Lung3_N"  "Lung3_T" 

# Pull by column position (last column by default)
exampleTumourNormal %>% pull()
#>  [1] NA    "III" NA    "IV"  NA    "IIA" NA    "IA"  NA    "IB" 

# Pull a column and name it by sample_name
exampleTumourNormal %>% pull(group, name = sample_name)
#>   Colon1_N   Colon1_T   Colon2_N   Colon2_T    Lung1_N    Lung1_T    Lung2_N 
#> "Colon1_N" "Colon1_T" "Colon2_N" "Colon2_T"  "Lung1_N"  "Lung1_T"  "Lung2_N" 
#>    Lung2_T    Lung3_N    Lung3_T 
#>  "Lung2_T"  "Lung3_N"  "Lung3_T"