I am having a problem to format the date of my research files. I just give a simple example which works in the book of "The R book", but not for me:
x <- c("00aug", "01sep", "99sep")
strptime(x, "%y%b")
[1] NA NA NA
the result, according to my understanding, should be something like "2000-08-01", "2001-09-01" and "1999-09-01", but they all came to NA ... I also tried to set the environment like this, but also doesn't work.
Sys.setlocale(locale = "ENGLISH")
This is my sessionInfo():
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.3
Can anyone help me out? Have been struggle into this problem for two days...