R/bg19.R

#' @name bg19
#' @docType data
#' @title The 2019 version of EJSCREEN data, plus lat lon, countynames, etc., minus some nonessential fields
#' @description
#'   Note the 2018 version of EJSCREEN (released late 2018)
#'     actually uses ACS2016, which is from 2012-2016 (released late 2017).
#'   Note the 2019 version of EJSCREEN (released late 2019)
#'     actually uses ACS2017, which is from 2013-2017 (released late 2018).
#'   This data set is the EJSCREEN dataset from the ftp site but with
#'   fields renamed for easier use in the ejscreen package,
#'   and some columns dropped (svi6-related, and the 2 alternative versions of an EJ Index)
#'   and some fields added (lat lon for bg centroids, flagged if any of EJ indexes above 80th percentile in US),
#'   and state name and state abbrev and county name and FIPS for tract, county, state,
#'   BUT NOT REMOVING a handful of rows removed from the data (that had NA values in FIPS.ST)
#'   Also, it does not include the lookup tables of percentiles for USA, Regions, States, which are in the gdb.
#' @details
#'   It was created for this package as follows: \cr\cr
#'     \code{require(ejscreen); require(ACSdownload)} \cr
#'     \code{require(proxistat) # for the lat lon of each block group }\cr
#'     \code{require(analyze.stuff); require(ejanalysis); require(readr)} \cr
#'      \cr
#'   \code{ bg <- ejscreen.download(yr = 2018, addflag = TRUE)} \cr
#'   \code{ #    OR IF ALREADY DOWNLOADED AND UNZIPPED (as with 2019 dataset), JUST DO THIS: }\cr\cr
#'   \cr 2019 version of EJSCREEN downloaded 2019-08-27 from public FTP site
#'   \cr as gdb format (zipped)
#'   \cr EJSCREEN_V2019.gdb.zip
#'   \cr then unzipped to
#'   \cr EJSCREEN_V2019.gdb
#'   \cr Opened EJSCREEN_V2019.gdb file in ESRI's ArcGIS
#'   \cr
#'   \cr Opened attribute table EJSCREEN_Full
#'   \cr Exported all records as text format to a file named
#'   \cr EJSCREEN_Full_2019_Export_Output.csv
#'   \cr
#'   \cr That has this format:
#'   \cr
#'   \cr OBJECTID,ID,ACSTOTPOP,ACSIPOVBAS,ACSEDUCBAS,ACSTOTHH,ACSTOTHU,MINORPOP,MINORPCT,LOWINCOME,LOWINCPCT,LESSHS,LESSHSPCT,L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F_D6,T_PTSDF_B2,T_PTSDF_B6,T_PTSDF_P2,T_PTSDF_P6,T_OZONE,T_OZONE_D2,T_OZONE_D6,T_OZONE_B2,T_OZONE_B6,T_OZONE_P2,T_OZONE_P6,T_PM25,T_PM25_D2,T_PM25_D6,T_PM25_B2,T_PM25_B6,T_PM25_P2,T_PM25_P6,AREALAND,AREAWATER,NPL_CNT,TSDF_CNT,Shape_Length,Shape_Area
#'   \cr 1,010010201001,692,692,441,300,300,58,0.083815028901734,203,0.293352601156069,86,0.195011337868480,12,0.040000000000000,34,0.049132947976879,66,0.095375722543353,87,0.289999999999999,0.188583815028902,0.126114606407752,130.499999999999858,87.271307634164643,-116.176110108974143,-39.018093266051089,0.278663068700000,49.377031606578001,0.788051737455781,91.015900085494806,0.000000000000000,0.070941549054473,0.085200688891463,0.065577824536874,40.121728758169901,9.998131693989070,-33.691071931602380,-11.315247047154775,37.844999999999828,25.308679213907656,0.054689306358381,0.036573235858248,-32.373991352595830,-10.872901604340603,36.365530465349963,24.319290394798056,0.052551344603107,0.035143483229477,-5736.431460780102498,-1926.597624426212860,6443.702624658421882,4309.198115399539347,9.311708995171131,6.227164906646734,-91.552785422231196,-30.748276190523271,102.840751737979318,68.774305611141415,0.148613803089565,0.099384834698181,-10573.873229999833711,-3551.266878229423583,11877.574961157059079,7943.076615961609605,17.164125666411937,11.478434416129494,-0.000000000000000,-0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,0.000000000000000,-8.241713214253599,-2.768003977445550,9.257872151608664,6.191161751577060,0.013378427964752,0.008946765536961,-9.898284614015102,-3.324368425498922,11.118689900335962,7.435575530889657,0.016067470954243,0.010745051345216,-7.618576564102895,-2.558721673964495,8.557906102062088,5.723062499136828,0.012366916332460,0.008270321530545,-4661.186377971540423,-1565.473354681477304,5235.885602941166326,3501.475733268755903,7.566308674770472,5.059936030735197,-1161.544048564898276,-390.108034922326908,1304.756186065572138,872.550026833011771,1.885485818013833,1.260910443400306,Alabama,AL,4,19.172346440714101,49.803832755479903,77.490119317894596,68.258692161818203,40.308120131198102,29.655221836253499,61.483232533938398,27.956008093060198,33.954194279955800,32.554315247728198,97.929345243657295,98.312186568132205,33.680634484248699,37.104122374245200,54.843236155321698,12.272169521959199,11.160553319132500,29.391520279385102,89.657788143941801,28.988505132890602,30.949690980410701,35.783183811554302,37.291452824197499,54.685299071298999,57.129634048918199,44.012825004408398,46.691260560338598,11.652979793405899,10.788576625282300,28.890338248503500,31.736125271289300,34.005976742834797,38.401041704093700,22.021880781888100,23.541688341256801,50.197038423065898,62.458790596420300,29.372161231166100,34.317707857103898,27.177155067942600,30.069757647227000,56.169566885488898,68.943398019004405,39.047501924171399,41.709592790730802,20.825437141116900,21.155833539693401,31.217849604164499,32.524457834000998,74.852377961278293,75.502075272131705,37.113364926482099,37.104401186616698,37.113364926482099,37.104401186616698,36.137587045650697,39.582426978954203,22.756600347857500,24.726655232493400,45.558272974115297,49.945977844472402,51.563740057936300,53.309213913689398,4.872739955872320,4.162551575187560,13.745101013519699,13.905164859621401,52.077709014131997,53.671866255717802,4.401594710816540,3.976171267953960,11.255899050631999,11.269424410114100,46.595363646338299,49.056278222719598,7.348294614023760,5.455025957130210,26.305722735089901,31.249177184301399,41.471592908215001,44.790307669529298,13.290298875265000,12.569774206701499,38.788121347698798,48.825892963442001,2,5,8,7,5,3,7,3,4,4,11,11,4,4,6,2,2,3,9,3,4,4,4,6,6,5,5,2,2,3,4,4,4,3,3,6,7,3,4,3,4,6,7,4,5,3,3,4,4,8,8,4,4,4,4,4,4,3,3,5,5,6,6,1,1,2,2,6,6,1,1,2,2,5,5,1,1,3,4,5,5,2,2,4,5,8% (19%ile),29% (49%ile),20% (77%ile),4% (68%ile),5% (40%ile),10% (29%ile),19% (27%ile),13% (33%ile),0.29 = fraction pre-1960 (61%ile),28%ile,30%ile,35%ile,37%ile,54%ile,57%ile,0.279 ug/m3 (32%ile),44%ile,46%ile,11%ile,10%ile,28%ile,31%ile,49 lifetime risk per million (97%ile),34%ile,38%ile,22%ile,23%ile,50%ile,62%ile,0.79  (98%ile),29%ile,34%ile,27%ile,30%ile,56%ile,68%ile,91 daily vehicles/meters distance (33%ile),39%ile,41%ile,20%ile,21%ile,31%ile,32%ile,0 toxicity-weighted concentration/meters distance (37%ile),74%ile,75%ile,37%ile,37%ile,37%ile,37%ile,0.071 sites/km distance (54%ile),36%ile,39%ile,22%ile,24%ile,45%ile,49%ile,0.085 facilities/km distance (12%ile),51%ile,53%ile,4%ile,4%ile,13%ile,13%ile,0.066 facilities/km distance (11%ile),52%ile,53%ile,4%ile,3%ile,11%ile,11%ile,40.1 ppb (29%ile),46%ile,49%ile,7%ile,5%ile,26%ile,31%ile,10 ug/m3 (89%ile),41%ile,44%ile,13%ile,12%ile,38%ile,48%ile,4249517.000000000000000,28435.000000000000000,0,0,13435.975560078893977,6026827.886684723198414
#'   \cr
#'   \code{#  bg <- ejscreen.download(justreadname = 'EJSCREEN_Full_2019_Export_Output.csv', addflag = TRUE)} \cr\cr
#'   # Starts by reading in 368 columns from csv, then has about 373 columns \cr
#'   # after \link{ejscreen.download}, which renames fields, drops an ID field, \cr
#'   # and adds fields called FIPS.TRACT, FIPS.COUNTY, FIPS.ST, countyname, flagged. \cr\cr
#'   # Then for this package, got rid of some nonessential fields:  \cr
#'   # (But note svi6 fields - which combine all 6 demog indicators not just 2 - were named in names.d) \cr\cr
#'   \code{bg <- bg[ , !grepl(pattern = 'svi6', x = names(bg))]} \cr
#'   \code{bg <- bg[ , !grepl(pattern = 'pctile\\\\.text', x = names(bg))]} \cr
#'   \code{bg <- bg[ , !grepl(pattern = 'EJ\\\\.PCT', x = names(bg))]} \cr
#'   \code{bg <- bg[ , !grepl(pattern = 'EJ\\\\.BURDEN', x = names(bg))]} \cr
#'   \code{bg <- bg[ , names(bg) != 'ID_1'] } \cr
#'   \code{bg <- bg[ , names(bg) != 'Shape_Length'] } \cr
#'   # The ID_1 field is like FIPS but NA where some data missing \cr\cr
#'   # Then added lat, lon fields for block group centroids, via \link[proxistat]{bg.pts} from proxistat package:\cr
#'   \code{bg <- merge(bg, bg.pts[ , c('FIPS', 'lat')], by.x = 'FIPS', by.y = 'FIPS', all.x = TRUE, all.y = FALSE)} \cr
#'   \code{bg <- merge(bg, bg.pts[ , c('FIPS', 'lon')], by.x = 'FIPS', by.y = 'FIPS', all.x = TRUE, all.y = FALSE)} \cr\cr
#'   \code{plot(bg$lon[bg$lon < -50], bg$lat[bg$lon < -50], pch = '.')} \cr\cr
#'   # \code{sum(is.na(bg$FIPS.ST))} \cr
#'   # \code{[1] 13} \cr\cr
#'   # THEN USE A NAME SPECIFIC TO THE YEAR: \cr
#'   \code{bg19 <- bg} \cr
#'   \code{save(bg19, file = 'bg19.rdata')} \cr \cr
#' @concept datasets
#' @format data.frame with 220,333 rows (block groups) and 118 columns (may vary by year)
NULL
ejanalysis/ejscreen documentation built on Dec. 31, 2019, 11:52 p.m.