Re: [R] Reducing dimension of a list object

From: Ivan Calandra <ivan.calandra_at_uni-hamburg.de>
Date: Tue, 19 Apr 2011 17:16:53 +0200

Hi,

Would unlist() do what you want?
unlist(lis3)
[1] 4 1 8

HTH,
Ivan

Le 4/19/2011 17:32, Bogaso Christofer a écrit :
> Hi all, I generally use the Reduce() function to reduce the dimension of
> list object. However in my current session I have few objects which are
> actually list of list of list..(say n step). If I reduce their dimension
> then I have call Reduce() function many times. Therefore my question is, is
> there any 1-step way to reduce the dimension at the lowest level? Take this
> example:
>
>
>
> lis1<- list(4)
>
> lis2<- list(1,8)
>
> lis3<- list(lis1, lis2)
>
>
>
> # Now I want to reduce the dimension of lis3 to a column vector:
>
>
>
>> Reduce("c", Reduce("c", lis3))
> [1] 4 1 8
>
>
>
> I want to have some mechanism so that I need not to call reduce() function
> twice. Is there any way to do that?
>
>
>
> Thanks and regards,
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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.
>

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra_at_uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php

______________________________________________
R-help_at_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.
Received on Tue 19 Apr 2011 - 15:19:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Apr 2011 - 15:50:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive