Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8168485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:32:33+00:00 2026-06-06T20:32:33+00:00

Can some please explain the behaviour below, where, with a from date of 20060301,

  • 0

Can some please explain the behaviour below, where, with a from date of “20060301”, the first element of the resulting sequence of months is March 2006, but with a from date of “20060401”, the start date remains March 2006?

> timeBasedSeq('20060301/20120207/m')[1]
[1] "Mar 2006"
> timeBasedSeq('20060401/20120207/m')[1]
[1] "Mar 2006"
> timeBasedSeq('20060501/20120207/m')[1]
[1] "Apr 2006"
> timeBasedSeq('20060601/20120207/m')[1]
[1] "May 2006"
> timeBasedSeq('20060701/20120207/m')[1]
[1] "Jun 2006"
> timeBasedSeq('20060801/20120207/m')[1]
[1] "Jul 2006"

BTW, I am aware that one does get the “right” answer by starting a day later:

> timeBasedSeq('20060401/20120207/m')[1]
[1] "Mar 2006"
> timeBasedSeq('20060402/20120207/m')[1]
[1] "Apr 2006"

EDIT: Here is my sessionInfo()

> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
[3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
[5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
[7] LC_PAPER=C                 LC_NAME=C                 
[9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] xts_0.8-6 zoo_1.7-7

loaded via a namespace (and not attached):
[1] grid_2.15.0    lattice_0.20-6 tcltk_2.15.0   tools_2.15.0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:32:36+00:00Added an answer on June 6, 2026 at 8:32 pm

    This is a timezone issue, so set Sys.setenv(TZ="GMT").

    R> Sys.setenv(TZ="Europe/London"); Sys.time()
    [1] "2012-06-23 20:14:58 BST"
    R> timeBasedSeq('200603/201202/m')[1]
    [1] "Mar 2006"
    R> timeBasedSeq('200604/201202/m')[1]
    [1] "Mar 2006"
    R> Sys.setenv(TZ="GMT"); Sys.time()
    [1] "2012-06-23 19:15:49 GMT"
    R> timeBasedSeq('200603/201202/m')[1]
    [1] "Mar 2006"
    R> timeBasedSeq('200604/201202/m')[1]
    [1] "Apr 2006"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can some one please explain what is happening in the code below and how
Please can some one explain exactly what the URL Behaviour (Static or Dynamic) property
Can I add Java portlet in sharepoint 2007? If yes, can some please explain
Can some one please explain why this loop never 'breaks' and goes on forever
Please can some one explain the javacv method for the pyrDown() method. I'm trying
Can anyone please explain or suggest some good tutorial for the method of matrix
Can someone please explain why ?___SID=U is appearing in some Magento URLs on my
Can some one please explain the the pros and cons between has_many :through and
Can some one please explain to me why this piece of code prints out
Can some one please explain me the following expression $input =~ m/\G.*?(,|$)/gc || $input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.