Learn R Programming

grpSLOPE (version 0.3.3)

getGroupID: Get a groupID object

Description

Mostly intended for internal use.

Usage

getGroupID(group)

Value

An object of class groupID, which is a list, whose members are vectors of indices corresponding to each group. The names of the list members are the corresponding group names.

Arguments

group

A vector describing the grouping structure. It should contain a group id for each predictor variable.

Examples

Run this code
group  <- c("A", "A", 2, 9, "A", 9, 9, 2, "A")
group.id <- getGroupID(group)
group.id
# $A
# [1] 1 2 5 9
# 
# $`2`
# [1] 3 8
# 
# $`9`
# [1] 4 6 7
# 
# attr(,"class")
# [1] "groupID"

Run the code above in your browser using DataLab