diff --git a/index.html b/index.html
index 6ee2ded..03004ee 100644
--- a/index.html
+++ b/index.html
@@ -65,8 +65,9 @@
https://rfa.sc.gov/data-research/population-demographics/census-state-data-center/estimates-projections-dashboard/estimates-projections-data-downloads
More information on the South Carolina Water Plan is available on the SC DES website:
https://www.des.sc.gov/programs/bureau-water/hydrology/water-planning/water-planning-overview
-The Methods section of this document includes metadata from the SC RFA and a detailed description of the calculations for the extended projections and High scenario.
-The Results section includes graphical and tabular results for all counties.
+The Introduction article provides an overview of the county population projection data and shows some example graphs.
+The Methods article includes metadata from the SC RFA and a detailed description of the calculations for the extended projections and High scenario.
+The Results article (Work in Progress) includes graphical and tabular results for all counties.
Use in R
diff --git a/pkgdown.yml b/pkgdown.yml
index 211c5c1..ab0097b 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -5,7 +5,7 @@ articles:
intro: intro.html
methods: methods.html
results: results.html
-last_built: 2024-12-11T01:55Z
+last_built: 2024-12-11T02:01Z
urls:
reference: https://capellett.github.io/scpopulation/reference
article: https://capellett.github.io/scpopulation/articles
diff --git a/search.json b/search.json
index f4ab06f..ef1b3a5 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://capellett.github.io/scpopulation/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 C Pellett Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"projection-methods","dir":"Articles","previous_headings":"","what":"Projection Methods","title":"Population Projection Methodology","text":"SC Office Revenue Fiscal Affairs (RFA) publishes population projections county state. RFA population projections stratified gender cohort. projections developed using cohort-component method: rates birth, death, migration calculated gender-cohort county; calculated rates applied county populations project future populations year year. One assumption underlying method relevant demographic rates calculated calibration period remain uniform across projection period.","code":""},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"metadata","dir":"Articles","previous_headings":"Projection Methods","what":"2019 Metadata","title":"Population Projection Methodology","text":"“Population estimates 2000 2018 calculated using Bridged-race Intercensal Population Estimates July 1, 2000 -July 1, 2009 Vintage 2018 Bridged-Race Postcensal Estimates July 1, 2010 -July 1, 2018. estimates produced Population Estimates Program U.S. Census Bureau collaboration National Center Health Statistics. Estimates 2000 2018 previous future releases postcensal estimates vary slightly 2000 2018 data table. years, population estimated July 1st year. Estimates 2000 2010 equivalent April 1st decennial census count Census 2000 Census 2010.” “Population Projections 2019 2035 calculated S.C. Revenue Fiscal Affairs Health Demographics Section. Births deaths data used population projections calculations supplied SC DHEC Division Biostatistics. “Note: projections included report calculated using cohort-component model demographic change. model uses base population beginning date, applies assumed survival rates, fertility rates, net migration calculate population projections. “projections intended forecast; rather, intended demonstrate likely scenario future events unfold manner reflects previous trends observed within group. model account unprecedented events may significantly alter area’s demographic composition future. possible events include large factory openings closings, changes technology, public health crises, environmental events, changes economy, conditions affect birth rates, death rates, domestic international migration. means population projections likely accurate immediate future distant years future.”","code":""},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"metadata-1","dir":"Articles","previous_headings":"Projection Methods","what":"2022 Metadata","title":"Population Projection Methodology","text":"“Sources: Vintage 2020 Postcensal Estimates July 1, 2010 -July 1, 2019. Vintage 2021 Postcensal Estimates July 1, 2020. estimates produced Population Estimates Program U.S. Census Bureau. Estimates 2010 2020 previous future releases postcensal estimates vary slightly 2010 2020 data table. years, population estimated July 1st year. Estimates 2020 equivalent April 1st decennial census count Census 2020. “Population Projections 2021 20230 calculated S.C. Revenue Fiscal Affairs Data Integration Analysis Division. Births deaths data used population projections calculations supplied SC DHEC Division Biostatistics. “Note: projections included report calculated using cohort-component model demographic change. model uses base population distributed age sex beginning date, applies assumed survival rates, age-specific fertility rates, net migration age sex calculate population projections. “projections offer one possible scenario future population change using current data available. overall accuracy projections depends extent future events unfold manner reflects previous trends observed within group. model account unprecedented events may significantly alter area’s demographic composition future. possible events include large factory openings closings, changes technology, public health crises, environmental events, changes economy, conditions affect birth rates, death rates, domestic international migration. means population projections likely accurate immediate future distant years future.”","code":"## Everything I do here will be done with both editions of the population projections. ## that way the changes across editions can be compared. load(\"../data/pop19.rda\") load(\"../data/pop22.rda\") ## As more editions come out, keep appending them here. pop1 <- dplyr::bind_rows( `2019`=dplyr::select(pop19, -FIPS), `2022`=dplyr::select(pop22, -FIPS), ## `2025` = pop25, ## for example. .id='Edition') |> dplyr::mutate(County = stringr::str_to_upper(County), Type = dplyr::recode(Type, Projection='SC RFA Projection')) rm(pop19, pop22)"},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"growth-and-growth-rate","dir":"Articles","previous_headings":"Projection Methods","what":"Growth and Growth Rate","title":"Population Projection Methodology","text":"Two parameters calculated RFA population projections: average annual change population, ΔPop\\Delta Pop, average annual growth rate, AGRAGR. Population growth expressed number people per year (linear growth), population growth rate expressed percentage (exponential growth). PopPop County population. TT Time (Year projection) subscripts 0 1 represent first last years RFA projection. n=T1−T0n = T_1 - T_0 edition RFA projections, nn number years ΔPop=(Pop1−Pop0)/n\\Delta Pop = ( Pop_1 - Pop_0 ) / n average annual population growth county calculated taking difference first last years projected populations, dividing number years (n). ${AGR} = \\sqrt[n]{ \\frac{Pop_1}{{Pop_0}}$ average annual growth rate (AGR) calculated dividing projected populations last year projected populations first year finding nth root. akin calculating annually compounding interest rate, results decimal can expressed percentage. state average AGR 1.19% 2019 vintage, 0.83% 2022 vintage RFA projections. AGR values high projection scenario calculated two steps. First, county AGRs lower state average raised equal state average RFA projection. , county AGRs increased 10%. example, minimum county population growth rate High scenario vintage 2019 1.31% (1.19% * 1.1 = 1.31%). following table summarizes annual growth (ΔPop\\Delta Pop) annual growth rates (AGRAGR)county, edition RFA projections.","code":"## I'm gonna go ahead and calculate the linear and exponential growth rates ## for the Estimated data across the baseline as well as the RFA projections. ## Each set of Edition, County, and Type is considered an independent timeseries ## Time 0 is the first year of that series, and Time 1 is the last year of the series. pop2 <- pop1 |> dplyr::group_by(Edition, County, Type) |> dplyr::mutate( T_0 = min(Year), T_1 = max(Year), Pop_0 = Population[which(Year==T_0)], Pop_1 = Population[which(Year==T_1)], Growth_linear = (Pop_1 - Pop_0)/(T_1-T_0), Growth_exp = (Pop_1/Pop_0)^(1/(T_1-T_0)), Growth_moderate = pmax(Growth_linear, 0)) |> dplyr::ungroup() hi_growth_floor <- pop2 |> dplyr::filter(County %in% c('South Carolina', 'SOUTH CAROLINA')) |> dplyr::distinct(Edition, Type, Growth_exp) |> dplyr::rename(Growth_exp_floor=Growth_exp) pop3 <- pop2 |> dplyr::left_join(hi_growth_floor, c(\"Edition\", \"Type\")) |> dplyr::mutate(Growth_hi = ((pmax(Growth_exp, Growth_exp_floor)-1)*1.1)+1) pop_rates <- pop3 |> dplyr::distinct(Edition, County, Type, T_0, T_1, Pop_0, Pop_1, Growth_moderate, Growth_hi) pop_rates ## # A tibble: 188 × 9 ## Edition County Type T_0 T_1 Pop_0 Pop_1 Growth_moderate Growth_hi ## ## 1 2019 ABBEVILLE Estima… 2000 2018 26229 24541 0 1.01 ## 2 2019 ABBEVILLE SC RFA… 2019 2035 24410 22195 0 1.01 ## 3 2019 AIKEN Estima… 2000 2018 142742 169401 1481. 1.01 ## 4 2019 AIKEN SC RFA… 2019 2035 170345 180550 638. 1.01 ## 5 2019 ALLENDALE Estima… 2000 2018 11193 8903 0 1.01 ## 6 2019 ALLENDALE SC RFA… 2019 2035 8725 6160 0 1.01 ## 7 2019 ANDERSON Estima… 2000 2018 166304 200482 1899. 1.01 ## 8 2019 ANDERSON SC RFA… 2019 2035 202520 234420 1994. 1.01 ## 9 2019 BAMBERG Estima… 2000 2018 16680 14275 0 1.01 ## 10 2019 BAMBERG SC RFA… 2019 2035 14030 10425 0 1.01 ## # ℹ 178 more rows summary0 <- pop3 |> # pop_proj |> dplyr::filter(Type == 'SC RFA Projection') |> dplyr::mutate( dplyr::across( c(Pop_0, Pop_1, Growth_linear, Growth_moderate), as.integer), dplyr::across( c(Growth_exp, Growth_hi), function(x) {round((x-1)*100, 2)}), Edition = paste0(Edition, ' Edition. (', T_0, '-', T_1, '). n = ', T_1-T_0)) |> dplyr::select(County, Edition, Pop_0, Pop_1, `RFA $\\\\Delta Pop$`= Growth_linear, `Mod. $\\\\Delta Pop$`= Growth_moderate, `RFA AGR` = Growth_exp, `High AGR` = Growth_hi) |> unique() summary1 <- summary0 |> tidyr::pivot_wider( names_from = Edition, id_cols=County, values_from = 3:8) ## 2019 Edition COUNTY 2022 Edition"},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"extended-projections-and-high-growth-scenario","dir":"Articles","previous_headings":"Projection Methods","what":"Extended Projections and High Growth Scenario","title":"Population Projection Methodology","text":"Moderate scenario extension RFA projections. extended Moderate scenario water-demand projections, average annual growth county set minimum 0. RFA projections extended county growth year. High scenario applies AGR values calculated , starting earliest year RFA population projection.","code":"### First create the high growth scenario along the RFA projections, pop_hi <- pop3 |> dplyr::mutate(Population = Growth_hi^(Year-T_0) * Pop_0) |> dplyr::group_by(Edition, County, Type) |> dplyr::mutate(Pop_1 = Population[Year==T_1], Type2 = 'Extrapolated Projection') pop4 <- dplyr::bind_rows(Moderate=pop3, High=pop_hi, .id='Scenario') ## then extend all scenarios. pop_ex <- pop4 |> dplyr::select(-Year, -Population) |> unique() |> dplyr::group_by(dplyr::across(dplyr::everything())) |> dplyr::group_modify( .f = function(.x, .y) tibble::tibble(Year = (.y$T_1+1):2070)) |> dplyr::ungroup() |> dplyr::mutate( Population = dplyr::recode( Scenario, Moderate=Growth_moderate*(Year-T_1) + Pop_1, ## y = mx + b High=Growth_hi^(Year-T_1) * Pop_1), Type2='Extrapolated Projection') ## y = m^x * b ## Combine, then remove redundant Estimate entries. pop5 <- dplyr::bind_rows( Original=pop4, Extended=pop_ex, .id='Period') |> dplyr::filter( !(Type=='Estimate' & (Scenario=='High' | Period=='Extended'))) ## Organizing the data like this seems to work better. pop6 <- pop5 |> dplyr::mutate(Type = dplyr::if_else(!is.na(Type2), Type2, Type)) |> dplyr::mutate(Type2 = dplyr::if_else( Type == 'Estimate', \"Estimate\", dplyr::if_else( Type == 'SC RFA Projection' & Edition == '2019', '2019 RFA Projection', dplyr::if_else( Type == 'SC RFA Projection' & Edition == '2022', '2022 RFA Projection', dplyr::if_else( Scenario == 'High' & Edition == '2019', '2019 High Extrapolation', dplyr::if_else( Scenario == 'High' & Edition == '2022', '2022 High Extrapolation', dplyr::if_else( Scenario == 'Moderate' & Edition == '2019', '2019 Moderate Extrapolation', dplyr::if_else( Scenario == 'Moderate' & Edition == '2022', '2022 Moderate Extrapolation', 'NA') )))))), Scenario = dplyr::if_else(Type=='Estimate', 'Estimate', Scenario)) pop_proj <- pop6 usethis::use_data(pop_proj, overwrite=T)"},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"relative-growth-projections","dir":"Articles","previous_headings":"Projection Methods","what":"Relative Growth Projections","title":"Population Projection Methodology","text":"translate county population projections drinking water distributors, population projections converted relative growth. done simply dividing projected populations scenario, county, year 2021 population county.","code":"## Since the water suppliers don't have the same population as the counties ## I need to calculate the relative changes in population at the county scale ## so that can be applied to the populations of the water suppliers. pop_proj_relative <- pop_proj |> dplyr::filter(Year %in% c(2021:2070) & Edition == '2022') |> dplyr::select(Scenario, County, Year, Population) |> tidyr::spread('Scenario', 'Population') |> dplyr::group_by(County) |> dplyr::mutate(Driver_growth_mod = Moderate / Moderate[which.min(Year)], Driver_growth_hi = High / High[which.min(Year)]) |> dplyr::ungroup() usethis::use_data(pop_proj_relative, overwrite=TRUE)"},{"path":"https://capellett.github.io/scpopulation/articles/results.html","id":"county-level-growth","dir":"Articles","previous_headings":"","what":"County-level growth","title":"Population Projection Results","text":"","code":"## this is basically an R-shiny app. ## A graph that cycles through counties. ## a map that shows county projections on hover. ## Show animated cohort-component plots. ## Provide searchable tables for download. unique(pop_proj$Period) unique(pop_proj$Scenario) unique(pop_proj$Type) unique(pop_proj$Type2) unique(pop_proj$County) pop_proj |> dplyr::filter(Period == 'Original' & Edition == '2022' & County == 'SOUTH CAROLINA' & Type2 %in% c('Estimate', '2022 RFA Projection')) |> dplyr::select(Year, Population) |> write.csv(file='RFA 2022 Vintage Statewide Population Projections.csv') unique(pop_proj$Edition) pop_proj_x <- pop_proj |> dplyr::filter(Edition == '2022') unique(pop_proj_x$Scenario) unique(pop_proj_x$Type) unique(pop_proj_x$Type2) unique(pop_proj_x$Period) pop_proj_x |> dplyr::filter(Scenario == 'Estimate') |> dplyr::select(County, Year, Population) |> tidyr::pivot_wider(names_from=Year, values_from=Population) |> readr::write_excel_csv('export//Population_historic.csv') pop_proj_x |> dplyr::filter(Scenario == 'Moderate') |> dplyr::select(County, Year, Population) |> tidyr::pivot_wider(names_from=Year, values_from=Population) |> readr::write_excel_csv('export//Population_moderate.csv') pop_proj_x |> dplyr::filter(Scenario == 'High') |> dplyr::select(County, Year, Population) |> tidyr::pivot_wider(names_from=Year, values_from=Population) |> readr::write_excel_csv('export//Population_high.csv')"},{"path":"https://capellett.github.io/scpopulation/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"C Pellett. Author, maintainer. Laljeet Sangha. Contributor. State South Carolina Department Environmental Services. Funder. State South Carolina Department Natural Resources. Funder.","code":""},{"path":"https://capellett.github.io/scpopulation/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Pellett C (2024). scpopulation: Population Data Projections South Carolina Counties. R package version 0.0.0.9000, https://capellett.github.io/scpopulation/, https://github.com/capellett/scpopulation.","code":"@Manual{, title = {scpopulation: Population Data and Projections for South Carolina Counties}, author = {C A Pellett}, year = {2024}, note = {R package version 0.0.0.9000, https://capellett.github.io/scpopulation/}, url = {https://github.com/capellett/scpopulation}, }"},{"path":[]},{"path":"https://capellett.github.io/scpopulation/index.html","id":"an-r-package-containing-population-projections-for-the-state-of-south-carolina","dir":"","previous_headings":"","what":"An R-package containing population projections for the state of South Carolina.","title":"Population Data and Projections for South Carolina Counties","text":"scpopulation open-source R-package published repository GitHub. package stores county level population data projections South Carolina Office Revenue Fiscal Affairs (SC RFA), extended 2070 additional high growth scenario. population projection scenarios presented used water availability planning SC. website documents scpopulation R-package provides access data general public without requiring use R software. package developed Dr. Charles Alex Pellett, working South Carolina Department Natural Resources (SC DNR) subsequently South Carolina Department Environmental Services (SC DES). information intended research long-term water planning. None guarantees accuracy, reliability, completeness information. SC RFA, SC DNR, SC DES, Dr. Pellett liable loss damage arising use information. information SC RFA projections available website: https://rfa.sc.gov/data-research/population-demographics/census-state-data-center/estimates-projections-dashboard/estimates-projections-data-downloads information South Carolina Water Plan available SC DES website: https://www.des.sc.gov/programs/bureau-water/hydrology/water-planning/water-planning-overview Methods section document includes metadata SC RFA detailed description calculations extended projections High scenario. Results section includes graphical tabular results counties.","code":""},{"path":"https://capellett.github.io/scpopulation/index.html","id":"use-in-r","dir":"","previous_headings":"","what":"Use in R","title":"Population Data and Projections for South Carolina Counties","text":"R-package, scpopulation can installed R terminal following code:","code":"# install.packages('devtools') devtools::install_github('https://github.com/capellett/scpopulation')"},{"path":"https://capellett.github.io/scpopulation/reference/calculate_growth_scenarios.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Population Growth Scenarios — calculate_growth_scenarios","title":"Calculate Population Growth Scenarios — calculate_growth_scenarios","text":"Calculate Population Growth Scenarios","code":""},{"path":"https://capellett.github.io/scpopulation/reference/calculate_growth_scenarios.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Population Growth Scenarios — calculate_growth_scenarios","text":"","code":"calculate_growth_scenarios(pop_data)"},{"path":"https://capellett.github.io/scpopulation/reference/calculate_growth_scenarios.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Population Growth Scenarios — calculate_growth_scenarios","text":"pop_data Input population data","code":""},{"path":"https://capellett.github.io/scpopulation/reference/county_population_projection_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create County Population Projection Plot — county_population_projection_plot","title":"Create County Population Projection Plot — county_population_projection_plot","text":"Create County Population Projection Plot","code":""},{"path":"https://capellett.github.io/scpopulation/reference/county_population_projection_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create County Population Projection Plot — county_population_projection_plot","text":"","code":"county_population_projection_plot(df)"},{"path":"https://capellett.github.io/scpopulation/reference/county_population_projection_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create County Population Projection Plot — county_population_projection_plot","text":"df Data frame containing projection data","code":""},{"path":"https://capellett.github.io/scpopulation/reference/format_pop_editions.html","id":null,"dir":"Reference","previous_headings":"","what":"Example — format_pop_editions","title":"Example — format_pop_editions","text":"Example","code":""},{"path":"https://capellett.github.io/scpopulation/reference/format_pop_editions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example — format_pop_editions","text":"","code":"format_pop_editions(pop)"},{"path":"https://capellett.github.io/scpopulation/reference/plot_editions_simple.html","id":null,"dir":"Reference","previous_headings":"","what":"Simple plot to compare the different editions. — plot_editions_simple","title":"Simple plot to compare the different editions. — plot_editions_simple","text":"Simple plot compare different editions.","code":""},{"path":"https://capellett.github.io/scpopulation/reference/plot_editions_simple.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simple plot to compare the different editions. — plot_editions_simple","text":"","code":"plot_editions_simple(pop)"},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":null,"dir":"Reference","previous_headings":"","what":"pop19 — pop19","title":"pop19 — pop19","text":"Estimate projection totals","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop19 — pop19","text":"","code":"pop19"},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop19 — pop19","text":"data frame columns including FIPS, County, Year, Type(Total), Population. FIPS FIPS code county County Name county Year Year Projection (2000-2035) Type Estimate Projection Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop19 — pop19","text":"","code":"data(pop19) head(pop19) #> # A tibble: 6 × 5 #> FIPS County Year Type Population #> #> 1 45001 Abbeville 2000 Estimate 26229 #> 2 45001 Abbeville 2001 Estimate 26330 #> 3 45001 Abbeville 2002 Estimate 26311 #> 4 45001 Abbeville 2003 Estimate 26306 #> 5 45001 Abbeville 2004 Estimate 26235 #> 6 45001 Abbeville 2005 Estimate 25995"},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":null,"dir":"Reference","previous_headings":"","what":"Population Data from 2019 Edition — pop19_gender","title":"Population Data from 2019 Edition — pop19_gender","text":"Population Data 2019 Edition Tidy Format Raw Data (Nov 2019 Data)","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Population Data from 2019 Edition — pop19_gender","text":"","code":"pop19_gender pop19_gender"},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Population Data from 2019 Edition — pop19_gender","text":"data frame columns: FIPS FIPS code County County name Year Year Type Estimate Projection Gender Total, Male, Female Population Population count tidy data frame reshaped long form creating new columns Year, Type (Estimate Projection), Gender (Total, Male, Female), Population. FIPS FIPS code county County Name county Year Year Projection/Estimate (2000-2035) Type Estimate Projection Gender Male , Female Total Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Population Data from 2019 Edition — pop19_gender","text":"","code":"data(pop19_gender) head(pop19_gender) #> # A tibble: 6 × 6 #> FIPS County Year Type Gender Population #> #> 1 45001 Abbeville 2000 Estimate Total 26229 #> 2 45001 Abbeville 2001 Estimate Total 26330 #> 3 45001 Abbeville 2002 Estimate Total 26311 #> 4 45001 Abbeville 2003 Estimate Total 26306 #> 5 45001 Abbeville 2004 Estimate Total 26235 #> 6 45001 Abbeville 2005 Estimate Total 25995"},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":null,"dir":"Reference","previous_headings":"","what":"pop22 — pop22","title":"pop22 — pop22","text":"Estimate projection totals","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop22 — pop22","text":"","code":"pop22"},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop22 — pop22","text":"data frame columns including FIPS, County, Year, Type(Total), Population. FIPS FIPS code county County Name county Year Year Projection (2000-2038) Type Estimate Projection Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop22 — pop22","text":"","code":"data(pop22) head(pop22) #> # A tibble: 6 × 5 #> FIPS County Year Type Population #> #> 1 1 ABBEVILLE 2010 Estimate 25338 #> 2 1 ABBEVILLE 2011 Estimate 25093 #> 3 1 ABBEVILLE 2012 Estimate 25033 #> 4 1 ABBEVILLE 2013 Estimate 24912 #> 5 1 ABBEVILLE 2014 Estimate 24811 #> 6 1 ABBEVILLE 2015 Estimate 24814"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":null,"dir":"Reference","previous_headings":"","what":"pop22_cohort — pop22_cohort","title":"pop22_cohort — pop22_cohort","text":"transformed summarized population data, distinguishing Estimate Projections, reformatted clarity, adding state-wide summary.","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop22_cohort — pop22_cohort","text":"","code":"pop22_cohort"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop22_cohort — pop22_cohort","text":"Data frame including FIPS, County, Year, Type, Gender Population. AGE GROUP Age Group Population, \"0 4\" \"5 9\" \"10 14\" \"15 19\" \"20 24\" \"25 29\" \"30 34\" \"35 39\" \"40 44\" \"45 49\" \"50 54\" \"55 59\" \"60 54\" \"65 69\" \"70 74\" \"75 79\" \"80 84\" \"85+\" FIPS FIPS code county County Name county Year Year Projection/Estimate (2010-2038) Type Estimate Projection Gender Male , Female Total Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop22_cohort — pop22_cohort","text":"","code":"data(pop22_cohort) head(pop22_cohort) #> # A tibble: 6 × 7 #> `AGE GROUP` County FIPS Gender Year Population Type #> #> 1 0 TO 4 ABBEVILLE 1 Total 2010 1503 Estimate #> 2 0 TO 4 ABBEVILLE 1 Female 2010 719 Estimate #> 3 0 TO 4 ABBEVILLE 1 Male 2010 784 Estimate #> 4 0 TO 4 ABBEVILLE 1 Total 2011 1436 Estimate #> 5 0 TO 4 ABBEVILLE 1 Female 2011 702 Estimate #> 6 0 TO 4 ABBEVILLE 1 Male 2011 734 Estimate"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":null,"dir":"Reference","previous_headings":"","what":"pop22_gender — pop22_gender","title":"pop22_gender — pop22_gender","text":"Tidy Format (Nov 2022 Data)","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop22_gender — pop22_gender","text":"","code":"pop22_gender"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop22_gender — pop22_gender","text":"tidy data frame reshaped long form creating new columns Year, Type (Estimate Projection), Gender (Total, Male, Female), Population. FIPS FIPS code county County Name county Year Year Projection/Estimate (2010-2038) Type Estimate Projection Gender Male , Female Total Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop22_gender — pop22_gender","text":"","code":"data(pop22_gender ) head(pop22_gender ) #> # A tibble: 6 × 6 #> FIPS County Year Type Gender Population #> #> 1 1 ABBEVILLE 2010 Estimate Female 13055 #> 2 1 ABBEVILLE 2010 Estimate Male 12283 #> 3 1 ABBEVILLE 2010 Estimate Total 25338 #> 4 1 ABBEVILLE 2011 Estimate Female 12919 #> 5 1 ABBEVILLE 2011 Estimate Male 12174 #> 6 1 ABBEVILLE 2011 Estimate Total 25093"},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":null,"dir":"Reference","previous_headings":"","what":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"dataset provides relative growth projections different counties moderate high growth scenarios. includes calculations growth rates driver growth factors scenario.","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"","code":"pop_proj_relative"},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"dataset data frame following columns: County Name county Year Year Projection (2000-2038) High Population high growth scenario Moderate Population moderate growth scenario Driver_growth_mod Relative growth population moderate growth scenario Driver_growth_hi Relative growth population high growth scenario formulas used dataset follows: Moderate Growth Scenario (Moderate): $$Growth\\_{moderate} = \\max(Growth\\_{linear}, 0)$$ , \\(Growth\\_{linear}\\) represents average annual increase population. High Growth Scenario (High): $$Growth\\_{hi} = Growth\\_{exp\\_floor} \\times 1.10$$ \\(Growth\\_{exp}\\) exponential growth rate. \\(Growth\\_{exp\\_floor}\\) set least state average growth rate. Driver Growth Factors: $$Driver\\_{growth\\_mod} = \\frac{Moderate Population\\ \\ Year\\ X}{Moderate Population\\ \\ 2021}$$ $$Driver\\_{growth\\_hi} = \\frac{High Population\\ \\ Year\\ X}{High Population\\ \\ 2021}$$","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"","code":"data(pop_proj_relative) head(pop_proj_relative) #> # A tibble: 6 × 6 #> County Year High Moderate Driver_growth_mod Driver_growth_hi #> #> 1 ABBEVILLE 2021 24071. 24071. 1 1 #> 2 ABBEVILLE 2022 24291. 23930. 0.994 1.01 #> 3 ABBEVILLE 2023 24513. 23789. 0.988 1.02 #> 4 ABBEVILLE 2024 24738. 23648. 0.982 1.03 #> 5 ABBEVILLE 2025 24964. 23507. 0.977 1.04 #> 6 ABBEVILLE 2026 25192. 23345. 0.970 1.05"},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Population Pyramid Plot — pyramid_plot","title":"Create Population Pyramid Plot — pyramid_plot","text":"Create Population Pyramid Plot","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Population Pyramid Plot — pyramid_plot","text":"","code":"pyramid_plot(df)"},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Population Pyramid Plot — pyramid_plot","text":"df Data frame containing population data","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create Population Pyramid Plot — pyramid_plot","text":"See https://rfortherestofus.com/2024/07/population-pyramid-part-1 inspiration.","code":""}]
+[{"path":"https://capellett.github.io/scpopulation/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 C Pellett Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"projection-methods","dir":"Articles","previous_headings":"","what":"Projection Methods","title":"Population Projection Methodology","text":"SC Office Revenue Fiscal Affairs (RFA) publishes population projections county state. RFA population projections stratified gender cohort. projections developed using cohort-component method: rates birth, death, migration calculated gender-cohort county; calculated rates applied county populations project future populations year year. One assumption underlying method relevant demographic rates calculated calibration period remain uniform across projection period.","code":""},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"metadata","dir":"Articles","previous_headings":"Projection Methods","what":"2019 Metadata","title":"Population Projection Methodology","text":"“Population estimates 2000 2018 calculated using Bridged-race Intercensal Population Estimates July 1, 2000 -July 1, 2009 Vintage 2018 Bridged-Race Postcensal Estimates July 1, 2010 -July 1, 2018. estimates produced Population Estimates Program U.S. Census Bureau collaboration National Center Health Statistics. Estimates 2000 2018 previous future releases postcensal estimates vary slightly 2000 2018 data table. years, population estimated July 1st year. Estimates 2000 2010 equivalent April 1st decennial census count Census 2000 Census 2010.” “Population Projections 2019 2035 calculated S.C. Revenue Fiscal Affairs Health Demographics Section. Births deaths data used population projections calculations supplied SC DHEC Division Biostatistics. “Note: projections included report calculated using cohort-component model demographic change. model uses base population beginning date, applies assumed survival rates, fertility rates, net migration calculate population projections. “projections intended forecast; rather, intended demonstrate likely scenario future events unfold manner reflects previous trends observed within group. model account unprecedented events may significantly alter area’s demographic composition future. possible events include large factory openings closings, changes technology, public health crises, environmental events, changes economy, conditions affect birth rates, death rates, domestic international migration. means population projections likely accurate immediate future distant years future.”","code":""},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"metadata-1","dir":"Articles","previous_headings":"Projection Methods","what":"2022 Metadata","title":"Population Projection Methodology","text":"“Sources: Vintage 2020 Postcensal Estimates July 1, 2010 -July 1, 2019. Vintage 2021 Postcensal Estimates July 1, 2020. estimates produced Population Estimates Program U.S. Census Bureau. Estimates 2010 2020 previous future releases postcensal estimates vary slightly 2010 2020 data table. years, population estimated July 1st year. Estimates 2020 equivalent April 1st decennial census count Census 2020. “Population Projections 2021 20230 calculated S.C. Revenue Fiscal Affairs Data Integration Analysis Division. Births deaths data used population projections calculations supplied SC DHEC Division Biostatistics. “Note: projections included report calculated using cohort-component model demographic change. model uses base population distributed age sex beginning date, applies assumed survival rates, age-specific fertility rates, net migration age sex calculate population projections. “projections offer one possible scenario future population change using current data available. overall accuracy projections depends extent future events unfold manner reflects previous trends observed within group. model account unprecedented events may significantly alter area’s demographic composition future. possible events include large factory openings closings, changes technology, public health crises, environmental events, changes economy, conditions affect birth rates, death rates, domestic international migration. means population projections likely accurate immediate future distant years future.”","code":"## Everything I do here will be done with both editions of the population projections. ## that way the changes across editions can be compared. load(\"../data/pop19.rda\") load(\"../data/pop22.rda\") ## As more editions come out, keep appending them here. pop1 <- dplyr::bind_rows( `2019`=dplyr::select(pop19, -FIPS), `2022`=dplyr::select(pop22, -FIPS), ## `2025` = pop25, ## for example. .id='Edition') |> dplyr::mutate(County = stringr::str_to_upper(County), Type = dplyr::recode(Type, Projection='SC RFA Projection')) rm(pop19, pop22)"},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"growth-and-growth-rate","dir":"Articles","previous_headings":"Projection Methods","what":"Growth and Growth Rate","title":"Population Projection Methodology","text":"Two parameters calculated RFA population projections: average annual change population, ΔPop\\Delta Pop, average annual growth rate, AGRAGR. Population growth expressed number people per year (linear growth), population growth rate expressed percentage (exponential growth). PopPop County population. TT Time (Year projection) subscripts 0 1 represent first last years RFA projection. n=T1−T0n = T_1 - T_0 edition RFA projections, nn number years ΔPop=(Pop1−Pop0)/n\\Delta Pop = ( Pop_1 - Pop_0 ) / n average annual population growth county calculated taking difference first last years projected populations, dividing number years (n). ${AGR} = \\sqrt[n]{ \\frac{Pop_1}{{Pop_0}}$ average annual growth rate (AGR) calculated dividing projected populations last year projected populations first year finding nth root. akin calculating annually compounding interest rate, results decimal can expressed percentage. state average AGR 1.19% 2019 vintage, 0.83% 2022 vintage RFA projections. AGR values high projection scenario calculated two steps. First, county AGRs lower state average raised equal state average RFA projection. , county AGRs increased 10%. example, minimum county population growth rate High scenario vintage 2019 1.31% (1.19% * 1.1 = 1.31%). following table summarizes annual growth (ΔPop\\Delta Pop) annual growth rates (AGRAGR)county, edition RFA projections.","code":"## I'm gonna go ahead and calculate the linear and exponential growth rates ## for the Estimated data across the baseline as well as the RFA projections. ## Each set of Edition, County, and Type is considered an independent timeseries ## Time 0 is the first year of that series, and Time 1 is the last year of the series. pop2 <- pop1 |> dplyr::group_by(Edition, County, Type) |> dplyr::mutate( T_0 = min(Year), T_1 = max(Year), Pop_0 = Population[which(Year==T_0)], Pop_1 = Population[which(Year==T_1)], Growth_linear = (Pop_1 - Pop_0)/(T_1-T_0), Growth_exp = (Pop_1/Pop_0)^(1/(T_1-T_0)), Growth_moderate = pmax(Growth_linear, 0)) |> dplyr::ungroup() hi_growth_floor <- pop2 |> dplyr::filter(County %in% c('South Carolina', 'SOUTH CAROLINA')) |> dplyr::distinct(Edition, Type, Growth_exp) |> dplyr::rename(Growth_exp_floor=Growth_exp) pop3 <- pop2 |> dplyr::left_join(hi_growth_floor, c(\"Edition\", \"Type\")) |> dplyr::mutate(Growth_hi = ((pmax(Growth_exp, Growth_exp_floor)-1)*1.1)+1) pop_rates <- pop3 |> dplyr::distinct(Edition, County, Type, T_0, T_1, Pop_0, Pop_1, Growth_moderate, Growth_hi) pop_rates ## # A tibble: 188 × 9 ## Edition County Type T_0 T_1 Pop_0 Pop_1 Growth_moderate Growth_hi ## ## 1 2019 ABBEVILLE Estima… 2000 2018 26229 24541 0 1.01 ## 2 2019 ABBEVILLE SC RFA… 2019 2035 24410 22195 0 1.01 ## 3 2019 AIKEN Estima… 2000 2018 142742 169401 1481. 1.01 ## 4 2019 AIKEN SC RFA… 2019 2035 170345 180550 638. 1.01 ## 5 2019 ALLENDALE Estima… 2000 2018 11193 8903 0 1.01 ## 6 2019 ALLENDALE SC RFA… 2019 2035 8725 6160 0 1.01 ## 7 2019 ANDERSON Estima… 2000 2018 166304 200482 1899. 1.01 ## 8 2019 ANDERSON SC RFA… 2019 2035 202520 234420 1994. 1.01 ## 9 2019 BAMBERG Estima… 2000 2018 16680 14275 0 1.01 ## 10 2019 BAMBERG SC RFA… 2019 2035 14030 10425 0 1.01 ## # ℹ 178 more rows summary0 <- pop3 |> # pop_proj |> dplyr::filter(Type == 'SC RFA Projection') |> dplyr::mutate( dplyr::across( c(Pop_0, Pop_1, Growth_linear, Growth_moderate), as.integer), dplyr::across( c(Growth_exp, Growth_hi), function(x) {round((x-1)*100, 2)}), Edition = paste0(Edition, ' Edition. (', T_0, '-', T_1, '). n = ', T_1-T_0)) |> dplyr::select(County, Edition, Pop_0, Pop_1, `RFA $\\\\Delta Pop$`= Growth_linear, `Mod. $\\\\Delta Pop$`= Growth_moderate, `RFA AGR` = Growth_exp, `High AGR` = Growth_hi) |> unique() summary1 <- summary0 |> tidyr::pivot_wider( names_from = Edition, id_cols=County, values_from = 3:8) ## 2019 Edition COUNTY 2022 Edition"},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"extended-projections-and-high-growth-scenario","dir":"Articles","previous_headings":"Projection Methods","what":"Extended Projections and High Growth Scenario","title":"Population Projection Methodology","text":"Moderate scenario extension RFA projections. extended Moderate scenario water-demand projections, average annual growth county set minimum 0. RFA projections extended county growth year. High scenario applies AGR values calculated , starting earliest year RFA population projection.","code":"### First create the high growth scenario along the RFA projections, pop_hi <- pop3 |> dplyr::mutate(Population = Growth_hi^(Year-T_0) * Pop_0) |> dplyr::group_by(Edition, County, Type) |> dplyr::mutate(Pop_1 = Population[Year==T_1], Type2 = 'Extrapolated Projection') pop4 <- dplyr::bind_rows(Moderate=pop3, High=pop_hi, .id='Scenario') ## then extend all scenarios. pop_ex <- pop4 |> dplyr::select(-Year, -Population) |> unique() |> dplyr::group_by(dplyr::across(dplyr::everything())) |> dplyr::group_modify( .f = function(.x, .y) tibble::tibble(Year = (.y$T_1+1):2070)) |> dplyr::ungroup() |> dplyr::mutate( Population = dplyr::recode( Scenario, Moderate=Growth_moderate*(Year-T_1) + Pop_1, ## y = mx + b High=Growth_hi^(Year-T_1) * Pop_1), Type2='Extrapolated Projection') ## y = m^x * b ## Combine, then remove redundant Estimate entries. pop5 <- dplyr::bind_rows( Original=pop4, Extended=pop_ex, .id='Period') |> dplyr::filter( !(Type=='Estimate' & (Scenario=='High' | Period=='Extended'))) ## Organizing the data like this seems to work better. pop6 <- pop5 |> dplyr::mutate(Type = dplyr::if_else(!is.na(Type2), Type2, Type)) |> dplyr::mutate(Type2 = dplyr::if_else( Type == 'Estimate', \"Estimate\", dplyr::if_else( Type == 'SC RFA Projection' & Edition == '2019', '2019 RFA Projection', dplyr::if_else( Type == 'SC RFA Projection' & Edition == '2022', '2022 RFA Projection', dplyr::if_else( Scenario == 'High' & Edition == '2019', '2019 High Extrapolation', dplyr::if_else( Scenario == 'High' & Edition == '2022', '2022 High Extrapolation', dplyr::if_else( Scenario == 'Moderate' & Edition == '2019', '2019 Moderate Extrapolation', dplyr::if_else( Scenario == 'Moderate' & Edition == '2022', '2022 Moderate Extrapolation', 'NA') )))))), Scenario = dplyr::if_else(Type=='Estimate', 'Estimate', Scenario)) pop_proj <- pop6 usethis::use_data(pop_proj, overwrite=T)"},{"path":"https://capellett.github.io/scpopulation/articles/methods.html","id":"relative-growth-projections","dir":"Articles","previous_headings":"Projection Methods","what":"Relative Growth Projections","title":"Population Projection Methodology","text":"translate county population projections drinking water distributors, population projections converted relative growth. done simply dividing projected populations scenario, county, year 2021 population county.","code":"## Since the water suppliers don't have the same population as the counties ## I need to calculate the relative changes in population at the county scale ## so that can be applied to the populations of the water suppliers. pop_proj_relative <- pop_proj |> dplyr::filter(Year %in% c(2021:2070) & Edition == '2022') |> dplyr::select(Scenario, County, Year, Population) |> tidyr::spread('Scenario', 'Population') |> dplyr::group_by(County) |> dplyr::mutate(Driver_growth_mod = Moderate / Moderate[which.min(Year)], Driver_growth_hi = High / High[which.min(Year)]) |> dplyr::ungroup() usethis::use_data(pop_proj_relative, overwrite=TRUE)"},{"path":"https://capellett.github.io/scpopulation/articles/results.html","id":"county-level-growth","dir":"Articles","previous_headings":"","what":"County-level growth","title":"Population Projection Results","text":"","code":"## this is basically an R-shiny app. ## A graph that cycles through counties. ## a map that shows county projections on hover. ## Show animated cohort-component plots. ## Provide searchable tables for download. unique(pop_proj$Period) unique(pop_proj$Scenario) unique(pop_proj$Type) unique(pop_proj$Type2) unique(pop_proj$County) pop_proj |> dplyr::filter(Period == 'Original' & Edition == '2022' & County == 'SOUTH CAROLINA' & Type2 %in% c('Estimate', '2022 RFA Projection')) |> dplyr::select(Year, Population) |> write.csv(file='RFA 2022 Vintage Statewide Population Projections.csv') unique(pop_proj$Edition) pop_proj_x <- pop_proj |> dplyr::filter(Edition == '2022') unique(pop_proj_x$Scenario) unique(pop_proj_x$Type) unique(pop_proj_x$Type2) unique(pop_proj_x$Period) pop_proj_x |> dplyr::filter(Scenario == 'Estimate') |> dplyr::select(County, Year, Population) |> tidyr::pivot_wider(names_from=Year, values_from=Population) |> readr::write_excel_csv('export//Population_historic.csv') pop_proj_x |> dplyr::filter(Scenario == 'Moderate') |> dplyr::select(County, Year, Population) |> tidyr::pivot_wider(names_from=Year, values_from=Population) |> readr::write_excel_csv('export//Population_moderate.csv') pop_proj_x |> dplyr::filter(Scenario == 'High') |> dplyr::select(County, Year, Population) |> tidyr::pivot_wider(names_from=Year, values_from=Population) |> readr::write_excel_csv('export//Population_high.csv')"},{"path":"https://capellett.github.io/scpopulation/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"C Pellett. Author, maintainer. Laljeet Sangha. Contributor. State South Carolina Department Environmental Services. Funder. State South Carolina Department Natural Resources. Funder.","code":""},{"path":"https://capellett.github.io/scpopulation/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Pellett C (2024). scpopulation: Population Data Projections South Carolina Counties. R package version 0.0.0.9000, https://capellett.github.io/scpopulation/, https://github.com/capellett/scpopulation.","code":"@Manual{, title = {scpopulation: Population Data and Projections for South Carolina Counties}, author = {C A Pellett}, year = {2024}, note = {R package version 0.0.0.9000, https://capellett.github.io/scpopulation/}, url = {https://github.com/capellett/scpopulation}, }"},{"path":[]},{"path":"https://capellett.github.io/scpopulation/index.html","id":"an-r-package-containing-population-projections-for-the-state-of-south-carolina","dir":"","previous_headings":"","what":"An R-package containing population projections for the state of South Carolina.","title":"Population Data and Projections for South Carolina Counties","text":"scpopulation open-source R-package published repository GitHub. package stores county level population data projections South Carolina Office Revenue Fiscal Affairs (SC RFA), extended 2070 additional high growth scenario. population projection scenarios presented used water availability planning SC. website documents scpopulation R-package provides access data general public without requiring use R software. package developed Dr. Charles Alex Pellett, working South Carolina Department Natural Resources (SC DNR) subsequently South Carolina Department Environmental Services (SC DES). information intended research long-term water planning. None guarantees accuracy, reliability, completeness information. SC RFA, SC DNR, SC DES, Dr. Pellett liable loss damage arising use information. information SC RFA projections available website: https://rfa.sc.gov/data-research/population-demographics/census-state-data-center/estimates-projections-dashboard/estimates-projections-data-downloads information South Carolina Water Plan available SC DES website: https://www.des.sc.gov/programs/bureau-water/hydrology/water-planning/water-planning-overview Introduction article provides overview county population projection data shows example graphs. Methods article includes metadata SC RFA detailed description calculations extended projections High scenario. Results article (Work Progress) includes graphical tabular results counties.","code":""},{"path":"https://capellett.github.io/scpopulation/index.html","id":"use-in-r","dir":"","previous_headings":"","what":"Use in R","title":"Population Data and Projections for South Carolina Counties","text":"R-package, scpopulation can installed R terminal following code:","code":"# install.packages('devtools') devtools::install_github('https://github.com/capellett/scpopulation')"},{"path":"https://capellett.github.io/scpopulation/reference/calculate_growth_scenarios.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Population Growth Scenarios — calculate_growth_scenarios","title":"Calculate Population Growth Scenarios — calculate_growth_scenarios","text":"Calculate Population Growth Scenarios","code":""},{"path":"https://capellett.github.io/scpopulation/reference/calculate_growth_scenarios.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Population Growth Scenarios — calculate_growth_scenarios","text":"","code":"calculate_growth_scenarios(pop_data)"},{"path":"https://capellett.github.io/scpopulation/reference/calculate_growth_scenarios.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Population Growth Scenarios — calculate_growth_scenarios","text":"pop_data Input population data","code":""},{"path":"https://capellett.github.io/scpopulation/reference/county_population_projection_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create County Population Projection Plot — county_population_projection_plot","title":"Create County Population Projection Plot — county_population_projection_plot","text":"Create County Population Projection Plot","code":""},{"path":"https://capellett.github.io/scpopulation/reference/county_population_projection_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create County Population Projection Plot — county_population_projection_plot","text":"","code":"county_population_projection_plot(df)"},{"path":"https://capellett.github.io/scpopulation/reference/county_population_projection_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create County Population Projection Plot — county_population_projection_plot","text":"df Data frame containing projection data","code":""},{"path":"https://capellett.github.io/scpopulation/reference/format_pop_editions.html","id":null,"dir":"Reference","previous_headings":"","what":"Example — format_pop_editions","title":"Example — format_pop_editions","text":"Example","code":""},{"path":"https://capellett.github.io/scpopulation/reference/format_pop_editions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example — format_pop_editions","text":"","code":"format_pop_editions(pop)"},{"path":"https://capellett.github.io/scpopulation/reference/plot_editions_simple.html","id":null,"dir":"Reference","previous_headings":"","what":"Simple plot to compare the different editions. — plot_editions_simple","title":"Simple plot to compare the different editions. — plot_editions_simple","text":"Simple plot compare different editions.","code":""},{"path":"https://capellett.github.io/scpopulation/reference/plot_editions_simple.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simple plot to compare the different editions. — plot_editions_simple","text":"","code":"plot_editions_simple(pop)"},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":null,"dir":"Reference","previous_headings":"","what":"pop19 — pop19","title":"pop19 — pop19","text":"Estimate projection totals","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop19 — pop19","text":"","code":"pop19"},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop19 — pop19","text":"data frame columns including FIPS, County, Year, Type(Total), Population. FIPS FIPS code county County Name county Year Year Projection (2000-2035) Type Estimate Projection Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop19 — pop19","text":"","code":"data(pop19) head(pop19) #> # A tibble: 6 × 5 #> FIPS County Year Type Population #> #> 1 45001 Abbeville 2000 Estimate 26229 #> 2 45001 Abbeville 2001 Estimate 26330 #> 3 45001 Abbeville 2002 Estimate 26311 #> 4 45001 Abbeville 2003 Estimate 26306 #> 5 45001 Abbeville 2004 Estimate 26235 #> 6 45001 Abbeville 2005 Estimate 25995"},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":null,"dir":"Reference","previous_headings":"","what":"Population Data from 2019 Edition — pop19_gender","title":"Population Data from 2019 Edition — pop19_gender","text":"Population Data 2019 Edition Tidy Format Raw Data (Nov 2019 Data)","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Population Data from 2019 Edition — pop19_gender","text":"","code":"pop19_gender pop19_gender"},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Population Data from 2019 Edition — pop19_gender","text":"data frame columns: FIPS FIPS code County County name Year Year Type Estimate Projection Gender Total, Male, Female Population Population count tidy data frame reshaped long form creating new columns Year, Type (Estimate Projection), Gender (Total, Male, Female), Population. FIPS FIPS code county County Name county Year Year Projection/Estimate (2000-2035) Type Estimate Projection Gender Male , Female Total Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop19_gender.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Population Data from 2019 Edition — pop19_gender","text":"","code":"data(pop19_gender) head(pop19_gender) #> # A tibble: 6 × 6 #> FIPS County Year Type Gender Population #> #> 1 45001 Abbeville 2000 Estimate Total 26229 #> 2 45001 Abbeville 2001 Estimate Total 26330 #> 3 45001 Abbeville 2002 Estimate Total 26311 #> 4 45001 Abbeville 2003 Estimate Total 26306 #> 5 45001 Abbeville 2004 Estimate Total 26235 #> 6 45001 Abbeville 2005 Estimate Total 25995"},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":null,"dir":"Reference","previous_headings":"","what":"pop22 — pop22","title":"pop22 — pop22","text":"Estimate projection totals","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop22 — pop22","text":"","code":"pop22"},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop22 — pop22","text":"data frame columns including FIPS, County, Year, Type(Total), Population. FIPS FIPS code county County Name county Year Year Projection (2000-2038) Type Estimate Projection Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop22 — pop22","text":"","code":"data(pop22) head(pop22) #> # A tibble: 6 × 5 #> FIPS County Year Type Population #> #> 1 1 ABBEVILLE 2010 Estimate 25338 #> 2 1 ABBEVILLE 2011 Estimate 25093 #> 3 1 ABBEVILLE 2012 Estimate 25033 #> 4 1 ABBEVILLE 2013 Estimate 24912 #> 5 1 ABBEVILLE 2014 Estimate 24811 #> 6 1 ABBEVILLE 2015 Estimate 24814"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":null,"dir":"Reference","previous_headings":"","what":"pop22_cohort — pop22_cohort","title":"pop22_cohort — pop22_cohort","text":"transformed summarized population data, distinguishing Estimate Projections, reformatted clarity, adding state-wide summary.","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop22_cohort — pop22_cohort","text":"","code":"pop22_cohort"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop22_cohort — pop22_cohort","text":"Data frame including FIPS, County, Year, Type, Gender Population. AGE GROUP Age Group Population, \"0 4\" \"5 9\" \"10 14\" \"15 19\" \"20 24\" \"25 29\" \"30 34\" \"35 39\" \"40 44\" \"45 49\" \"50 54\" \"55 59\" \"60 54\" \"65 69\" \"70 74\" \"75 79\" \"80 84\" \"85+\" FIPS FIPS code county County Name county Year Year Projection/Estimate (2010-2038) Type Estimate Projection Gender Male , Female Total Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_cohort.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop22_cohort — pop22_cohort","text":"","code":"data(pop22_cohort) head(pop22_cohort) #> # A tibble: 6 × 7 #> `AGE GROUP` County FIPS Gender Year Population Type #> #> 1 0 TO 4 ABBEVILLE 1 Total 2010 1503 Estimate #> 2 0 TO 4 ABBEVILLE 1 Female 2010 719 Estimate #> 3 0 TO 4 ABBEVILLE 1 Male 2010 784 Estimate #> 4 0 TO 4 ABBEVILLE 1 Total 2011 1436 Estimate #> 5 0 TO 4 ABBEVILLE 1 Female 2011 702 Estimate #> 6 0 TO 4 ABBEVILLE 1 Male 2011 734 Estimate"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":null,"dir":"Reference","previous_headings":"","what":"pop22_gender — pop22_gender","title":"pop22_gender — pop22_gender","text":"Tidy Format (Nov 2022 Data)","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop22_gender — pop22_gender","text":"","code":"pop22_gender"},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop22_gender — pop22_gender","text":"tidy data frame reshaped long form creating new columns Year, Type (Estimate Projection), Gender (Total, Male, Female), Population. FIPS FIPS code county County Name county Year Year Projection/Estimate (2010-2038) Type Estimate Projection Gender Male , Female Total Population Population number","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop22_gender.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop22_gender — pop22_gender","text":"","code":"data(pop22_gender ) head(pop22_gender ) #> # A tibble: 6 × 6 #> FIPS County Year Type Gender Population #> #> 1 1 ABBEVILLE 2010 Estimate Female 13055 #> 2 1 ABBEVILLE 2010 Estimate Male 12283 #> 3 1 ABBEVILLE 2010 Estimate Total 25338 #> 4 1 ABBEVILLE 2011 Estimate Female 12919 #> 5 1 ABBEVILLE 2011 Estimate Male 12174 #> 6 1 ABBEVILLE 2011 Estimate Total 25093"},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":null,"dir":"Reference","previous_headings":"","what":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"dataset provides relative growth projections different counties moderate high growth scenarios. includes calculations growth rates driver growth factors scenario.","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"","code":"pop_proj_relative"},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"dataset data frame following columns: County Name county Year Year Projection (2000-2038) High Population high growth scenario Moderate Population moderate growth scenario Driver_growth_mod Relative growth population moderate growth scenario Driver_growth_hi Relative growth population high growth scenario formulas used dataset follows: Moderate Growth Scenario (Moderate): $$Growth\\_{moderate} = \\max(Growth\\_{linear}, 0)$$ , \\(Growth\\_{linear}\\) represents average annual increase population. High Growth Scenario (High): $$Growth\\_{hi} = Growth\\_{exp\\_floor} \\times 1.10$$ \\(Growth\\_{exp}\\) exponential growth rate. \\(Growth\\_{exp\\_floor}\\) set least state average growth rate. Driver Growth Factors: $$Driver\\_{growth\\_mod} = \\frac{Moderate Population\\ \\ Year\\ X}{Moderate Population\\ \\ 2021}$$ $$Driver\\_{growth\\_hi} = \\frac{High Population\\ \\ Year\\ X}{High Population\\ \\ 2021}$$","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pop_proj_relative.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"pop_proj_relative: Relative Growth Projections for Different Counties — pop_proj_relative","text":"","code":"data(pop_proj_relative) head(pop_proj_relative) #> # A tibble: 6 × 6 #> County Year High Moderate Driver_growth_mod Driver_growth_hi #> #> 1 ABBEVILLE 2021 24071. 24071. 1 1 #> 2 ABBEVILLE 2022 24291. 23930. 0.994 1.01 #> 3 ABBEVILLE 2023 24513. 23789. 0.988 1.02 #> 4 ABBEVILLE 2024 24738. 23648. 0.982 1.03 #> 5 ABBEVILLE 2025 24964. 23507. 0.977 1.04 #> 6 ABBEVILLE 2026 25192. 23345. 0.970 1.05"},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Population Pyramid Plot — pyramid_plot","title":"Create Population Pyramid Plot — pyramid_plot","text":"Create Population Pyramid Plot","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Population Pyramid Plot — pyramid_plot","text":"","code":"pyramid_plot(df)"},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Population Pyramid Plot — pyramid_plot","text":"df Data frame containing population data","code":""},{"path":"https://capellett.github.io/scpopulation/reference/pyramid_plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create Population Pyramid Plot — pyramid_plot","text":"See https://rfortherestofus.com/2024/07/population-pyramid-part-1 inspiration.","code":""}]