View source: R/get_gdp_growth.R
| get_gdp_growth | R Documentation |
Downloads quarterly GDP growth data (% change) from BCB/SGS (Brazilian Central Bank). This function retrieves nominal GDP values (SGS series 2010) and calculates the quarter-over-quarter growth rate.
get_gdp_growth(
start_date = "2000-01-01",
end_date = NULL,
language = "eng",
labels = TRUE
)
start_date |
Start date for the data period. Accepts multiple formats:
|
end_date |
End date for the data period. Accepts the same formats as
|
language |
Language for column names in the returned data.frame:
|
labels |
Logical indicating whether to add variable labels using the |
A data.frame with GDP growth rate. Columns depend on the language parameter:
English (language = "eng"): date (Date), gdp_growth (numeric, %)
Portuguese (language = "pt"): data_referencia (Date), crescimento_pib (numeric, %)
Important limitation: The nominal GDP series (SGS 2010) is currently available only until 2014. Requests for periods after 2014 will return empty results or a warning.
# Default: data from 2000 to current date (but limited to 2014)
df <- get_gdp_growth()
# Specific period (within available range)
df2 <- get_gdp_growth("2010", "2014")
# Using year-month format
df3 <- get_gdp_growth("2012-06", "2013-12")
# End date only (from earliest available to 2020-12-31)
df4 <- get_gdp_growth(end_date = "2020-12-01")
# Portuguese column names and labels
df5 <- get_gdp_growth(language = "pt")
# Complete example with all parameters
df6 <- get_gdp_growth("2011-01-01", "2014-12-31", language = "pt", labels = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.