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

feat: use business days #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: use business days #5

wants to merge 1 commit into from

Conversation

maelle
Copy link

@maelle maelle commented Apr 16, 2024

why we should add 1:

bizdays::load_rmetrics_calendars(year = 2013:2024)
#> Calendar Rmetrics/LONDON loaded
#> Calendar Rmetrics/NERC loaded
#> Calendar Rmetrics/NYSE loaded
#> Calendar Rmetrics/TSX loaded
#> Calendar Rmetrics/ZURICH loaded
bizdays::bizdays("2023-01-02", "2023-01-02", cal = "Rmetrics/ZURICH")
#> [1] -1
bizdays::bizdays("2023-01-02", "2023-01-03", cal = "Rmetrics/ZURICH")
#> [1] 0
bizdays::bizdays("2023-01-02", "2023-01-04", cal = "Rmetrics/ZURICH")
#> [1] 1

Created on 2024-04-16 with reprex v2.1.0

@@ -52,8 +52,13 @@ issues_vs_first_member_comment |>
identity()

# Slow issues
bizdays::load_rmetrics_calendars(year = 2013:2024)

try <- issues_vs_first_member_comment |>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this to plot the difference, maybe I should remove this.

issues_vs_first_member_comment |>
mutate(time = as.numeric(created_at - issue_created_at) / 86400) |>
mutate(time = bizdays::bizdays(from = issue_created_at, to = created_at, cal = "Rmetrics/ZURICH")) |>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how lucky are we that "zurich" is a built-in calendar. 😸

of course you might have responded to issues on non business days but I still think it's a nicer measure, not only because it decreases the amount of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant