Re: [R] Assigning entries to categories

2010-07-05 Thread LogLord
Gabor Grothendieck wrote: > > On Mon, Jul 5, 2010 at 8:54 AM, LogLord wrote: >> >> OK, thanks for the help! >> >> Here a more complex example: >> >> a=c("x","y","z") >> b=c(8,14,19) >> c=c(200010,535388,19929) >> data=data.frame(a,b,c) >> >> d=c("cat1","cat2","cat3","cat4","cat5","cat6") >> b1=

Re: [R] Assigning entries to categories

2010-07-05 Thread Gabor Grothendieck
On Mon, Jul 5, 2010 at 8:54 AM, LogLord wrote: > > OK, thanks for the help! > > Here a more complex example: > > a=c("x","y","z") > b=c(8,14,19) > c=c(200010,535388,19929) > data=data.frame(a,b,c) > > d=c("cat1","cat2","cat3","cat4","cat5","cat6") > b1=c(14,5,8,20,19,1) > c_start=c(50,50,2

Re: [R] Assigning entries to categories

2010-07-05 Thread David Winsemius
On Jul 5, 2010, at 8:54 AM, LogLord wrote: OK, thanks for the help! Here a more complex example: a=c("x","y","z") b=c(8,14,19) c=c(200010,535388,19929) data=data.frame(a,b,c) d=c("cat1","cat2","cat3","cat4","cat5","cat6") b1=c(14,5,8,20,19,1) c_start=c(50,50,20,20,18000,6000

Re: [R] Assigning entries to categories

2010-07-05 Thread LogLord
OK, thanks for the help! Here a more complex example: a=c("x","y","z") b=c(8,14,19) c=c(200010,535388,19929) data=data.frame(a,b,c) d=c("cat1","cat2","cat3","cat4","cat5","cat6") b1=c(14,5,8,20,19,1) c_start=c(50,50,20,20,18000,60) c_stop=c(55,55,201000,201000,2,

Re: [R] Assigning entries to categories

2010-07-03 Thread Charles C. Berry
On Sat, 3 Jul 2010, LogLord wrote: Thanks for your help! You are right it is not one-to-one assigned that would be indeed very easy... its more like assigning 1000 entries to 60 categories... Unfortunately, the ?match and ?merge did not help me a lot... I am a newbie to such programming stuff

Re: [R] Assigning entries to categories

2010-07-03 Thread LogLord
Thanks for your help! You are right it is not one-to-one assigned that would be indeed very easy... its more like assigning 1000 entries to 60 categories... Unfortunately, the ?match and ?merge did not help me a lot... I am a newbie to such programming stuff in R. It would be great if you could

Re: [R] Assigning entries to categories

2010-07-01 Thread Charles C. Berry
On Thu, 1 Jul 2010, LogLord wrote: As requested, here is some example data: a=c("x","y","z") b=c(1,5,8) c=c(200010,535388,19929) data=data.frame(a,b,c) d=c("cat1","cat2","cat3") b1=c(1,5,8) c_start=c(20,50,60) c_stop=c(201000,55,70) category=data.frame(d,b1,c_start,c_stop)

Re: [R] Assigning entries to categories

2010-07-01 Thread LogLord
As requested, here is some example data: a=c("x","y","z") b=c(1,5,8) c=c(200010,535388,19929) data=data.frame(a,b,c) d=c("cat1","cat2","cat3") b1=c(1,5,8) c_start=c(20,50,60) c_stop=c(201000,55,70) category=data.frame(d,b1,c_start,c_stop) I want to add a variable into data, w

[R] Assigning entries to categories

2010-06-30 Thread LogLord
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 th