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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4