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

fips_info should not sort and remove duplicates #47

Closed
aavogt opened this issue Apr 13, 2021 · 1 comment · Fixed by #51
Closed

fips_info should not sort and remove duplicates #47

aavogt opened this issue Apr 13, 2021 · 1 comment · Fixed by #51
Assignees
Labels
bug A bug or issue that should be resolved
Milestone

Comments

@aavogt
Copy link

aavogt commented Apr 13, 2021

I was surprised that fips_info would sort and remove duplicates from the argument.

Current:

fips_info(c("21","20","20"))

  abbr fips     full
1   KS   20   Kansas
2   KY   21 Kentucky

Expected:

  abbr fips     full
1   KY   21 Kentucky
2   KS   20   Kansas
3   KS   20   Kansas

In other words

 new_fips_info <- function(fips) if (length(fips)!=0)
     merge(list(fips=fips), fips_info(), all.x=TRUE )

This comes up when I want the state name from the fips stored in df$fips. I expected this to work within(df, state <- fips_info(fips)$full). Instead merge(df, fips_info(), all.x=T) %>% rename(state='full') will do.

@aavogt aavogt added the bug A bug or issue that should be resolved label Apr 13, 2021
@pdil
Copy link
Owner

pdil commented Apr 18, 2021

That's a good point, I'll look into making that change.

@pdil pdil added this to the v0.6.0 milestone Feb 11, 2022
@pdil pdil self-assigned this Feb 11, 2022
@pdil pdil closed this as completed in #51 Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug or issue that should be resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants