[R] Create and Change Column in a Matrix as per condition

Rantony antony.akkara at ge.com
Tue May 29 15:13:39 CEST 2012


Hi,

i have a matrix like this
  *DWATT *
    10               
    20             
    30               
    30              
    32              
Here i need to create a new column named "*DWATT_QF*" with filling value as
per the following condition,
if DWATT_QF = RC When DWATT value less than 30 and greater than 31. Which
means, i need output like this,

  *DWATT               DWATT_QF*  
    10                          RC
    20                          RC
    30                          RC
    30                          RC
    32                          RC

Here " GetCsv " is my matrix name. i tried this way and its getting proper
in "R",
GetCsv[(GetCsv[,ColHdr]< 30) | (GetCsv[,ColHdr]>31),ColHdr_QF]<-"RC"

But i *not getting in Eclips*, and getting error like "*Sub script Out of
Range*"

Could you please help me fast. Its an urgent !   


- Thanks 
Antony

--
View this message in context: http://r.789695.n4.nabble.com/Create-and-Change-Column-in-a-Matrix-as-per-condition-tp4631691.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list