A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pdil/usmap/issues/10 below:

`fips` should be vectorized for counties · Issue #10 · pdil/usmap · GitHub

Actual Behavior

Currently, the following does not work:

fips("NJ", county = c("Bergen", "Hudson"))

As it outputs the following:

#> [1] "34003"
#> Warning messages:
#> 1: In if (county_ == "") { :
#>   the condition has length > 1 and only the first element will be used
#> 2: In name == county_ :
#>   longer object length is not a multiple of shorter object length
#> 3: In name == paste(county_, "county") :
#>   longer object length is not a multiple of shorter object length

It just results in the FIPS code of the first county entered in the vector, followed by a warning.

Expected Behavior
fips("NJ", county = c("Bergen", "Hudson"))
#> [1] "34003" "34017"

This would allow the ability to quickly convert a column of county names to a FIPS code in a data frame.

Things to Consider
fips(state = c("NJ", "NY"), county = c("Bergen", "Hudson", "Westchester")

This would not work unless there was a direct mapping between the state and county parameters. In this case it would be easier to throw an error.


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