Dear all,
Many thanks for your help.
Regards,
Muhammad Subianto

On this day 5/18/2005 4:57 PM, Liaw, Andy wrote:
> Is this what you want?
>
>
>>split(a, row(a))
>
> $"1"
> [1] 1 5 9
>
> $"2"
> [1]  2  6 10
>
> $"3"
> [1]  3  7 11
>
> $"4"
> [1]  4  8 12
>
> Andy


On this day 5/18/2005 5:15 PM, [EMAIL PROTECTED] wrote:
Look at ?assign, one possible answer is shown in the examples.  Modified for
your example:

for (i in 1:nrow(a)) {
        nam <- paste("r",i, sep=".")
        assign(nam, a[i,])
}

would give you four separate objects r.1 to r.4 containing the 4 vectors.
Not sure if that's exactly what you wanted though.
Norm

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

Reply via email to