16 Matching Annotations
  1. Oct 2024
    1. left_join(tbi$hh) %>%

      As written it will return NA for entire sample_segment column. Instead put left_join(tbi$hh, by = c("survey_year", "hh_id")) %>%

    2. left_join(tbi$hh, by = "hh_id") %>%

      If you join it like this, survey_year will become survey_year.x. Instead do left_join(tbi$hh, by = c("hh_id", "survey_year")) %>%

    3. left_join(tbi$hh, by = "hh_id") %>%

      If you join it like this, survey_year will become survey_year.x. Instead do left_join(tbi$hh, by = c("hh_id", "survey_year")) %>%

    4. left_join(tbi$hh, by = "hh_id") %>%

      If you join it like this, survey_year will become survey_year.x. Instead do left_join(tbi$hh, by = c("hh_id", "survey_year")) %>%

    5. mode_type = value_labels_upcoded[variable == "mode_type", value],

      mode_type = values_list[variable_unified == "mode_type", value_upcoded],

    6. tab <- tbi$person %>% left_join(tbi$hh, by = "hh_id") %>% filter(survey_year == 2023) %>% group_by(home_county, job_type_pre_covid) %>% summarize(wtd_population = sum(person_weight)) %>% ungroup() %>% group_by(home_county) %>% mutate(wtd_prop_population = wtd_population / sum(wtd_population))

      Joining like this will cause the column for survey_year to become survey_year.x. Instead join by both hh_id and survey_year. left_join(tbi$hh, by = c("hh_id", "survey_year") %>%

    7. gt::fmt_number(columns = c(2:4), decimals = 0) %>% gt::fmt_percent(columns = c(5:6), decimals = 1)

      With extra home county column (column 1) need to move over one c(2:4) -> c(3:5) and c(5:6) -> c(6:7)

    8. group_by(income_broad) %>%

      group_by(home_county, income_broad) %>% need to keep home county column for later

    9. description

      description_unified

    10. left_join(nt_desc3, by = "variable")

      left_join(nt_desc3, by = c("variable" = "variable_unified"))

    11. description = str_replace( description

      Change description to description_unified

    12. description

      Change to description_unified

    13. description

      Change to description_unified

    14. nt_desc <- filter(variable_list, str_detect(variable, "no_travel")) %>% select(variable, description)

      The column has been changed from variable to variable_unified and from description to description_unified

    15. weighted_hhs <- tbi$hh[!is.na(hh_weight) & hh_weight > 0, hh_id] tbi <- lapply( tbi, function(dt) { dt <- dt[hh_id %in% weighted_hhs] } )

      The new data includes 10 elements instead of 8. To align them first create variable_list <- tbi$metaData_variables and values_list <- tbi$metaData_values before deleting the two additional elements tbi<- tbi[1:8]

    16. Getting Started

      It would be nice for a list of all packages that will be used so we can activate them.