Hi everyone, I would want to replace only the "missing" characters in date 
column by "2002-06-30" character (I will make the change  to date format in 
future): DT <- data.table(id=c(1,1,4,4,4),                 
date=as.character(c("1997-04-26","missing","1998-08-25","missing","1998-11-07")))DT
    id       date1:  1 1997-04-262:  1         NA3:  4 1998-08-254:  4         
NA5:  4 1998-11-07  DT[,list(id, date=if(variable==NA) {"2002-06-30"} else 
date)] But I get an error message. Is it posible to do it under data table 
format? Many thanks to all the data.table help  members!!                       
                
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to