sm_data | R Documentation |
This is the main function of the package to retrieve data from the database.
sm_data(
dsid = NULL,
series = NULL,
from = NULL,
to = NULL,
freq = NULL,
labels = TRUE,
wide = TRUE,
expand.date = FALSE,
ordered = TRUE,
return.query = FALSE,
...
)
dsid |
character. (Optional) id's of datasets matching the 'dsid' column of the 'DATASET' table (retrieved using |
series |
character. (Optional) codes of series matching the 'series' column of the 'SERIES' table (retrieved using |
from |
set the start time of the data retrieved by either supplying a start date, a date-string of the form |
to |
same as |
freq |
character. Return only series at a certain frequency. Allowed are values |
labels |
logical. |
wide |
logical. |
expand.date |
logical. |
ordered |
logical. |
return.query |
logical. |
... |
further arguments passed to |
Series from datasets at different frequencies can be queried, but, if wide = TRUE
, this will result in missing values in the lower frequency series.
A data.table
with the result of the query.
sm_pivot_wider
, sm_expand_date
, samadb
# Return all electricity indicators from 2000
sm_data("ELECTRICITY", from = 2000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.