Learn R Programming

wrMisc (version 1.15.3.1)

listGroupsByNames: Organize values into list and sort by names

Description

Sort values of 'x' by its names and organize as list by common names, the names until 'sep' are used for (re)grouping. Note that typical spearators occuring the initial names may need protection by '\' (this is automatically taken care of for the case of the dot ('.') separator).

Usage

listGroupsByNames(x, sep = ".", silent = FALSE, debug = FALSE, callFrom = NULL)

Value

matrix or data.frame

Arguments

x

(list) main input

sep

(character) separator (note that typcal separators may need to be protected, only automatically added for '.')

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

See Also

rbind in cbind

Examples

Run this code
listGroupsByNames((1:10)/5)
ser1 <- 1:6; names(ser1) <- c("AA","BB","AA.1","CC","AA.b","BB.e")
listGroupsByNames(ser1)

Run the code above in your browser using DataLab