census_format: Format Various Geocoding Outputs into Census Format

View source: R/census_format.R

census_formatR Documentation

Format Various Geocoding Outputs into Census Format

Description

This function takes a dataframe of geocoding outputs and wrangles it into a Census Geocoder output format for comparability. The main variable names are set as "address_input", "match", "match_detail", "address_output", "latlon", "tiger", "side", "state_fips", "county_fips", "census_tract", and "census_block".

Usage

census_format(
  df,
  input_type = "n/a",
  longitude = "longitude",
  latitude = "latitude",
  street = "street",
  city = "szSitusCity",
  state = "sSitusState",
  zip = "sSitusZip",
  cutoff = 0.87,
  accuracy = NULL,
  addr_all = NULL,
  sep = ", ",
  file_date = NULL,
  vars_keep = NULL
)

Arguments

df

Input dataframe.

input_type

Type of output. You can specify 'geocodio' or 'dstk'.

longitude

Variable name for longitude. Defaults to "longitude."

latitude

Variable name for latitude. Defaults to "latitude"

street

Variable for street address.

city

Variable for city.

state

Variable for state abbreviation.

zip

Variable for zip code.

cutoff

If specified with 'accuracy', will filter for geocoded outputs with accuracy level above the cutoff. Defaults to 0.87.

accuracy

Variable for accuracy.

addr_all

Variable for one-line address, or street-city-state-zip pasted. It will be created if not specified as existing variable.

sep

Separator to use in creating 'addr_all'.

file_date

Geocoded date. Defaults to 'Sys.time()'.

vars_keep

Variables to keep besides the census format.


sysilviakim/Kmisc documentation built on Jan. 28, 2023, 10:58 a.m.