PIP-Technical-Team / pipapi

What the Package Does (One Line, Title Case)
https://pip-technical-team.github.io/pipapi/
Other
3 stars 0 forks source link

pip() fails when povline = NULL #20

Closed Aeilert closed 3 years ago

Aeilert commented 3 years ago

Not really that important, but pip() fails when povline is NULL, which is the default.

The reason it fails is because wbpip:::md_compute_poverty_stats() has a threshold for pov_status <- (welfare < povline_lcu).

Setting povline to NULL does ofc not make a lot of sense, but I don't think the function should fail with its default arguments. We could for example set the default povline to 1.9 or modify the relevant code in {wbpip}.

> debugonce(wbpip:::md_compute_poverty_stats)
> pip(country = 'AGO', '2008', lkup = lkups, paths = paths)
  Error in rep(0, collapse::fsum(!pov_status)) : invalid 'times' argument
tonyfujs commented 3 years ago

Thanks @Aeilert pip() povline argument defaulting to 1.9 seems like the correct behavior here. Will update.