Skip to content

Commit

Permalink
[Fix #251] Correct computaton of weeks
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu committed Dec 14, 2014
1 parent 5359785 commit 4429eb6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/accessors-week.r
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ NULL
#' week(x) <- 54
#' week(x) > 3
week <- function(x)
yday(x) %/% 7 + 1

(yday(x) - 1) %/% 7 + 1

"week<-" <- function(x, value)
x <- x + days((value - week(x)) * 7)


isoweek <- function(x){
xday <- ISOdate(year(x), month(x), day(x), tz = tz(x))
dn <- 1 + (wday(x) + 5) %% 7
Expand Down

0 comments on commit 4429eb6

Please # to comment.