We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd like the package to handle this, if possible
library(anytime) library(stringr) library(dplyr) df <- data.frame(date=c("Apr 3, 2016","Apr 13, 2016"),stringsAsFactors = FALSE)
As expected
df_new <-df %>% mutate(newdate=anydate(date)) glimpse(df_new) Observations: 2 Variables: 2 $ date <chr> "Apr 3, 2016", "Apr 13, 2016" $ newdate <date> NA, 2016-04-13
I started doing a hack (which would input a 0 if the ", "was in a particular position but at first stage had the newdate returned as a double
df_new <-df %>% mutate(newdate=ifelse(str_sub(date,6,6)==",",anydate(Sys.Date()),anydate(date))) glimpse(df_new) Observations: 2 Variables: 2 $ date <chr> "Apr 3, 2016", "Apr 13, 2016" $ newdate <dbl> 17288, 16904
The text was updated successfully, but these errors were encountered:
I am aware of the shortcoming, but it is one on the Boost side, and I would only accept fixes at the C++ layer.
Mucking about with this on the R side is just not release-strong enough I feel.
We do now have an alternate parser (in the GitHub version) which can do this (but is lacking the specific format with %b right now):
%b
R> library(anytime) R> anytime(c("4/3/2016","4/13/2016"), useR=TRUE) [1] "2016-04-03 CDT" "2016-04-13 CDT" R>
The first would have failed using the default (via Boost).
Sorry, something went wrong.
Thanks for swift reply. I sorted it with an as.Date format
No branches or pull requests
I'd like the package to handle this, if possible
As expected
I started doing a hack (which would input a 0 if the ", "was in a particular position but at first stage had the newdate returned as a double
The text was updated successfully, but these errors were encountered: