Skip to content

for loose examples around using the US National Household Travel Survey

License

Notifications You must be signed in to change notification settings

r-transit/nhts-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

nhts-examples

for loose examples around using NHTS survey data

install.packages('devtools')
devtools::install_github('Westat-Transportation/summarizeNHTS')
library(summarizeNHTS)
download_nhts_data("2017", exdir="~/Documents/data")
dataset <- read_data("2017", csv_path = "~/Documents/data")
statistic <- summarize_data(
  data = dataset,
  agg = "household_count",
  by = c("HHSIZE","HHVEHCNT")
)
make_chart(statistic)

data model

library(tigris)
library(dplyr)
cbsas <- core_based_statistical_areas(class="sf", cb=TRUE)

hhs_by_cbsa <- dataset$data$household %>% 
  group_by(HH_CBSA) %>%
  summarise(count = n()) %>%
  right_join(cbsas, by = c("HH_CBSA" = "GEOID"))

About

for loose examples around using the US National Household Travel Survey

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published