Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Issue with as_date reading a character with date and time #598
With version 1.7.0 the as_date function does not convert a character with a date and time to a date, instead it returns NA with a warning. The expected value to be returned was a date with the time portion dropped. In version 1.6.0, the function converted the character to a date.
# See if as_date works with current version of lubridate to convert a character string with time install.packages("lubridate") #> (as 'lib' is unspecified) #> package 'lubridate' successfully unpacked and MD5 sums checked #> #> The downloaded binary packages are in #> C:\Users\kerry.jackson\AppData\Local\Temp\RtmpEL6DC7\downloaded_packages lubridate::as_date("2017-10-31 06:00:00") #> Warning: All formats failed to parse. No formats found. #>  NA packageVersion("lubridate") #>  '1.7.0' # See if as_date works with version 1.6 of lubridate to convert a character string with time library(devtools) install_version("lubridate", version = "1.6.0", repos = "http://cran.us.r-project.org") #> lubridate::as_date("2017-10-31 06:00:00") #>  "2017-10-31" packageVersion("lubridate") #>  '1.6.0'
I appreciate the very quick fix, however I still have the same issue. I thought that perhaps even though I did install the update, which was available perhaps I needed to install from github, however when I tried I got an error.