getGroupID {grpSLOPE} | R 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"
[Package grpSLOPE version 0.3.3 Index]