Re: [R] How to create a column in dependence of another column

2012-10-09 Thread William Dunlap
tfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Rui Barradas > Sent: Tuesday, October 09, 2012 9:54 AM > To: fxen3k > Cc: r-help@r-project.org > Subject: Re: [R] Ho

Re: [R] How to create a column in dependence of another column

2012-10-09 Thread Rui Barradas
Hello, As for creating the new variable try dataSet <- within(dataSet, deal_category <- ifelse(trans_value < 200, "low", ifelse(trans_value < 500, "medium", "high"))) And the rest seems ok. Run the code and see if it is. Hope this helps, Rui Barradas Em 09-10-2012 10:25, fxen3k escrev

[R] How to create a column in dependence of another column

2012-10-09 Thread fxen3k
Hi there, I'm sorry for the bad subject decision. Couldn't describe it better... In my dataset called "dataSet" I want to create a new variable column called "deal_category" which depends on another column called "trans_value". In column "trans_value" I have values in USDm. Now what I want to do