how about ?

for(i in 1:3)
{
b[[i]][[3]] <- 3
}

or:

for(i in 1:3)
{
b[[i]][[3]] <- a[[i]]
}






On Tue, Jun 30, 2009 at 6:54 AM, Ivo Shterev <idc318@yahoo.com> wrote:

>
> Dear All,
>
> I am interested to know how assign a list to a list of lists. For example
> how to assign the list a = list(3,3,3) to the list b:
>
> > b
> [[1]]
> [[1]][[1]]
> [1] 0
>
> [[1]][[2]]
> [1] 0
>
> [[1]][[3]]
> [1] 0
>
>
> [[2]]
> [[2]][[1]]
> [1] 0
>
> [[2]][[2]]
> [1] 0
>
> [[2]][[3]]
> [1] 0
>
>
> [[3]]
> [[3]][[1]]
> [1] 0
>
> [[3]][[2]]
> [1] 0
>
> [[3]][[3]]
> [1] 0
>
> so that after the assignment
>
> > b
> [[1]]
> [[1]][[1]]
> [1] 0
>
> [[1]][[2]]
> [1] 0
>
> [[1]][[3]]
> [1] 3
>
>
> [[2]]
> [[2]][[1]]
> [1] 0
>
> [[2]][[2]]
> [1] 0
>
> [[2]][[3]]
> [1] 3
>
>
> [[3]]
> [[3]][[1]]
> [1] 0
>
> [[3]][[2]]
> [1] 0
>
> [[3]][[3]]
> [1] 3
>
> Thanks a lot!
> Ivo
>
> ______________________________________________
> 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.
>



-- 
----------------------------------------------


My contact information:
Tal Galili
Phone number: 972-50-3373767
FaceBook: Tal Galili
My Blogs:
http://www.r-statistics.com/
http://www.talgalili.com
http://www.biostatistics.co.il

	[[alternative HTML version deleted]]


