[R] How to flatten a tree (based on list) to a certain depth?
pengyu.ut at gmail.com
Wed Feb 3 20:39:42 CET 2010
On Wed, Feb 3, 2010 at 12:26 PM, Bert Gunter <gunter.berton at gene.com> wrote:
> RTFM (?unlist -- the "recursive" parameter)
> and do it with a loop however many times you like.
How do you know that I didn't read the manual? I didn't quite get my
question. Please see my response to Steve.
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
> Behalf Of Peng Yu
> Sent: Wednesday, February 03, 2010 10:20 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] How to flatten a tree (based on list) to a certain depth?
> Suppose that I have the following list of lists of frames 'root'
> (let's call it a 'tree' of frames). I want to flatten it to be a list
> of frames. However, if I unlist(root), it will flatten the frames as
> well. Is there a simply way to flatten the tree to certain depth?
> main1=list(sub1=aframe1, sub2=aframe2)
> root=list(main1=main1, main2=main2)
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help