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-Forge #298] Create weekday integer class #677

Open
arunsrinivasan opened this issue Jun 8, 2014 · 1 comment
Open

[R-Forge #298] Create weekday integer class #677

arunsrinivasan opened this issue Jun 8, 2014 · 1 comment

Comments

@arunsrinivasan
Copy link
Member

arunsrinivasan commented Jun 8, 2014

Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link

So that 20080104+1==20080107.

@jangorecki
Copy link
Member

jangorecki commented Apr 5, 2020

Adding example:

x = as.Date("2008-01-04")
y = as.Date("2008-01-07")
weekdays(c(x, y))
#[1] "Friday" "Monday"
x + 1 == y
#[1] FALSE

# weekday is a new class
x = as.weekday(x)
y = as.weekday(y)
x + 1 == y
#[1] TRUE

Before implementing worth to double check if we want to have it in data.table. There is a nice nanotime package that we could use to oursource all new date-time stuff.

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

No branches or pull requests

2 participants