Skip to content
New issue

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

[R] Subtracting X days from a given date in ymd format #43521

Open
TPDeramus opened this issue Aug 1, 2024 · 1 comment
Open

[R] Subtracting X days from a given date in ymd format #43521

TPDeramus opened this issue Aug 1, 2024 · 1 comment
Labels
Component: R Type: usage Issue is a user question

Comments

@TPDeramus
Copy link

Describe the usage question you have. Please include as many useful details as possible.

Hi Arrow developers.

I have seen topics on it in the feature requests, but I haven't found anything in the documentation yet suggesting how to do the following on an arrow pointer or table.

Lets say I wanted to filter my data to two points, thirty-days prior to a specific variable and another date.

However, it keeps throwing errors whenever I try to do the subtraction like so:
data_pointer |> filter(between(ADate,(Initiation-30), Conclusion)) |> collect()

Throwing:

Error in `compute.arrow_dplyr_query()`:
! NotImplemented: Function 'subtract_checked' has no kernel matching input types (struct<year: int64, month: int64, day: int64>, float)
Run `rlang::last_trace()` to see where the error occurred.

I tried some versions where I explicitly specified date format with subtraction:
data_pointer |> filter(between(as.Date(ADate),(as.Date(Initiation)-arrow_subtract(30)), as.Date(Conclusion))) |> collect()
data_pointer |> filter(between(arrow_year_month_day(ADate),(arrow_year_month_day(Initiation)-arrow_subtract(day(30))), arrow_year_month_day(Conclusion))) |> collect()

But they throw variations of:

Error in `compute.arrow_dplyr_query()`:
! NotImplemented: Function 'day' has no kernel matching input types (float)
Run `rlang::last_trace()` to see where the error occurred.

Would you be willing to provide a description of how to accomplish this?

Any help would be appreciated.

Thanks in advance!

Component(s)

R

@TPDeramus TPDeramus added the Type: usage Issue is a user question label Aug 1, 2024
@thisisnic
Copy link
Member

I'm afraid there's an old ticket open to implement this functionality, but the dependent C++ tickets are unresolved: #30470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: R Type: usage Issue is a user question
Projects
None yet
Development

No branches or pull requests

2 participants