url.qf: US Census Quickfacts Webpage URL

View source: R/url.qf.R

url.qfR Documentation

US Census Quickfacts Webpage URL

Description

Get URL for webpage that provides basic demographic information from United States Census Bureau.

Usage

url.qf(fips = "", launch = TRUE, clean = TRUE)

Arguments

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

Details

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

Value

Returns table of FIPS, geographic scale, and URL

NOTES:

#

URL FORMATS FOR QUICKFACTS REPORT ON A COUNTY FROM CENSUS QUICKFACTS SITE:

#
#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

See Also

clean.fips()

Examples

 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)

ejanalysis/ejanalysis documentation built on April 2, 2024, 10:12 a.m.