Re: [R] Simple list manipulation question

About this list Date view Thread view Subject view Author view Attachment view

From: Gabor Grothendieck (ggrothendieck@myway.com)
Date: Fri 28 May 2004 - 22:56:54 EST


Message-id: <loom.20040528T145609-617@post.gmane.org>

R> L <- list(A=c("AB","BC","CD"),B=c("GF","HG","FH","FJ"))
R> stack(L)
  values ind
1 AB A
2 BC A
3 CD A
4 GF B
5 HG B
6 FH B
7 FJ B
 

Sean Davis <sdavis2 <at> mail.nih.gov> writes:

:
: I have a list of vectors
:
: $A
: "AB" "BC" "CD"
:
: $B
: "GF" "HG" "FH" "FJ"
:
: and I want to convert it into a dataframe of form
:
: A AB
: A BC
: A CD
: B GF
: B HG
: B FH
: B FJ
:
: Just can't quite come up with a nice "R" solution for it.
:
: Thanks,
: Sean

:

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:13 EST