Code Monkey home page Code Monkey logo

Comments (4)

ceschi avatar ceschi commented on August 24, 2024 1

Thank you! very clear and useful, I'll fix my code right away!

from fredr.

sboysel avatar sboysel commented on August 24, 2024

Hi @ceschi ,

Thanks for bringing this to my attention. The inconsistency arose from poor handling of time series parsing in fredr_series. Since 691ca81, I've opted for simply returning the series values and dates a an xts object. Can you update fredr and try again?

devtools::install_github('sboysel/fredr')
fredr_series(series_id = 'FGCCSAQ027S')

from fredr.

ceschi avatar ceschi commented on August 24, 2024

I tried for the examples above and it seems to work, let me check more extensively though. Anyway, it seems that the format dates are displayed is now different when using quarterly frequency, from the YYYY-Q format to YYYY-MM-DD, am I correct?

from fredr.

sboysel avatar sboysel commented on August 24, 2024

Correct. That is a conscious choice to return a simple object containing observation dates and values without loss of data fidelity. If you want to coerce the returned object to a quarterly ts object:

x <- fredr_series(series_id = 'FGCCSAQ027S')
ts(data = x, start = c(1945, 3), frequency = 4)

or convert the existing object to quarterly using zoo::as.yearqtr

library(zoo)
index(x) <- as.yearqtr(index(x))

Notice how in the ts example, I assume that the date 1945-10-01 corresponds to the observation for 1945 Q3, while as.yearqtr simply divides the calendar year into 4.

from fredr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.