Social Media Research

02 R Data Analysis


Question

What does the which() function do ?


Answer

Returns the index of all elements in a vector or array matching the condition

> v1
 [1]  1  2  3  4  5  6  7  8  9 10
> which(v1 > 5)
[1]  6  7  8  9 10



Comments