Dear Marco,
Try this:


# Data
t1 <- list(A=c(4,1,4),B=c(3,7,9,2))

# Processing
res=data.frame(
t1=do.call(c,t1),
levels=rep(c(1,2),do.call(c,lapply(t1,function(x) length(x))))
)
rownames(res)=NULL
res


HTH,

Jorge



On Tue, Nov 18, 2008 at 10:15 PM, Blanchette, Marco <
MAB@stowers-institute.org> wrote:

> I am pretty sure that I came across a function that creates a vector of
> levels from a list but I just can't remember.
>
> Basically, I have something like
>
> > t <- list(A=c(4,1,4),B=c(3,7,9,2))
> > t
> $A
> [1] 4 1 4
>
> $B
> [1] 3 7 9 2
>
> And I would like to get something like the following:
> t levels
> 4 1
> 1 1
> 4 1
> 3 2
> 7 2
> 9 2
> 2 2
>
> I tried unlist without success. I also do remember that there is a
> corresponding function that create a list of t's according to the level from
> the matrix a draw but no luck to remember it.
>
> Thanks
>
> --
> Marco Blanchette, Ph.D.
> Assistant Investigator
> Stowers Institute for Medical Research
> 1000 East 50th St.
>
> Kansas City, MO 64110
>
> Tel: 816-926-4071
> Cell: 816-726-8419
> Fax: 816-926-2018
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

