getGroupID: Get a groupID object

View source: R/utils.R

getGroupIDR Documentation

Get a groupID object

Description

Mostly intended for internal use.

Usage

getGroupID(group)

Arguments

group

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

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.

Examples

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"


agisga/grpSLOPE documentation built on June 3, 2023, 10:16 a.m.