Le jeudi 15 décembre 2011 à 21:15 +0100, Trying To learn again a écrit :
> Hi all,
>
> I have a matrix
> a<-c(2,3,4,Inf)
>
> > b<-as.matrix(a)
> [,1]
> [1,]2
> [2,]3
> [3,]4
> [4,] Inf
>
> > range(b, finite=TRUE)[2] (this is the maximum)
> [1] 4
>
> There is a pre-def function
Hi all,
I have a matrix
a<-c(2,3,4,Inf)
> b<-as.matrix(a)
[,1]
[1,]2
[2,]3
[3,]4
[4,] Inf
> range(b, finite=TRUE)[2] (this is the maximum)
[1] 4
There is a pre-def function to extract the location (in terms of rows) of
the value in the matrix.
In my example would be
3 (max i
2 matches
Mail list logo