This function calculates the bridge type for a given set of loans.
Usage
ffp_hfid_bridge_type(
df_loans_bridges,
verbose = FALSE,
verbose_detail = FALSE,
it_verbose_detail_nrow = 100
)
Arguments
- df_loans_bridges
A data frame containing information about the loans and bridges.
- verbose
A logical value indicating whether to print additional information during the calculation.
- verbose_detail
A logical value indicating whether to print detailed information during the calculation.
- it_verbose_detail_nrow
The number of rows to print when verbose_detail is TRUE.
Author
Fan Wang, http://fanwangecon.github.io
Examples
df_loans_pn_nd <- PrjThaiHFID::tstm_loans_pn_nd
ls_return_a <- ffp_hfid_hook_pairs(df_loans_pn_nd)
df_loans_hooks <- ls_return_a$tstm_loans_hooks
ls_return_b <- ffp_hfid_bridge_from_hook(df_loans_pn_nd, df_loans_hooks)
tstm_loans_bridges <- ls_return_b$tstm_loans_bridges
ls_return_c <- ffp_hfid_bridge_type(tstm_loans_bridges)
print(ls_return_c)
#> $tstm_loans_bridges_type
#> # A tibble: 131,071 × 44
#> # Groups: br_type, br_type_id [22,183]
#> bridge_id br_type br_type_id hhid_Num hh_loan_id_nd_1t2
#> <int> <chr> <int> <dbl> <int>
#> 1 20578 NA 2 70204 34
#> 2 20577 NA 1 70204 33
#> 3 20579 NA 3 70204 40
#> 4 20580 NA 4 70204 45
#> 5 20581 NA 5 70206 71
#> 6 20582 NA 6 70212 119
#> 7 20583 NA 7 70213 128
#> 8 20584 NA 8 70216 149
#> 9 20585 NA 9 70219 175
#> 10 20586 NA 10 70219 176
#> # ℹ 131,061 more rows
#> # ℹ 39 more variables: hh_loan_id_nd_paired_1t2 <int>,
#> # hh_loan_id_nd_paired_2t3 <int>, hh_br_la_n <int>, hh_br_lb_n <int>,
#> # hh_br_lc_n <int>, loan_start_1t2 <dbl>, loan_end_1t2 <dbl>,
#> # loan_start_paired_1t2 <dbl>, loan_end_paired_1t2 <dbl>,
#> # loan_start_paired_2t3 <dbl>, loan_end_paired_2t3 <dbl>, forinfm4_1t2 <chr>,
#> # forinfm4_paired_1t2 <chr>, forinfm4_paired_2t3 <chr>, …
#>