title: Reshape data using colsplit in R
body: <p>I try to reshape my data using this code but i get NA values.</p>
  
  <pre><code>require(reshape2)
  dates=data.frame(dates=seq(as.Date("1988-01-01"),as.Date("2011-12-31"),by="day"))
  first=dates[,1]
  dates1=cbind(dates[,1],colsplit(first,pattern="\\-",names=c("Year","Month","Day")))###split by y/m/day
   head(dates1)
     dates[, 1] Year Month Day
    1 1988-01-01 6574    NA  NA
    2 1988-01-02 6575    NA  NA
    3 1988-01-03 6576    NA  NA
    4 1988-01-04 6577    NA  NA
    5 1988-01-05 6578    NA  NA
    6 1988-01-06 6579    NA  NA
  </code></pre>