0

I can do this

strptime("20150615",format="%Y%m%d")

But this won't work.

strptime("194207","%Y%m") [1] NA

Whats is going on here?

Edit

For now doing this but so silly.

strptime(paste("194207","01"),"%Y%m%d")

CCurtis
  • 1,770
  • 3
  • 15
  • 25
  • 3
    There is no year-month format in base r. Have a look at the zoo package for `yearmon`. – Frank Jun 19 '15 at 22:40
  • Why is so silly `strptime(paste0("194207","01"),"%Y%m%d")`? – agstudy Jun 19 '15 at 22:42
  • Weird, I would have expected from `?strptime` that year/month would work: "For strptime the input string need not specify the date completely: it is assumed that unspecified seconds, minutes or hours are zero, and an unspecified year, month or day is the current one." – josliber Jun 19 '15 at 22:43
  • @agstudy My question was different "yyyymm" vs "yyyy-mm". – CCurtis Jun 19 '15 at 23:23
  • 1
    @CCurtis really different ? For me it is a duplicated , if community decides differently it will reopen it. – agstudy Jun 20 '15 at 00:05

0 Answers0