From 0cfc2446a3324241529f7cbc8469eae3bdab9e96 Mon Sep 17 00:00:00 2001 From: jacobmoore5067 Date: Fri, 26 Jan 2024 16:17:01 -0500 Subject: [PATCH 1/2] Adding checkbox examples --- R/hts_summary.R | 17 ++++++++++++++++- R/hts_summary_cat.R | 9 ++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/R/hts_summary.R b/R/hts_summary.R index 656d47f..6f23840 100644 --- a/R/hts_summary.R +++ b/R/hts_summary.R @@ -66,7 +66,22 @@ #' summarize_by = 'age', #' summarize_vartype = 'numeric', #' wtname = 'trip_weight') -#' +#' +#' DT = hts_prep_data(summarize_var = 'race', +#' summarize_by = 'age', +#' variables_dt = variable_list, +#' data = list('hh' = hh, +#' 'person' = person, +#' 'day' = day, +#' 'trip' = trip, +#' 'vehicle' = vehicle))$cat +#' output = hts_summary(prepped_dt = DT, +#' summarize_var = 'race', +#' summarize_by = 'age', +#' summarize_vartype = 'categorical', +#' wtname = 'person_weight', +#' checkbox_valname = 'value', +#' checkbox_yesval = 1) hts_summary = function( diff --git a/R/hts_summary_cat.R b/R/hts_summary_cat.R index b76e7ec..f64033a 100644 --- a/R/hts_summary_cat.R +++ b/R/hts_summary_cat.R @@ -40,7 +40,8 @@ #' hts_summary_cat(prepped_dt = DT, #' summarize_var = 'age', #' wtname = 'person_weight') -#' DT = hts_prep_data(summarize_var = 'age', +#' +#' DT = hts_prep_data(summarize_var = 'race', #' summarize_by = 'employment', #' variables_dt = variable_list, #' data = list('hh' = hh, @@ -49,9 +50,11 @@ #' 'trip' = trip, #' 'vehicle' = vehicle))$cat #' hts_summary_cat(prepped_dt = DT, -#' summarize_var = 'age', +#' summarize_var = 'race', #' summarize_by = 'employment', -#' wtname = 'person_weight') +#' wtname = 'person_weight', +#' checkbox_valname = 'value', +#' checkbox_yesval = 1) #' #' DT = hts_prep_data(summarize_var = 'employment', #' summarize_by = c('race', 'income_detailed', 'gender'), From f9d1912905e33cc99682ec83712a345b0f22f141 Mon Sep 17 00:00:00 2001 From: jacobmoore5067 Date: Fri, 26 Jan 2024 16:26:50 -0500 Subject: [PATCH 2/2] updating documentation --- .Rbuildignore | 2 ++ man/hts_summary.Rd | 17 ++++++++++++++++- man/hts_summary_cat.Rd | 9 ++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index edcb22f..7bb6232 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -7,3 +7,5 @@ ^CONTRIBUTING.md$ ^LICENSE.md$ ^scratch.R +^_pkgdown.yml +^docs diff --git a/man/hts_summary.Rd b/man/hts_summary.Rd index 8cc2f2a..d25d706 100644 --- a/man/hts_summary.Rd +++ b/man/hts_summary.Rd @@ -99,5 +99,20 @@ output = hts_summary(prepped_dt = DT, summarize_by = 'age', summarize_vartype = 'numeric', wtname = 'trip_weight') - + +DT = hts_prep_data(summarize_var = 'race', + summarize_by = 'age', + variables_dt = variable_list, + data = list('hh' = hh, + 'person' = person, + 'day' = day, + 'trip' = trip, + 'vehicle' = vehicle))$cat +output = hts_summary(prepped_dt = DT, + summarize_var = 'race', + summarize_by = 'age', + summarize_vartype = 'categorical', + wtname = 'person_weight', + checkbox_valname = 'value', + checkbox_yesval = 1) } diff --git a/man/hts_summary_cat.Rd b/man/hts_summary_cat.Rd index a0a3a25..47bf2b6 100644 --- a/man/hts_summary_cat.Rd +++ b/man/hts_summary_cat.Rd @@ -62,7 +62,8 @@ DT = hts_prep_data(summarize_var = 'age', hts_summary_cat(prepped_dt = DT, summarize_var = 'age', wtname = 'person_weight') -DT = hts_prep_data(summarize_var = 'age', + +DT = hts_prep_data(summarize_var = 'race', summarize_by = 'employment', variables_dt = variable_list, data = list('hh' = hh, @@ -71,9 +72,11 @@ DT = hts_prep_data(summarize_var = 'age', 'trip' = trip, 'vehicle' = vehicle))$cat hts_summary_cat(prepped_dt = DT, - summarize_var = 'age', + summarize_var = 'race', summarize_by = 'employment', - wtname = 'person_weight') + wtname = 'person_weight', + checkbox_valname = 'value', + checkbox_yesval = 1) DT = hts_prep_data(summarize_var = 'employment', summarize_by = c('race', 'income_detailed', 'gender'),