From 1f2b559eaaf6661b08945a94901e2a53007386ed Mon Sep 17 00:00:00 2001 From: James Clark Date: Tue, 12 Mar 2024 09:55:59 -0600 Subject: [PATCH] add col for weighted trip count --- DESCRIPTION | 2 +- NEWS.md | 5 ++ R/hts_prep_triprate.R | 3 +- docs/404.html | 2 +- docs/CONTRIBUTING.html | 2 +- docs/LICENSE.html | 2 +- docs/PULL_REQUEST_TEMPLATE.html | 2 +- docs/articles/a01_getting_started.html | 2 +- docs/articles/a02_geographic_summaries.html | 2 +- docs/articles/a03_trip_rates.html | 2 +- docs/articles/index.html | 2 +- docs/authors.html | 2 +- docs/index.html | 2 +- docs/news/index.html | 6 +- docs/pkgdown.yml | 2 +- docs/reference/day.html | 2 +- docs/reference/factorize_column.html | 2 +- docs/reference/factorize_df.html | 2 +- docs/reference/get_distance_meters.html | 2 +- docs/reference/hh.html | 2 +- docs/reference/hts_bin_var.html | 2 +- docs/reference/hts_calculate_vmt.html | 2 +- docs/reference/hts_cbind_var.html | 2 +- docs/reference/hts_filter_data.html | 2 +- docs/reference/hts_find_var.html | 2 +- docs/reference/hts_get_ns.html | 2 +- docs/reference/hts_melt_vars.html | 2 +- docs/reference/hts_prep_byvar.html | 2 +- docs/reference/hts_prep_triprate.html | 80 ++++++++++++------- docs/reference/hts_prep_variable.html | 2 +- docs/reference/hts_remove_missing_data.html | 2 +- docs/reference/hts_remove_outliers.html | 2 +- docs/reference/hts_summary.html | 2 +- docs/reference/hts_summary_cat.html | 2 +- docs/reference/hts_summary_num.html | 2 +- docs/reference/hts_to_so.html | 2 +- docs/reference/hts_trip_vehid.html | 60 +++++++------- .../reference/hts_validate_variable_list.html | 2 +- docs/reference/index.html | 2 +- docs/reference/join_spatial.html | 2 +- docs/reference/person.html | 2 +- docs/reference/pipe.html | 2 +- docs/reference/test_data.html | 2 +- docs/reference/trip.html | 2 +- docs/reference/value_labels.html | 2 +- docs/reference/variable_list.html | 2 +- docs/reference/vehicle.html | 2 +- docs/search.json | 2 +- 48 files changed, 138 insertions(+), 102 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2c4c7db..69b9f27 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: travelSurveyTools Title: travelSurveyTools -Version: 2.3.7 +Version: 2.3.8 Authors@R: c( person("RSG", "Inc.", , "rsg@rsginc.com", role = c("aut", "cre")), person("Ashley", "Asmus", , "ashley.asmus@rsginc.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index f829983..fb2d898 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# travelSurveyTools 2.3.8 + +- Add column in `hts_prep_triprate` for weighted trip count. + + # travelSurveyTools 2.3.6 - Fixing `hts_prep_triprate` to properly calculate days with zero trips. diff --git a/R/hts_prep_triprate.R b/R/hts_prep_triprate.R index 6173f4d..1d8fe5a 100644 --- a/R/hts_prep_triprate.R +++ b/R/hts_prep_triprate.R @@ -230,7 +230,8 @@ if (length(summarize_by) > 0) { triprate_dt[, trip_rate := ifelse(num_trips == 0, 0, num_trips / get(day_wt))] - triprate_dt[, num_trips := NULL] + # Save counts of trips under a different name + setnames(triprate_dt, "num_trips", "trip_count_wtd") setnames(triprate_dt, "trip_rate", "num_trips") } diff --git a/docs/404.html b/docs/404.html index 3e68e19..bffe1d5 100644 --- a/docs/404.html +++ b/docs/404.html @@ -24,7 +24,7 @@ travelSurveyTools - 2.3.7 + 2.3.8