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

allow to.period to operate on custom endpoint #302

Closed
ethanbsmith opened this issue Jun 16, 2019 · 0 comments
Closed

allow to.period to operate on custom endpoint #302

ethanbsmith opened this issue Jun 16, 2019 · 0 comments
Labels
feature request New features
Milestone

Comments

@ethanbsmith
Copy link
Contributor

Description

I'd like to experiment with some analytics using alternate sampling frequencies. 2 examples are variants on 4 week periods, with periods always ending on Fridays.

z <- as.POSIXlt((as.Date("1900-01-01") + (0:(Sys.Date() - as.Date("1900-01-01")))))
z[z$wday == 5L & z$yday < 363L & z$yday %% 28L <= 6L]) #13, periods, with only the final final period of the year being > 4 weeks
z[z$wday == 5L & z$yday %% 28L <= 6L]) #exactly 4-week periods with periods in a years varying between 13 and 14

While i can calculate the endpoints quite easily, i can't find a way to integrate these into my other calculations and processes, without re-implementing most of the to.period function. Would it be possible to modify the to.period function to take a custom set of endpoints either as a new parameter, or overloading the existing period parameter?

@joshuaulrich joshuaulrich added the feature request New features label Oct 13, 2022
@joshuaulrich joshuaulrich added this to the 0.12.3 milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New features
Projects
None yet
Development

No branches or pull requests

2 participants