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

timeBasedSeq creates duplicate values due to DST #67

Closed
joshuaulrich opened this issue Apr 2, 2015 · 0 comments
Closed

timeBasedSeq creates duplicate values due to DST #67

joshuaulrich opened this issue Apr 2, 2015 · 0 comments
Assignees
Labels

Comments

@joshuaulrich
Copy link
Owner

Examples on stackoverflow:

R> Sys.setlocale("LC_TIME", "en_US.UTF-8")
R> timeBasedSeq("1986-10-25/1986-10-27")
[1] "1986-10-25" "1986-10-26" "1986-10-26" "1986-10-27"
R> timeBasedSeq("2010-11-06/2010-11-08/d")
[1] "2010-11-06" "2010-11-07" "2010-11-07" "2010-11-08"

A suggested solution is:

> git diff R/timeBasedSeq.R
diff --git a/R/timeBasedSeq.R b/R/timeBasedSeq.R
index c9b73e7..baa6e14 100644
--- a/R/timeBasedSeq.R
+++ b/R/timeBasedSeq.R
@@ -76,7 +76,7 @@ function(x, retclass=NULL, length.out=NULL) {
   if(max.resolution == 0) 
     max.resolution <- 1

-  resolution <- c('year','month','day','hour','mins','secs')[max.resolution]
+  resolution <- c('year','month','DSTday','hour','mins','secs')[max.resolution]

   if(!is.na(BY)) resolution <- names(match.arg(BY, list(year  ='Y',
                                                         month ='m',
@joshuaulrich joshuaulrich self-assigned this Apr 2, 2015
@joshuaulrich joshuaulrich added this to the Release 0.9-8 milestone Apr 10, 2015
@joshuaulrich joshuaulrich changed the title timeBaseSeq creates duplicate values due to DST timeBasedSeq creates duplicate values due to DST Apr 11, 2015
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