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 7936207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:08:35+00:00 2026-06-03T22:08:35+00:00

Forgive me for this basic question. I have loaded a set of data as

  • 0

Forgive me for this basic question. I have loaded a set of data as timeSeries in R.

> class(Return)

[1] "timeSeries"
attr(,"package")
[1] "timeSeries"

> head(Return[,1])

GMT
           Overall
2005-09-21  1.8714
2005-09-22  0.2049
2005-09-23 -1.5924
2005-09-26 -4.3111
2005-09-27 -0.2416
2005-09-28 -1.1924

When I plot this time series data, it gives me a figure with date as the label of x-axis with format "2006-01-01", "2007-01-01". How can I customise it as "2006-01" or "2006" or "2006 Jan" and how can I modify the frequency? For example I’d like to have a tick every half year instead of every year?

Any suggestion? Thank you!

  • 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-03T22:08:37+00:00Added an answer on June 3, 2026 at 10:08 pm

    For the label format you can use the format parameter (for info about the format options have a look at this page):

    plot(Ts,format="%Y-%m") # 2006-01
    plot(Ts,format="%Y-%b") # 2006-Jan
    plot(Ts,format="%Y")    # 2006
    

    While for the labels, you can set custom labels by using the at parameter, e.g. :

    # compute the desired dates to show:
    minDate <- timeCalendar(y=as.integer(format(min(time(Ts)),'%Y')),m=1,d=1)
    maxDate <- max(time(Ts))
    datesToShow = timeSequence(from=minDate,to=maxDate,by="1 year")
    
    plot(Ts,format="%Y-%m",at=datesToShow)
    

    For more info about the plot parameters for timeSeries objects, just type:

    ?timeSeries::plot
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Forgive my ignorance if this is 'a basic question'..... I have a method that
You'll have to forgive me if this is a really basic question; I haven't
I am a Rails newbie (from PHP). So forgive this basic data structures question:
Forgive my ignorance in asking this basic question but I've become so used to
I'm just getting into C#, so forgive me if this is a basic question.
Please forgive this rather basic question, but I'm very new to Java and still
I am a latex beginner so forgive this basic question: How do I activate
Fairly new to python, forgive me if this is a basic question about learning
Please forgive me for this basic and a little theoretical question as I dont
Quite new to xslt so forgive me if this is a basic question -

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.