Skip to contents

Returns the annual general government consolidated gross debt as a percentage of GDP for the euro area, from the ECB's government finance statistics dataset (GFS).

Usage

ecb_government_debt(from = NULL, to = NULL, cache = TRUE)

Arguments

from

Optional start date (year, e.g. "2000").

to

Optional end date.

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. 1 January of each year.

value

Numeric. Government debt as a percentage of GDP.

See also

Examples

# \donttest{
op <- options(readecb.cache_dir = tempdir())
try({
  ecb_government_debt(from = "2000")
})
#>  Fetching government debt-to-GDP ratio
#>  Fetching government debt-to-GDP ratio [30.1s]
#> 
#> Error in ecb_fetch("GFS", "A.N.I9.W0.S13.S1.C.L.LE.GD.T._Z.XDC_R_B1GQ._T.F.V.N._T",  : 
#>   The ECB Data Portal returned a web page rather than data (HTTP 504).
#>  This usually means the service is temporarily unavailable or under
#>   maintenance, rather than that the query is wrong.
#>  Dataflow "GFS", key "A.N.I9.W0.S13.S1.C.L.LE.GD.T._Z.XDC_R_B1GQ._T.F.V.N._T".
options(op)
# }