[R] Finding positions in array

Erich Neuwirth erich.neuwirth at univie.ac.at
Tue Mar 30 18:14:31 CEST 2010


which(y>7)

z<-which(y>7)


On 3/30/2010 2:54 PM, Romildo Martins wrote:
> Hello,
> 
> I need a function to check what positions of the array are greater than "y"
> and return to positions in another array "z".
> 
>> x<-array(E(gaux)$weight)
>> x
> [1]  3  8 10  6
> 
> If y = 7
> 
>> z
> [1] 2 3
> 
> 
> Thanks a lot!
> 
> Romild
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-39464 Fax: +43-1-4277-39459



More information about the R-help mailing list