[R] Assigning entries to categories

LogLord nils.schoof at web.de
Wed Jun 30 12:15:22 CEST 2010


Hi,

I have the following problem:
I have a large dataframe where each row is specified by two numerical value
(one 1:25 and the other one large specific number (e.g. 203043)). I have a
list of 60 categories which are also assigned to one of the first numerical
value (1:25) but have a range for the second numerical value  (e.g. 200020 -
208040) in two different columns.

I want now to assign a category to each row in a new variable by testing for
accordance to the first numerical value and overlap of the second numerical
value with the range.

For example:
entry1 has numerical value 1 = 15 and numerical value 2 = 200050.
This would be assigned to category3, which has a numerical value 1 = 15 and
a range for numerical value 2 = 200000 - 201000.

It would be great if any one could help me out with this.

Thanks!



-- 
View this message in context: http://r.789695.n4.nabble.com/Assigning-entries-to-categories-tp2272697p2272697.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list