Skip to content

Commit

Permalink
add state population dataset #24
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed Oct 18, 2024
1 parent e226010 commit 0d83203
Show file tree
Hide file tree
Showing 2 changed files with 464 additions and 0 deletions.
13 changes: 13 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,16 @@ download_model_RDS <- function(modelname) {
}
return(file_path)
}

#' Load state population table.
load_state_population <- function(path=NULL) {
if (is.null(path)) {
path <- file.path("../data/state_population.csv")
} else {
path <- file.path(path, "state_population.csv")
}
pop <- read.csv(path, header=TRUE)
pop <- pop[,c("FlowAmount","Abbreviation","Year")]
colnames(pop) <- c("Population","State","Year")
return(pop)
}
Loading

0 comments on commit 0d83203

Please sign in to comment.