[R] Assigning entries to category

From: LogLord <nils.schoof_at_web.de>
Date: Wed, 30 Jun 2010 04:52:36 -0700 (PDT)

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-category-tp2272707p2272707.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 30 Jun 2010 - 11:54:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Jun 2010 - 16:40:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive