Coder Social home page Coder Social logo

metropolitan-council / travel-study-stories Goto Github PK

View Code? Open in Web Editor NEW

This project forked from psrc/travel-study-stories

2.0 2.0 0.0 155.02 MB

Travel Behavior Inventory analysis and interactive visualization

Home Page: https://metrotransitmn.shinyapps.io/travel-survey-explorer/

License: GNU General Public License v3.0

R 94.43% Python 0.36% CSS 4.81% Shell 0.27% HTML 0.13%
golem-apps mts rstats shiny travel-behavior

travel-study-stories's People

Contributors

cyyllam avatar ehesch avatar ennazus avatar eroten avatar hanase avatar

Stargazers

 avatar

travel-study-stories's Issues

Add summary output for factor variables

currently, factor variables give NA for mean/median
could add an output that is like "mode" or some such
tab_mean <-
data.frame(
mean = NA,
mean_se = NA,
median = NA,
median_se = NA
)

Conditional formatting

Gray out cells in table with

less than 30 respondents for a cell
less than 60 respondents for a table

String a sentence for tooltip

One-way:

  • An estimated ___
  • if percent: "% of"
  • [trips/people/households/vehicles]
  • are
  • value_label
  • .

Two-way:

  • trip -> hh: __% of [trip value_label] trips are made by [hh value_label] households.

  • trip -> per: __% of [trip value_label] trips are made by [per value_label] people.

  • trip -> veh: __% of [trip value_label] trips are made with [veh value_label] vehicles.

  • trip -> trip: __% of [trip 1 value_label] trips are also [trip 2 value_label]

  • trip -> day: __% of [trip value_label] trips are made by people who [day value_label]

  • veh -> hh: __% of [veh value_label] vehicles are owned by [hh value_label] households.

  • veh -> per: __% of [veh value_label] vehicles are owned by [per value_label] people.

  • veh -> veh: __% of [veh 1 value_label] vehicles are also [veh value_label].

  • veh -> trip: __% of [veh value_label] vehicles are used on [trip 2 value_label] trips.

  • veh -> day: __% of [veh value_label] vehicles are used by people who [day value_label].

  • per -> hh: __% of [per value_label] people reside in [hh value_label] households.

  • per -> per: __% of [per 1 value_label] people are also [per 2 value_label].

  • per -> veh: __% of [per value_label] people own [veh value_label] vehicles.

  • per -> trip: __% of [per value_label] people make [trip value_label] trips.

  • per -> day: __% of [per value_label] people are also those that [day value_label].

  • hh -> hh: __% of [per value_label] people reside in [hh value_label] households.

  • hh -> per: __% of [per 1 value_label] people are also [per 2 value_label].

  • hh -> veh: __% of [per value_label] people own [veh value_label] vehicles.

  • hh -> trip: __% of [per value_label] people make [trip value_label] trips.

  • hh -> day: __% of [per value_label] households include people who [day value_label].

add subtotals to tables

in one way table, would want a total sample size at the bottom
in two-way table, want row & column totals

String a sentence for title of plots

One-way table:

  • Estimated
  • [percent/number]
  • of
  • [households/people/trips/vehicles]
  • in each
  • [variable]
  • category.

Two-way table:

  • Estimated
  • [percent/number]
  • of
  • [column weighting var: households/people/trips/vehicles]
  • in each
  • [crosstab_column]
  • category, shown separately for each
  • [crosstab_row].

Race yes/no inputs

The data is formatted so that each race is an independent yes/no variable. Can we consolidate this like we have for other demographics?

re-set city/township selectinput box when county is cleared

maybe I need to turn off "ignoreNULL" in this part of mod_filters_oneway.R?

    observeEvent(input$oneway_input_counties,
                 {
                   if (!is.null(input$oneway_input_counties))
                   {
                     filtered_cities <- tbi_tables$hh %>%
                       dplyr::filter(hh_county %in% input$oneway_input_counties) %>%
                       dplyr::select(hh_city) %>%
                       unique() %>%
                       na.omit()

                     updateSelectInput(
                       session = session,
                       inputId = "oneway_input_cities",
                       label = "Household City/Township",
                       choices = filtered_cities$hh_city,
                       selected = NULL
                     )
                   } else {
                     selectInput(
                       session = session,
                       inputId = ns("oneway_input_cities"),
                       "Household City/Township",
                       choices = unique(na.omit(tbi_tables$hh$hh_city)),
                       selected = NULL)
                   }},
                 ignoreInit = TRUE
    )

input_category_col is initialized with incorrect value

in mod_input_category_col.R:

At line 61, I've turned on the print statement to see what category & variable the app thinks is being selected:

    # print the selected input$category and input$variable
    observe({
      print(paste0(id, "-", input$category, ":", input$variable))
    })

Even though I have initialized the selectInput to reference the variable purpose_category, it's finding bike_park_loc. I'm not sure why.

mod_input_category_col_ui <- function(id){
  ns <- NS(id)
  tagList(
    selectInput(
      inputId = ns("category"),
      label = "Category",
      choices = unique(tbi_dict$category),
      selected = "Trips"
    ),
    selectInput(
      inputId = ns("variable"),
      label = "Variable",
      choices = input_list$Trips,
      selected = "Trip purpose - broad categories"
    )

    # textOutput(outputId = "question")
  )
}

Checking the input_list.rda, It really seems like it should be finding the right variable:

load("~/MetC_Locals/MTS/travel-study-stories/travel.survey.explorer/data/input_list.rda")
input_list$Trips
input_list$Trips["Trip purpose - broad categories"]

run stats: what's significant?

chi square analysis running in background?
"Chi square indicates NSD"
Maybe all bars are same color of GRAY if no sig diff among categories

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.