Dear Catalina,
At 02:46 PM 10/23/2002 +0200, Catalina Mesina wrote:
Dear all,
I have a very simple question.
Suppose that we have a matrix
m<-matrix(1:12,ncol=3)
> m
[,1] [,2] [,3]
[1,] 1 5 9
[2,] 2 6 10
[3,] 3 7 11
[4,] 4 8 12
Is there any function in Splus that can give me which is the line and the
column where element 10, for example, is situated?
You can use the functions row and col in the following manner:
row(m)[m == 10]
col(m)[m == 10]
I hope that this helps,
John
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox@mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
|