[R] ask a question about list in R project

David Winsemius dwinsemius at comcast.net
Tue Jun 29 05:04:23 CEST 2010


There was a recent fortune suggestion along the lines of any simple  
English sentence can probably be satisfied with a simple set of R  
functions without loops. In this case you appear to be forgetting the  
"simple English sentence" part of that formulation.


-- 
David.

On Jun 28, 2010, at 7:37 PM, song song wrote:

> my list al is as below:
> mylist=list(c(2,3),5,7)
>> mylist
> [[1]]
> [1] 2 3
>
> [[2]]
> [1] 5
>
> [[3]]
> [1] 7
>
> How could I get the following FOUR lists:
>
> First one
> [[1]]
> [1] 3
>
> [[2]]
> [1] 5
>
> [[3]]
> [1] 7
>
> Second one
> [[1]]
> [1] 2
>
> [[2]]
> [1] 5
>
> [[3]]
> [1] 7
>
> Third One
> [[1]]
> [1] 2 3
>
> [[2]]
> [1] 7
>
> Last one
> [[1]]
> [1] 2 3
>
> [[2]]
> [1] 5
>
> Do I have to use 'for' loops? Please give me sone suggestions!
>
> Thank you all!!!!!
>
> 	[[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.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list