title: as.Date function doesn't convert date
body: <p>I have a small problem with the <code>as.Date</code> function. I loaded a prn data as csv file, and my teacher said it was okay, then when I try to set my dates in the standard way (y,m,d) it gives me as a year a crazy number. PZU file is the stock prices for polish company. Also, I am not really sure how to set time also. I would really appreciate the help. Just for general info I am using R software with R studio interface.</p>
  
  <pre><code>pzu&lt;-read.csv("PZU.prn",header=F)[,1:7]
  names(pzu)&lt;-c("name","date","time","open","high","low","close")
  head(pzu)
  #  name     date time open high low close
  #1  PZU 20100512  845  349  349 349   349
  #2  PZU 20100512  845  349  349 349   349
  #3  PZU 20100512  845  349  349 349   349
  #4  PZU 20100512  845  349  349 349   349
  #5  PZU 20100512  845  349  349 349   349
  #6  PZU 20100512  845  349  349 349   349
  
  class(pzu$date) # output is an "integer"
  
  str(pzu)
  #data.frame':   960638 obs. of  7 variables:
  # $ name : Factor w/ 1 level "PZU": 1 1 1 1 1 1 1 1 1 1 ...
  # $ date : int  20100512 20100512 20100512 20100512 20100512 20100512 20100512 20100512 20100512 20100512 ...
  # $ time : int  845 845 845 845 845 845 845 845 845 845 ...
  # $ open : num  349 349 349 349 349 349 349 349 349 349 ...
  # $ high : num  349 349 349 349 349 349 349 349 349 349 ...
  # $ low  : num  349 349 349 349 349 349 349 349 349 349 ...
  # $ close: num  349 349 349 349 349 349 349 349 349 349 ...
  
  pzu$date&lt;-as.Date(pzu$date)
  head(pzu)
  #name       date time open high low close
  #1  PZU 7003-05-03  845  349  349 349   349
  #2  PZU 7003-05-03  845  349  349 349   349
  #3  PZU 7003-05-03  845  349  349 349   349
  #4  PZU 7003-05-03  845  349  349 349   349
  #5  PZU 7003-05-03  845  349  349 349   349
  #6  PZU 7003-05-03  845  349  349 349   349
  </code></pre>