Displaying 1 result from an estimated 1 matches for "l1names".
Did you mean:
ifnames
2005 Jun 14
0
c(recursive=TRUE)
Hi R users,
I am currently using c(...,recursive=TRUE) to handle list-structured
objects.
This allows to represent something like:
> l1 = list(level1=1,level2=list(sub1=1,sub2=2))
as:
> (l1names = names(c(l1,recursive=TRUE)))
[1] "level1" "level2.sub1" "level2.sub2"
Then, one can use:
> (l1names = sapply(l1names,FUN=function(element)
strsplit(element,"\\.")))
$level1
[1] "level1"
$level2.sub1
[1] "level2" "sub1"...