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_packageslubridate::as_date("2017-10-31 06:00:00")
#> Warning: All formats failed to parse. No formats found.#> [1] NA
packageVersion("lubridate")
#> [1] '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")
#> [1] "2017-10-31"
packageVersion("lubridate")
#> [1] '1.6.0'
The text was updated successfully, but these errors were encountered:
Hm, sorry about that. That was a consequence of #536 and #527 and it didn't strike me as breaking change. You usage is rather unusual, but for the sake of the backward compatibility I will fix it asap.
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. devtools::install_github("tidyverse/lubridate") Error: package or namespace load failed for 'lubridate': .onAttach failed in attachNamespace() for 'lubridate', details: call: Sys.setenv("TZDIR", tzdir) error: all arguments must be named Error: loading failed Execution halted *** arch - x64 Error: package or namespace load failed for 'lubridate': .onAttach failed in attachNamespace() for 'lubridate', details: call: Sys.setenv("TZDIR", tzdir) error: all arguments must be named Error: loading failed Execution halted ERROR: loading failed for 'i386', 'x64'
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.
The text was updated successfully, but these errors were encountered: