Re: [R] Efficient Binning

2017-07-14 Thread Jeff Newmiller
?cut cut( 0.51, boundaries ) You can also use as.integer to convert the resulting factor to an integer. -- Sent from my phone. Please excuse my brevity. On July 14, 2017 7:10:59 AM PDT, Dan Abner wrote: >Hi all, > >I have a situation where I have 16 bins. I generate a random number and >then

Re: [R] Efficient Binning

2017-07-14 Thread Marc Schwartz
> On Jul 14, 2017, at 9:10 AM, Dan Abner wrote: > > Hi all, > > I have a situation where I have 16 bins. I generate a random number and > then want to know which bin number the random number falls in. Right now, I > am using a serious of 16 if() else {} statements which get very complicated > w

[R] Efficient Binning

2017-07-14 Thread Dan Abner
Hi all, I have a situation where I have 16 bins. I generate a random number and then want to know which bin number the random number falls in. Right now, I am using a serious of 16 if() else {} statements which get very complicated with the embedded curly braces. Is there a more efficient (i.e., e