Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
strptime()を使用して因子変数から日付を解析しようとしていますが、問題があります。私の日付は(誤って)日と月をDOUBLEDIGITSではなくSINGLEとしてリストしています。たとえば、私の日付は次のようになります:05/05/201214:02ではなく5/5/201214:02。
したがって、コードを実行するとNA値が返されます。
strptime(var,"%m/%d/%y %H:%M")
修正はありますか?
キャピタルYはそれを行います:
Y
test <- "5/5/2012 14:02" strptime(test,"%m/%d/%Y %H:%M") [1] "2012-05-05 14:02:00"