Re: [R] problems with data frames, factors and lists

2008-05-21 Thread jim holtman
Try this: doset <- function(sameset) { do.call(rbind, lapply(unique(c(sameset$APID, sameset$BPID)), function(.pid) mix(sameset, .pid))) } On Wed, May 21, 2008 at 11:33 AM, Karin Lagesen <[EMAIL PROTECTED]> wrote: > > I have a function that creates a list based on some clustered data:

[R] problems with data frames, factors and lists

2008-05-21 Thread Karin Lagesen
I have a function that creates a list based on some clustered data: mix <- function(Y, pid) { hc = gethc(Y,pid) maxheight = max(hc$height) noingrp = processhc(hc) one = noingrp$one two = noingrp$two twoisone = "one" if (two != 1) twoisone = "more" out = list(pid = pid,one = noingrp$one, two = n