Learn R Programming

wrMisc (version 1.2.3)

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, callFrom = NULL)

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

callFrom

(character) allows easier tracking of message(s) produced

Value

matrix or data.frame

See Also

rbind in cbind

Examples

Run this code
# NOT RUN {
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