Wokring on age comparison in Kemmerer and Lincoln
This commit is contained in:
parent
fa11049040
commit
06b8a858e2
@ -24,5 +24,6 @@ YEARS <- 2023:(2023+NUM_YEARS_PROJECTED)
|
||||
GRAPH_DATA$Percentile <- factor(GRAPH_DATA$Percentile,levels=rev(c('2.5%','5%','10%','25%','40%','60%','75%','90%','95%','97.5%')))
|
||||
GRAPH <- ggplot(data=GRAPH_DATA)+geom_ribbon(data=FAN_DATA,aes(x=Year,ymin=`2.5%`,ymax=`97.5%`),alpha=ALPHA,fill=COLOR)+geom_ribbon(data=FAN_DATA,aes(x=Year,ymin=`5%`,ymax=`95%`),alpha=ALPHA,fill=COLOR)+geom_ribbon(data=FAN_DATA,aes(x=Year,ymin=`10%`,ymax=`90%`),alpha=ALPHA,fill=COLOR)+geom_ribbon(data=FAN_DATA,aes(x=Year,ymin=`25%`,ymax=`75%`),alpha=ALPHA,fill=COLOR)+geom_ribbon(data=FAN_DATA,aes(x=Year,ymin=`40%`,ymax=`60%`),alpha=ALPHA,fill=COLOR)+geom_line(aes(x=Year,y=Population,group=Percentile,color=Percentile))+geom_line(data=HIST,aes(x=Year,y=Population),color='black',size=0.75)+geom_line(data=MEDIAN_PRED,aes(x=Year,y=Population),color='black',linetype=4,size=0.75)+ scale_x_continuous(breaks = c(seq(1940, 2070, by = 10)))+ scale_y_continuous(breaks = seq(0, 35000, by = 5000))+theme_bw()+ggtitle("Lincoln County, Wyoming Population Forecast")
|
||||
GRAPH
|
||||
ggsave("Lincoln_Forecast.png",GRAPH)
|
||||
length(RES$SIM_ID %>% unique)
|
||||
ggsave(Lincoln_Forecast.png",GRAPH)
|
||||
|
||||
|
||||
44
Zip_Code.r
Normal file
44
Zip_Code.r
Normal file
@ -0,0 +1,44 @@
|
||||
library(tidyverse)
|
||||
library(tidycensus)
|
||||
library(zipcodeR)
|
||||
KEY <- '30e13ab22563318ff59286e433099f4174d4edd4'
|
||||
TRACTS <- get_tracts(search_city('Diamondville','WY')$zipcode) %>% full_join(get_tracts(search_city('Kemmerer','WY')$zipcode))
|
||||
TRACTS
|
||||
census_api_key(KEY, install = TRUE)
|
||||
vars <- c("P2_002N")
|
||||
get_decennial(geography="tract",variables=vars,state='WY',county='lincoln',GEOID='56023978400')
|
||||
vars <- c("B01001_004","B01001_005")
|
||||
|
||||
get_acs(geography="tract",variables=vars,state='WY',county='lincoln',GEOID='56023978400')
|
||||
######MALE
|
||||
VARS <-c(
|
||||
#Under_Five
|
||||
'B01001_003E',
|
||||
#5-9
|
||||
'B01001_004E',
|
||||
#10-14
|
||||
'B01001_005E',
|
||||
#15-17
|
||||
'B01001_006E',
|
||||
#18-19
|
||||
'B01001_007E',
|
||||
#20
|
||||
'B01001_008E',
|
||||
#21
|
||||
'B01001_009E',
|
||||
#22-24
|
||||
'B01001_010E',
|
||||
#25-29
|
||||
'B01001_011E',
|
||||
#85+
|
||||
'B01001_025E')
|
||||
TEMP <- get_acs(geography="tract",variables=VARS,state='WY',county='lincoln')
|
||||
KEM <- TEMP %>% filter(GEOID=='56023978400')
|
||||
KEM
|
||||
19/sum(KEM$estimate)
|
||||
|
||||
LN <- TEMP %>% filter(GEOID!='56023978400')
|
||||
LN
|
||||
19/sum(KEM$estimate)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user