sm_series {samadb}R Documentation

Retrieve Series Table

Description

This function pulls the 'SERIES' table from the database, providing information about the time series in the database. Each series is given a code which unique across datasets.

Usage

sm_series(
  dsid = NULL,
  series = NULL,
  dataset.info = FALSE,
  ordered = TRUE,
  return.query = FALSE
)

Arguments

dsid

character. (Optional) id's of datasources matching the 'dsid' column of the 'DATASET' table (retrieved using sm_datasets()) for which series information is to be returned.

series

character. (Optional) codes of series for which information in to be returned. If 'dsid' is also specificed, the two are combined using SQL 'OR' i.e. these series are retrieved in addition to all series matched through 'dsid'.

dataset.info

logical. TRUE returns additional information from the 'DATASET' table (the dataset name, when data was last updated, the source id and the data provider and access mode).

ordered

logical. TRUE returns the series in a fixed order, while FALSE returns the result in a random order, to the benefit of faster query execution.

return.query

logical. TRUE will not query the database but instead return the constructed SQL query as a character string (for debugging purposes).

Details

Each series is given a code which is unique across datasets. Each series also has a label describing the series. Further information recorded are the series frequency, unit, whether it was seasonally adjusted, number of observations, minimum and maximum date, and (optionally) topic, alternative code provided by the data source (data retrieved from EconData uses EconData codes as series codes, so the 'src_code' field gives the codes used by the SARB or STATSSA), or further comments on the series.

Value

A data.table with information about the available series in the database.

See Also

sm_datasources, sm_datasets, sm_data, samadb

Examples


# By default returns all series
sm_series()

# Adding information about the dataset and provider
sm_series(dataset.info = TRUE)

# Only series in the QB
sm_series("QB")


[Package samadb version 0.3.0 Index]