Skip to content

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

# 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.

1 participant