Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 2 KB

CountyStaticReport.md

File metadata and controls

63 lines (40 loc) · 2 KB

County Counts For 2002-2012

# pathInputDirectory <-
# 'F:/Projects/OuHsc/SafeCare/Spatial/SafeCareSpatial/PhiFreeDatasets'
pathInputDirectory <- file.path(getwd(), "PhiFreeDatasets")
pathInputSummaryCounty <- file.path(pathInputDirectory, "CountCountyFortified.csv")

dsValueAllVariables <- read.csv(pathInputSummaryCounty, stringsAsFactors = FALSE)
dvName <- "CountPerCapitaAnnual"  #The number of victims per county population; darker counties have more victims, adjusted for pop
dsValueAllVariables$DV <- dsValueAllVariables[, dvName]
# dsValueAllVariables$DVLabel <- round(dsValueAllVariables$DV, 2) #Keeps
# leading zeros
dsValueAllVariables$DVLabel <- gsub("^0.", ".", round(dsValueAllVariables$DV, 
    3))  #Remove leading zeros.
MapCounties(dsValueAllVariables, deviceWidth = 14)

plot of chunk CountPerCapita

dvName <- "CountPerCapitaRank"  #The county's rank for the number of victims per county population; darker counties have more victims, adjusted for pop
dsValueAllVariables$DV <- dsValueAllVariables[, dvName]
dsValueAllVariables$DVLabel <- dsValueAllVariables$DV
MapCounties(dsValueAllVariables, deviceWidth = 14)

plot of chunk CountPerCapitaRank

dvName <- "Count"  #The county's rank for the number of victims per county population; darker counties have more total victims
dsValueAllVariables$DV <- dsValueAllVariables[, dvName]
dsValueAllVariables$DVLabel <- scales::comma(dsValueAllVariables$DV)
MapCounties(dsValueAllVariables, deviceWidth = 14)

plot of chunk Count

dvName <- "PopTotal"  #The county's 2010 census population; darker counties have more people
dsValueAllVariables$DV <- dsValueAllVariables[, dvName]
dsValueAllVariables$DVLabel <- scales::comma(dsValueAllVariables$DV)
MapCounties(dsValueAllVariables, deviceWidth = 14)

plot of chunk PopTotal