fork(2) download
  1. a = c("01/2009","03/2006","","12/2003")
  2. b = c("03/2016","05/2010","07/2011","")
  3. df = data.frame(a,b)
  4. gsub("/","/01/", df$a, fixed=TRUE)
  5. gsub("^(\\d{2})/(\\d{4})$", "\\1/01/\\2", df$a)
  6.  
Success #stdin #stdout 0.22s 60752KB
stdin
Standard input is empty
stdout
[1] "01/01/2009" "03/01/2006" ""           "12/01/2003"
[1] "01/01/2009" "03/01/2006" ""           "12/01/2003"