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.
See also
Used by vignette(s) ffv_invest_loan_bridge. Related issue(s):
PrjThaiHFID-#32.
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: 94,907 × 47
#> # Groups: br_type, br_type_id [19,758]
#> bridge_id br_type br_type_id hhid_Num hh_loan_id_nd_1t2
#> <int> <chr> <int> <int> <int>
#> 1 17748 NA 1 1031 27
#> 2 17751 NA 4 1113 106
#> 3 17749 NA 2 1113 88
#> 4 17750 NA 3 1113 89
#> 5 17752 NA 5 1119 114
#> 6 17753 NA 6 1119 115
#> 7 17754 NA 7 1123 135
#> 8 17755 NA 8 1133 175
#> 9 17756 NA 9 1167 197
#> 10 17757 NA 10 1167 212
#> # ℹ 94,897 more rows
#> # ℹ 42 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>, …
#>