Skip to content
Prev 271872 / 398500 Next

automatic selection of object without loop

You have to give more specifications as to what you want to do with
the data that is being processed.  You have values being put into 'q1'
and 'i1' that don't seem to be used in the loop.  Do you just want
these values returned?  You can easily do it "without a loop" using
lapply:

result <- lapply(names(kinderrechte), function(.name){
    # return a list with the result
    list(q1 = kinderrechte[, .name], i1 = get(paste(.name, "_l", sep = "")
})

So what is the problem that you are trying to solve?
On Fri, Sep 16, 2011 at 8:34 AM, jim holtman <jholtman at gmail.com> wrote: