Hi,
On Friday 28 July 2006 20:21, Horace Tso wrote:
> Unless there is another level of complexity that i didn't see here,
> wouldn't it be a simply application of sapply as follow,
>
> sapply( 1:dim(M2)[[1]], function(x) M1[M2[x,1], M2[x,2]] )
Andy's previous answer involving matrix indexing (M1[
Unless there is another level of complexity that i didn't see here,
wouldn't it be a simply application of sapply as follow,
sapply( 1:dim(M2)[[1]], function(x) M1[M2[x,1], M2[x,2]] )
Hope this helps.
Horace
>>> "Camarda, Carlo Giovanni" <[EMAIL PROTECTED]> 7/28/2006 9:40 AM
>>>
Dear R-users,
Yes, by matrix indexing:
R> M1[M2]
[1] 1 2 13 15 8
R> v
[1] 1 2 13 15 8
Andy
From: Camarda, Carlo Giovanni
>
> Dear R-users,
>
> likely there is a simple solution for this problem, but I currently
> cannot see it.
>
> I basically would like to get from a matrix values in particular
> p