I have numeric vector z and I want to factorize it using z$breaks which I got from histograms breaks. Is there an elegant way to do this ? I, probably, could write a loop and check if z hits into some interval and replace z with value of z$mids, but I suspect there is more R-ish way. Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg at sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83
Oleg Bartunov <oleg <at> sai.msu.su> writes:> I have numeric vector z and I want to factorize it using z$breaksHave a look at: ?cut
On Mon, 29 Mar 2004, Gabor Grothendieck wrote:> Oleg Bartunov <oleg <at> sai.msu.su> writes: > > I have numeric vector z and I want to factorize it using z$breaks > > Have a look > at: > > ?cutThanks for pointers, this is what I needed.> > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg at sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83