[ 
https://issues.apache.org/jira/browse/ARROW-17781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17607209#comment-17607209
 ] 

Nicola Crane edited comment on ARROW-17781 at 9/20/22 1:48 PM:
---------------------------------------------------------------

Thanks for the information!  Just an FYI, it makes it a little bit easier to 
diagnose these issues if you supply a short reproducible code example (like the 
one I'm about to paste below), rather than a screenshot of the code.  However, 
no problem here, as I think I know what the issue is!

In version 9.0.0 we don't yet support the ability to call functions in Arrow 
with their package prefix.  If you call it just as {{floor_date}} instead of 
{{lubridate::floor_date()}}, this should hopefully work.  I've pasted a short 
reproducible example for you below.

{code:r}
library(dplyr)
library(arrow)

df <- tibble::tibble(x = as.POSIXct("2022-09-20 14:40:46 BST"))

df %>%
  arrow_table() %>%
  mutate(t = floor_date(x, unit = "15 min")) %>%
  collect()
#> # A tibble: 1 × 2
#>   x                   t                  
#>   <dttm>              <dttm>             
#> 1 2022-09-20 14:40:46 2022-09-20 14:30:00
{code}

In version 10.0.0 we'll be supporting the ability to call functions including 
the package prefix - this was completed in the dev version in ARROW-14575.


was (Author: thisisnic):
Thanks for the information!  Just an FYI, it makes it a little bit easier to 
diagnose these issues if you supply a short reproducible code example (like the 
one I'm about to paste below), rather than a screenshot of the code.  However, 
no problem here, as I think I know what the issue is!

In version 9.0.0 we don't yet support the ability to call functions in Arrow 
with their package prefix.  If you call it just as {{floor_date}} instead of 
{{lubridate::floor_date()}}, this should hopefully work.  I've pasted a short 
reproducible example for you below.

{code:r}
library(dplyr)
library(arrow)

df <- tibble::tibble(x = as.POSIXct("2022-09-20 14:40:46 BST"))

df %>%
  arrow_table() %>%
  mutate(t = floor_date(x, unit = "15 min")) %>%
  collect()
{code}

In version 10.0.0 we'll be supporting the ability to call functions including 
the package prefix - this was completed in the dev version in ARROW-14575.

> [R] "floor_date()" function from Lubridate Library
> --------------------------------------------------
>
>                 Key: ARROW-17781
>                 URL: https://issues.apache.org/jira/browse/ARROW-17781
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: N Gautam Animesh
>            Priority: Major
>         Attachments: image.png
>
>
> I was trying to use the floor_date() function from the Lubridate Library but 
> somehow I wasn't able to get the desired outputs.
> Do let me know if there is an implementation for the same in Arrow. Or some 
> other work around. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to