Skip to contents

Implements step 1 of https://github.com/FanWangEcon/PrjThaiHFID/issues/22 _notes/issues/issues_20240217_roster_invest_bridge.md

Usage

ffp_hfid_invest_loan_bridge_roster(
  df_invdates_uniq,
  df_loans_bridges_type,
  df_loans_pn_nd,
  verbose = FALSE,
  verbose_detail = FALSE,
  it_verbose_detail_nrow = 100
)

Arguments

df_invdates_uniq

A data frame containing unique investment dates.

df_loans_bridges_type

A data frame containing bridge loan information.

df_loans_pn_nd

A data frame containing distinct timing and lender type loan information.

verbose

A logical value indicating whether to print verbose output. Default is FALSE.

verbose_detail

A logical value indicating whether to print verbose detail output. Default is FALSE.

it_verbose_detail_nrow

An integer specifying the number of rows to print for verbose detail output. Default is 100.

Value

A list containing the roster of investments, loans, and bridges.

Author

Fan Wang, http://fanwangecon.github.io

Examples

df_invdates_uniq <- PrjThaiHFID::tstm_invdates_uniq
df_loans_bridges_type <- PrjThaiHFID::tstm_loans_bridges_type
df_loans_pn_nd <- PrjThaiHFID::tstm_loans_pn_nd
ls_return <- ffp_hfid_invest_loan_bridge_roster(df_invdates_uniq, df_loans_bridges_type, df_loans_pn_nd)
#> Adding missing grouping variables: `br_type`, `br_type_id`
print(ls_return)
#> $tstm_roster_invest_loan_bridge
#> # A tibble: 103,983 × 8
#> # Groups:   hhid_Num [775]
#>    hhid_Num roster_type_id mth_start mth_end roster_type br_type br_type_id
#>       <dbl>          <int>     <dbl>   <dbl> <chr>       <chr>        <int>
#>  1    70201              1        18      18 investment  NA              NA
#>  2    70202              1        31      31 investment  NA              NA
#>  3    70202              2        63      63 investment  NA              NA
#>  4    70202              3       102     102 investment  NA              NA
#>  5    70202              4       111     111 investment  NA              NA
#>  6    70202              5       123     123 investment  NA              NA
#>  7    70202              6       147     147 investment  NA              NA
#>  8    70202              7       147     148 investment  NA              NA
#>  9    70202              8       148     148 investment  NA              NA
#> 10    70203              1        28      28 investment  NA              NA
#> # ℹ 103,973 more rows
#> # ℹ 1 more variable: mth_gap <dbl>
#>