rscorecard icon indicating copy to clipboard operation
rscorecard copied to clipboard

Repayment status variables that are either string or numeric

Open kwanwkim opened this issue 1 year ago • 8 comments

When I make an API call for program-level columns on repayment status (e.g., % of borrowers in default),

sc_2018 <- sc_init() %>% 
  sc_filter(credlev==5) %>% 
  sc_select(unitid, opeid6, instnm, control, main, cipcode, cipdesc, credlev, creddesc, bbrr2_fed_comp_n,bbrr2_fed_comp_dflt,bbrr2_fed_comp_dlnq,bbrr2_fed_comp_fbr,bbrr2_fed_comp_dfr,bbrr2_fed_comp_noprog,bbrr2_fed_comp_makeprog,bbrr2_fed_comp_paidinfull,bbrr2_fed_comp_discharge) %>%
  sc_year(2018) %>% 
  sc_get()

It returns the following error:

Error in `list_unchop()`:
! Can't combine `x[[22]]$repayment.2_yr_bb_fed_comp.default` <character> and `x[[48]]$repayment.2_yr_bb_fed_comp.default` <double>.
Run `rlang::last_trace()` to see where the error occurred.

kwanwkim avatar Mar 14 '24 16:03 kwanwkim

Just now seeing this. Is it still an issue? Sometimes the underlying data changes unexpectedly (and then changes back).

btskinner avatar Mar 18 '24 13:03 btskinner

It still is. I assume it's because program-level variables in debt are now offered either in actual values or value ranges (e.g., 0.3 - 0.4).

kwanwkim avatar Mar 18 '24 15:03 kwanwkim

Okay. If that's the case, I'll need a little bit to adjust the code to account for the new data type. If you are able, I'm glad to look at a pull request.

btskinner avatar Mar 18 '24 17:03 btskinner

Thank you!

On Mon, Mar 18, 2024 at 1:57 PM Benjamin Skinner @.***> wrote:

Okay. If that's the case, I'll need a little bit to adjust the code to account for the new data type. If you are able, I'm glad to look at a pull request.

— Reply to this email directly, view it on GitHub https://github.com/btskinner/rscorecard/issues/17#issuecomment-2004582618, or unsubscribe https://github.com/notifications/unsubscribe-auth/BATDXOZ42DVNSTBRFKIPIILYY4TIRAVCNFSM6AAAAABEWOPOSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUGU4DENRRHA . You are receiving this because you authored the thread.Message ID: @.***>

kwanwkim avatar Mar 18 '24 18:03 kwanwkim

Okay I think I've fixed this. Download the newest release 0.28.0 from GitHub and try it out if you would:

devtools::install_github("btskinner/rscorecard")

btskinner avatar Mar 25 '24 18:03 btskinner

Hi Benjamin,

Thank you very much for the update. Could you take a look at the following error message, which newly appeared since the latest update? It occurs when I pull the 2016 and 2017 data. The codes are attached at the end.

Error in purrr::map2():

! Can't recycle .x (size 5) to match .y (size 71). Run rlang::last_trace() to see where the error occurred.

rlang::last_trace() <error/vctrs_error_incompatible_size> Error in purrr::map2(): ! Can't recycle .x (size 5) to match .y (size 71).


Backtrace: ▆

  1. ├─... %>% sc_get()
  2. └─rscorecard::sc_get(.)
  3. ├─base::suppressWarnings(...)
  4. │ └─base::withCallingHandlers(...)
  5. ├─tibble::as_tibble(...)
  6. └─purrr::map2(...) Run rlang::last_trace(drop = FALSE) to see 6 hidden frames.

And here's my code that returns the error.

sc_2016 <- sc_init() %>% sc_filter(credlev==5) %>% sc_select(unitid, opeid6, instnm, control, main, cipcode, cipdesc, credlev, creddesc, ipedscount1, ipedscount2, bbrr1_fed_comp_dflt) %>% sc_year(2016) %>% sc_get()

On Mon, Mar 25, 2024 at 2:47 PM Benjamin Skinner @.***> wrote:

Okay I think I've fixed this. Download the newest release 0.28.0 from GitHub and try it out if you would:

devtools::install_github("btskinner/rscorecard")

— Reply to this email directly, view it on GitHub https://github.com/btskinner/rscorecard/issues/17#issuecomment-2018674556, or unsubscribe https://github.com/notifications/unsubscribe-auth/BATDXOYKSPFGXLFT2AK3T33Y2BWKPAVCNFSM6AAAAABEWOPOSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJYGY3TINJVGY . You are receiving this because you authored the thread.Message ID: @.***>

kwanwkim avatar Mar 26 '24 04:03 kwanwkim

Try version 0.28.1 (the latest)

btskinner avatar Mar 26 '24 19:03 btskinner

It works perfectly. Thank you.

On Tue, Mar 26, 2024 at 3:20 PM Benjamin Skinner @.***> wrote:

Try version 0.28.1 (the latest)

— Reply to this email directly, view it on GitHub https://github.com/btskinner/rscorecard/issues/17#issuecomment-2021286539, or unsubscribe https://github.com/notifications/unsubscribe-auth/BATDXO6IFK3DAQDSLNBKM4TY2HC65AVCNFSM6AAAAABEWOPOSSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRGI4DMNJTHE . You are receiving this because you authored the thread.Message ID: @.***>

kwanwkim avatar Mar 27 '24 12:03 kwanwkim

Closing

btskinner avatar May 23 '24 11:05 btskinner