R find n largest code example
Example: R find n largest
order(vector, decreasing=TRUE)[1:N] # for positive values
order(abs(vector), decreasing=TRUE)[1:N] # for pos & neg
order(vector, decreasing=TRUE)[1:N] # for positive values
order(abs(vector), decreasing=TRUE)[1:N] # for pos & neg