title: Finding Index from Vector/Matrix or Dataframe in R
body: <p>I have data in R as follow:</p>
  <pre><code>data &lt;- c(1,12,22,0,8,1,0,0)
  </code></pre>
  <p>Is there any way to index the data to find the index for element that is greater than 0? So the result will be:</p>
  <pre><code>1 2 3 5 6
  </code></pre>
  <p>I tried to use as.factor(data), but it will take several more step to get the result that I aim for. Thanks.</p>