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

Functions to turn datatime into vars table #22

Open
trinker opened this issue Nov 11, 2018 · 0 comments
Open

Functions to turn datatime into vars table #22

trinker opened this issue Nov 11, 2018 · 0 comments
Assignees
Labels

Comments

@trinker
Copy link
Owner

trinker commented Nov 11, 2018

PowerBI can take a date and turn it into month, quarter, weekday as a plot ont he fly. It'd be nice to be able to have a quick way to generate all of these forms for plotting purposes.

Potential Functions

date_vars <- function(x, ...){
    UseMethod('date_vars')
}


time_vars <- function(x, ...){
    UseMethod('time_vars')
}

date_time_vars <- function(x, ...){
    UseMethod('time_vars')
}

Potential methods

works on a valid date time class only

type = returns

atomic = data frame [date/time + vars]
data.frame = old data frame + vars

Potential Vars

date: month (factor), year (integer), day of week (factor), quarter (factor), day type ('weekend', 'weekday')
time: hour (integer: 12), hour2 (integer: 24), hour3 (factor| hour + am/pm), hour type ('am', 'pm'),

@trinker trinker self-assigned this Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant