2

Given vector x as:

x = c(5, 7, 8, 9, 2, 3)

I want to get the index of x, which x value is bigger than 7

The result I expect:

2, 3, 4

I have tried

Position[x >= 7, x]

But I get the error:

Error in Position[x >= 7, x] : 
  object of type 'closure' is not subsettable
hou
  • 21
  • 1
  • `Position` is a function, but in your code, you suppose it is an object. You need to use `()` instead of `[]`. However, you need to define a function in order to use `Position`. –  Aug 20 '15 at 03:05
  • 4
    I think you just want `which(x>=7)` – MrFlick Aug 20 '15 at 03:07

0 Answers0