url.qf | R Documentation |
Get URL for webpage that provides basic demographic information from United States Census Bureau.
url.qf(fips = "", launch = TRUE, clean = TRUE)
fips |
Vector of numeric or character class, required. Can be state FIPs as number or character, for example. |
launch |
TRUE by default, whether to open page in web browser (max=1st 3 URLs opened) |
clean |
Does not use clean.fips() if FALSE, which helps if the countiesall or other list is not yet updated, for example and lacks some new FIPS code |
For information on FIPS codes, see http://www.census.gov/geo/reference/ansi.html,
and also see https://www.census.gov/geo/reference/geoidentifiers.html
####################
If FIPS provided is 10 digits long, assume it is a tract missing a leading zero on the state portion (should have 11 characters).
If FIPS provided is 11 digits long, assume it is a tract (correctly 11 characters), not simply a block group FIPS missing a leading zero (block group FIPS would correctly would have 12 characters).
If FIPS provided is 12 digits long, assume it is a block group (correctly 12 characters).
If FIPS provided is 13 digits long, it is a block group.
If FIPS provided is 14 OR 15 digits long, assume it is a block. But that will not work in this function.
If FIPS is none of the above, return a default URL
Returns table of FIPS, geographic scale, and URL
#
#
#A WHOLE STATE:
#WHERE 01000 = STATE 2-DIGIT FIPS, PLUS 3 ZEROES
#A SINGLE COUNTY:
#URL =
#WHERE XX = STATE 2-DIGIT FIPS
#WHERE YYYYY = STATE 2-DIGIT FIPS AND COUNTY 3-DIGIT FIPS = 5 DIGITS TOTAL
clean.fips()
url.qf( c( '011030001003001', '011030001003', '01103000100', '01005', 1,
c(8:10), 99999) )
## Not run:
url.qf( c( '011030001003001', '011030001003', '01103000100', '01005', 1,
ejanalysis::get.state.info()[ , 'FIPS.ST'], 99999) )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.