indexing - How to get values in a data range in R -


i have table goes follows:

zip code approvalrate ...

75229 0.32 ...

i split approval rate quantiles, discounting zip codes approval rate 0 or 100%, breaks 0.0303 0.3333 0.4394 0.5060 0.6190 0.9524 naming very low, low, med, high, high

now make new vector of lowzip zip codes approval rate falls low range of 0.0303 - 0.3333

i have tried

idxlow = which(0.0303 <= approval & approval <= 0.333)

and

ziplow = mydata[idxlow, 1]

but have think there better way.

just:

 mydata[0.0303 <= approval & approval <= 0.333, 1] 

should work.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -