[R] Deciles and R

From: Nuno Soares <ndsoares_at_mail.telepac.pt>
Date: Fri 22 Apr 2005 - 01:06:32 EST

Hi everyone,

I'm a new R user (if this is a really basic question, please do excuse me...) and I'm having some questions regarding a deciles problem.

I have a variable which I need to categorize according to its deciles (X). However, this categorization should be made into another variable (call it NewVar).

Ex. for the quartiles case (just for the sake of exposition, since I need deciles...), I would like to be able to generate the NewVar variable based on the quantiles of X:

	X		NewVar
	1		1
	6		2
	2		1
	4		2
	3		1
	5		2
	12		4
	9		3
	8		3
	10		4
	11		4
	7		3

Is there a function or a way of doing this automatically? I've searched the help files but found no solution to this problem...



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Apr 22 01:22:08 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:21 EST