Skip to content

Commit

Permalink
Merge pull request #112 from RSGInc/106-remove-missing-weights
Browse files Browse the repository at this point in the history
106 remove missing weights
  • Loading branch information
erika-redding authored Feb 9, 2024
2 parents 7f70ceb + 63a81e5 commit 8967265
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: travelSurveyTools
Title: travelSurveyTools
Version: 1.0.0
Version: 2.0.0
Authors@R: c(
person("RSG", "Inc.", , "[email protected]", role = c("aut", "cre")),
person("Ashley", "Asmus", , "[email protected]", role = "aut"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# travelSurveyTools 2.0.0

- Add function to check variable_list (`hts_validate_variable_list`)

# travelSurveyTools 1.0.0

# travelSurveyTools 0.9
Expand Down
10 changes: 10 additions & 0 deletions R/hts_prep_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ hts_prep_data = function(summarize_var = NULL,
# Select table where this variable lives:
var_dt = data[[var_location]]

browser()
#check for missing weight variables
missing_weight_count = var_dt[is.na(ids[tbl_idx]), .N]

if (missing_weight_count > 0){

message(missing_weight_count, ' missing weight(s) of ', ids[tbl_idx],
' in ', var_location, ' setting equal to 0')

}

# Check that specified id column exists in var_dt
stopifnot("table id not in var_dt, make id_cols ordered list of ids in each table of data" =
Expand Down

0 comments on commit 8967265

Please sign in to comment.