You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/02/02 16:17:41 UTC

[GitHub] [arrow] dragosmg edited a comment on pull request #12319: ARROW-14199 [R] bindings for format (where possible)

dragosmg edited a comment on pull request #12319:
URL: https://github.com/apache/arrow/pull/12319#issuecomment-1028108485


   I think the [failures I am seeing so far](https://github.com/apache/arrow/runs/5038040447?check_suite_focus=true) are due to the difference between `base::format()` and `base::strftime()`. While in {arrow} they behave similarly (due to the nature of my implementation), in base R they do not:
   ``` r
   library(dplyr, warn.conflicts = FALSE)
   library(lubridate, warn.conflicts = FALSE)
   times <- tibble(
     datetime = c(lubridate::ymd_hms("2018-10-07 19:04:05", tz = "Etc/GMT+6"), NA),
     date = c(as.Date("2021-01-01"), NA)
   )
   formats <- "%a %A %w %d %b %B %m %y %Y %H %I %p %M %z %Z %j %U %W %x %X %% %G %V %u"
   a <- times$datetime[1]
   a
   #> [1] "2018-10-07 19:04:05 -06"
   format(a, format = formats)
   #> [1] "Sun Sunday 0 07 Oct October 10 18 2018 19 07 PM 04 -0600 -06 280 40 40 10/07/2018 19:04:05 % 2018 40 7"
   strftime(a, format = formats)
   #> [1] "Mon Monday 1 08 Oct October 10 18 2018 02 02 AM 04 +0100 BST 281 40 41 10/08/2018 02:04:05 % 2018 41 1"
   ```
   
   <sup>Created on 2022-02-02 by the [reprex package](https://reprex.tidyverse.org) (v2.0.1)</sup> 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org