Skip to contents

Elements are identified by their respective row name.

Usage

createGroupByAttribute(col, dataset)

Arguments

col

Character: column name

dataset

Matrix or data frame: dataset

Value

Named list with each unique value from a given column and respective elements

Examples

df <- data.frame(gender=c("male", "female"),
                 stage=paste("stage", c(1, 3, 1, 4, 2, 3, 2, 2)))
rownames(df) <- paste0("subject-", LETTERS[1:8])
createGroupByAttribute(col="stage", dataset=df)
#> $`stage 1`
#> [1] "subject-A" "subject-C"
#> 
#> $`stage 2`
#> [1] "subject-E" "subject-G" "subject-H"
#> 
#> $`stage 3`
#> [1] "subject-B" "subject-F"
#> 
#> $`stage 4`
#> [1] "subject-D"
#>