on: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
>> Im
>> Auftrag von Michael Bedward
>> Gesendet: Donnerstag, 11. November 2010 10:56
>> An: friedericksen.h...@gmail.com
>> Cc: r-h...@stat.math.ethz.ch
>> Betreff: Re: [R] How to get a speci
richt-
>> Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im
>> Auftrag von Michael Bedward
>> Gesendet: Donnerstag, 11. November 2010 10:56
>> An: friedericksen.h...@gmail.com
>> Cc: r-h...@stat.math.ethz.ch
>> Betreff: Re: [R] How
Hi Ivan,
thank you very much for your detailed explanations and response!
Please excuse, that I did not include a reproducible example.
Yes, what I am looking for is such a function - but I suspect, that it does not
exist already, so I have to write it on my own.
Best,
Friedericksen
On 11/11/
b=list(b.1=list(b.1.1="a"), b.2="b"),
c="a"
))
# RETRIEVE 'COMPLETE' INDEX (A DATA FRAME; NAMES AND INDEX)
listnames.get(list.obj=my.list, do.basename=TRUE, do.name.chain=TRUE)
# GET RECURSIVE INDEX ONLY
idx <- listbranch.get(list.obj=my.list
Hi Friedericksen,
This function will do it. No doubt there are more elegant ways :)
rmatch <- function(x, name) {
pos <- match(name, names(x))
if (!is.na(pos))
return(x[[pos]])
for (el in x) {
if (class(el) == "list") {
out <- getEl(el, name)
if (!is.null(out)) return(o
Hi,
A reproducible example would have been nice, but a correct code even
more (you forgot some commas)!
So if you meant this:
x <- list(
list(
list(df1,df2),
list(df3,
list(df4,df5)),
list(df6,df7)))
check str(x): (I removes the details of each df)
List of 1
$ :List of 3
..
Hello,
I have a nested named list structure, like the following:
x <- list(
list(
list(df1,df2)
list(df3,
list(df4,df5))
list(df6,df7)))
with df1...d7 as data frames. Every data frame is named.
Is there a way to get a specific named element
7 matches
Mail list logo