Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor function cep_to_state #265

Merged
merged 2 commits into from
Jul 8, 2023

Conversation

aspeddro
Copy link
Contributor

@aspeddro aspeddro commented Nov 17, 2021

This PR refactor cep_to_state function.

  • Remove nesteds ifelse, uses a structure that is easier to maintain
  • Remove unnecessary vectorization (ifelse and &)
  • Stricter verification, now cep_to_state("7900000000000000") raise a error. Currently return "MS"

@rafapereirabr
Copy link
Member

Hi @aspeddro . Thank you for your contribution and pleace accept my apologies for taking so much time to get back to you. The code of the function looks much nicer now. However, the new function does not pass the tests in test-cep_to_state.R.

The function should be able to throw an informative error message in these situations below:

cep_to_state(cep = 'aaaa') 
cep_to_state() 

@rafapereirabr
Copy link
Member

I've added a few checks that were missing. Thanks!

@rafapereirabr rafapereirabr merged commit 572427c into ipeaGIT:master Jul 8, 2023
0 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants