Commit 9316a238 authored by Mateo CAICEDO's avatar Mateo CAICEDO

Modification of BIS table labels and chain function modification.

parent e8470792
......@@ -74,13 +74,13 @@ filter <- paste0("Q.",url_country,".N+H.A.M.XDC.A")
df <- rdb("BIS","CNFS",mask = filter)
loans <- df %>%
select(period, series_code, value, `Borrowers' country`, series_name) %>%
select(period, series_code, value, BORROWERS_CTY, series_name) %>%
rename(time = period,
var = series_code,
values = value,
country = `Borrowers' country`) %>%
country = BORROWERS_CTY) %>%
mutate(time=as.Date(as.yearqtr(gsub("Q","",time))),
values=ifelse(values=="",NA,values),
values=ifelse(values=="NA",NA,values),
values = as.numeric(values)) %>%
na.omit() %>%
filter(year(time)>=1980) %>%
......@@ -164,9 +164,9 @@ chain <- function(to_rebase, basis, date_chain) {
group_by(var) %>%
mutate(growth_rate = c(1, values[-1]/lag(values)[-1])) %>%
full_join(valref, by = "var") %>%
group_by(var) %>%
transmute(time, values = cumprod(growth_rate)*values_ref) %>%
ungroup()
ungroup() %>%
transmute(var,time, values = cumprod(growth_rate)*values_ref)
res %<>%
bind_rows(filter(basis, time > date_chain)) %>%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment