Skip to content

Retrieving locations of element of a vector or matrix

3 messages · Yemi Oyeyemi, Henrique Dallazuanna

#
I think that you can use:

x <- sample(1:20, 10)
head(sort(x), 5) #First 5 minimum values
head(sort(x, decreasing = TRUE), 5) #First 5 maximum values
On 31/03/2008, Yemi Oyeyemi <gmoyeyemi at yahoo.com> wrote:

  
    
#
For the position use order indeed of sort
On 31/03/2008, Henrique Dallazuanna <wwwhsd at gmail.com> wrote: