Skip to content
Prev 247290 / 398503 Next

Sorting a vector with conditions

On Jan 13, 2011, at 8:06 PM, ADias wrote:

            
NOT executable R.
> v[v %% 2 !=0] <- sort(v[v %% 2 !=0])
 > v
  [1] 10  1  4  6 13 21 32 27 45  8 14 36
David Winsemius, MD
West Hartford, CT