[R] Extracting/setting elements from/in a matrix/array

Laurent Gautier laurent at genome.cbs.dtu.dk
Wed Jan 2 09:01:52 CET 2002


On Mon, 31 Dec 2001, Martin Maechler wrote:

> The solution to your problem has been part of the   S language
> for ever :
> 
>     mat[ cbind(dim1, dim2) ]



I did not know... note: I am not very much knowledgeable about the S
language. What I know from it is through R (for it is rather 'S is not
unlike R' =)   ).

 
> Note that this is mentioned in help("[") and MASS and ...


When I looked for this way to extract elements, I naturally looked at the
help for the indexing of elements ("["), but I checked again in R 1.4.0.
I could not find such a thing mentionned... may be in the S documentation
?



Thanks to all the quick answer on a 31st of december =)





Laurent


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list