How to slice the array with the condition? For example, in perl I can get the elements greater than 2. $ perl -le '@x=(1,2,3,4,5);@y=grep {$_>2} @x;print "@y"' 3 4 5 in R I know which(x>2), but it will return the indexes instead of an array. Thanks again. Alice [[alternative HTML version deleted]]