Re: [R] Column create and Update using function

2012-07-16 Thread Rantony
F",sep="_") mydat3<-data.frame(cbind(mydat1,mydat2)) mydat3 ABC XYZ ABC_QF XYZ_QF 1 4 6RC 2 7 3 RC #### A.K. - Original Message - From: Rantony <[hidden email]> To: [hidden email] Cc: Sent: Monday, July

Re: [R] Column create and Update using function

2012-07-16 Thread arun
ot;QF",sep="_") mydat3<-data.frame(cbind(mydat1,mydat2)) mydat3   ABC XYZ ABC_QF XYZ_QF 1   4   6    RC 2   7   3 RC   ############ A.K. ----- Original Message - From: Rantony To: r-help@r-project.org Cc: Sent: Monday, July 16, 2012 8:17 AM Subje

Re: [R] Column create and Update using function

2012-07-16 Thread Rantony
Hi Arun, I will explain more clearly what I need. Here I have an array MinMax with 2 column Max and Min MinMax – it is like Min Max -- 36 1 5 And I have an matrix with same dimension [same dimension is must] MyMatrix – ABCXYZ

Re: [R] Column create and Update using function

2012-07-15 Thread arun
Hi, Try this: dat1<-read.table(text=" ABC    XYZ    PQR 2    4    3 5    4    8 7    1    3 ",sep="",header=TRUE)  newdat<-apply(dat1,2,function(x) ifelse(x<6 & x>3,"","RC"))  colnames(newdat)<-paste(colnames(newdat)

Re: [R] Column create and Update using function

2012-07-15 Thread arun
Hi Antony, There is still some confusion as to what you actually want as result.   For example, your statement ->"In this i need to check each particular column values are between Max and Min value. If the coulmn value not coming between Max and Min, then i need to create another coulmn" This i