| TimeSeriesWithRevisions-class {MacrobondAPI} | R Documentation |
A TimeSeriesWithRevisions object represents the complete history of a time series downloaded from the Macrobond database
TimeSeriesWithRevisions objects are created by the following methods:
FetchOneTimeSeriesWithRevisions
FetchTimeSeriesWithRevisions
signature(series = "TimeSeriesWithRevisions"): TRUE if there was an error downloading this time series. In that case the getErrorMessage method will return an error message.
signature(series = "TimeSeriesWithRevisions"): Get an error message text if getIsError is TRUE.
signature(object = "TimeSeriesWithRevisions"): Get the current state of the series.
signature(object = "TimeSeriesWithRevisions", date = "Date"): Get the state of the series at the specified time.
signature(object = "TimeSeriesWithRevisions"): Get the times for all revisions for the series.
signature(object = "TimeSeriesWithRevisions"): Check if the series has any revisions.
signature(object = "TimeSeriesWithRevisions"): Check if the series is set to store revisions.
signature(object = "TimeSeriesWithRevisions", n = "Int"): Get the series at the specified release. You can use getRevisionTimesFromNthRelease to get the revision dates per observation for these series.
signature(object = "TimeSeriesWithRevisions", date = "Date"): Get the values over time for a specific point in time.
signature(object = "TimeSeriesWithRevisions"): Get all the revisions as a separate complete series. Each element in the list is a list with two elements: timestamp and series. The timestamp of the first series is typically not known and set to 1899-12-29 or null.
signature(object = "TimeSeriesWithRevisions"): Show a summary of the time series with revisions.
The series returned from getHead, getVintage, getNthRelease and getCompleteHistory will all be of equal length. This makes it easy to use them together in a data frame, but it also means that they can contain missing values at the end of the series.
FetchOneTimeSeriesWithRevisions,
FetchTimeSeriesWithRevisions,
getRevisionTimesFromNthRelease,
# Fetch revision history for usgdp and get series for first and second release
seriesGdp <- FetchOneTimeSeriesWithRevisions("usgdp")
firstRelease <- getNthRelease(seriesGdp, 0)
secondRelease <- getNthRelease(seriesGdp, 1)
x <- MakeXtsFromUnifiedResponse(c(firstRelease, secondRelease))
plot(x)
# Show the timestamps for each value of the first release
show(getRevisionTimesFromNthRelease(firstRelease))
# Load the series revisions and get the vintage series that shows what it looked like at 2018-01-01
seriesWithRevisions <- FetchOneTimeSeriesWithRevisions("usgdp")
series2018 <- getVintage(seriesWithRevisions, as.POSIXct("2018-01-01 18:00:00", tz = "EST"))