You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling data(USA_county_data), the fips column imports as numeric, which obviously causes problem for the 317 counties where the FIPS begins with a 0.
This is easily rectifiable (I ran for (i in 1:nrow(USA_county_data)) {if(nchar(USA_county_data$fips[i]) == 4) {USA_county_data$fips[i] <- paste0("0", USA_county_data$fips[i])}}) but it seems like the data should ideally come in leading-zero-preserving character format to begin with.
The text was updated successfully, but these errors were encountered:
Some sources use integers (thus no leading 0's), others use characters (i.e. preserve leading 0's). However, this does not cause any actual ambiguity because there are no pairs like {00123, 123}. One can easily add them back using stringr::str_pad().
When calling
data(USA_county_data)
, thefips
column imports as numeric, which obviously causes problem for the 317 counties where the FIPS begins with a 0.This is easily rectifiable (I ran
for (i in 1:nrow(USA_county_data)) {if(nchar(USA_county_data$fips[i]) == 4) {USA_county_data$fips[i] <- paste0("0", USA_county_data$fips[i])}}
) but it seems like the data should ideally come in leading-zero-preserving character format to begin with.The text was updated successfully, but these errors were encountered: