Aamir Khan Aamir Khan - 1 year ago 125
R Question

Alternate to match function in R that returns list of indexes

I am using

R 3.5

I want to get all indexes that contain zero in my list

a = c(1,2,3,0,5,7,0)

result should be

[1] 4 7

should return the indexes as
will only return the first index in this case

Answer Source

You shoud read about function which:

> a = c(1,2,3,0,5,7,0)
> which(a == 0)
[1] 4 7
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download