Skip to content

Commit

Permalink
Merge pull request #128 from RSGInc/main
Browse files Browse the repository at this point in the history
pull from main
  • Loading branch information
jacobmoore5067 authored Feb 28, 2024
2 parents 1b8eeeb + 13d9a4e commit ebf8d85
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 124 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Package: travelSurveyTools
Title: travelSurveyTools
Version: 2.3.2
Version: 2.3.3
Authors@R: c(
person("RSG", "Inc.", , "rsg@rsginc.com", role = c("aut", "cre")),
person("Ashley", "Asmus", , "ashley.asmus@rsginc.com", role = "aut"),
person("Erika", "Redding", , "erika.redding@rsginc.com", role = "aut"),
person("Jacob", "Moore", , "jacob.moore@rsginc.com", role = "aut"),
person("James", "Clark", , "james.clark@rsginc.com", role = "aut")
person("James", "Clark", , "james.clark@rsginc.com", role = "aut"),
person("Matt", "Landis", , "matt.landis@rsginc.com", role = "aut")
)
Description: An R Package To Make Working With And Summarizing Household Travel Survey Data Easier.
License: GPL (>= 3)
Expand All @@ -30,7 +31,7 @@ Suggests:
tigris
Config/testthat/edition: 3
Depends:
R (>= 2.10)
R (>= 4.1)
LazyData: true
VignetteBuilder: knitr
URL: https://github.com/RSGInc/travelSurveyTools
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.3.3

- Small updates to DESCRIPTION

# travelSurveyTools 2.3.2

- Additional steps to ensure anonymity of test data
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
#' A data frame with 55 rows and 10 columns:
#' \describe{
#' \item{variable}{Name of the variable}
#' \item{is_checkbox}{The variable is a 'Select all that Apply' question}
#' \item{is_checkbox}{The variable is a multiple response categorical variable question}
#' \item{hh}{The variable exists in the hh table}
#' \item{person}{The variable exists in the person table}
#' \item{day}{The variable exists in the day table}
Expand Down
6 changes: 3 additions & 3 deletions R/hts_summary_cat.R
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ hts_summary_cat = function(prepped_dt,
strataname = strataname)

wtd_summary =
so %>%
group_by_at(unlist(groupbyvars)) %>%
so |>
group_by_at(unlist(groupbyvars)) |>
summarize(
count = length(get(summarize_var)),
prop = srvyr::survey_prop(proportion = FALSE,
vartype = "se"),
est = survey_total(vartype = "se")
) %>%
) |>
setDT()

} else if (!se) {
Expand Down
12 changes: 6 additions & 6 deletions R/hts_summary_num.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ hts_summary_num = function(prepped_dt,

# Calculate survey proportions:
num_summary_wttype =
num_so_ls[[wt_type]] %>%
group_by_at(unlist(summarize_by)) %>%
num_so_ls[[wt_type]] |>
group_by_at(unlist(summarize_by)) |>
summarize(
count = length(get(summarize_var)),
min = min(get(summarize_var), na.rm = TRUE),
max = max(get(summarize_var), na.rm = TRUE),
mean = survey_mean(get(summarize_var), vartype = variance_type, na.rm = TRUE),
median = survey_median(get(summarize_var), vartype = NULL, na.rm = TRUE)
) %>%
) |>
setDT()

num_summary_ls[[wt_type]] = num_summary_wttype
Expand All @@ -107,15 +107,15 @@ hts_summary_num = function(prepped_dt,

# Calculate survey proportions:
num_summary_wttype =
num_so_ls[[wt_type]] %>%
group_by_at(unlist(summarize_by)) %>%
num_so_ls[[wt_type]] |>
group_by_at(unlist(summarize_by)) |>
summarize(
count = length(get(summarize_var)),
min = min(get(summarize_var), na.rm = TRUE),
max = max(get(summarize_var), na.rm = TRUE),
mean = survey_mean(get(summarize_var), vartype = NULL, na.rm = TRUE),
median = survey_median(get(summarize_var), vartype = NULL, na.rm = TRUE)
) %>%
) |>
setDT()

num_summary_ls[[wt_type]] = num_summary_wttype
Expand Down
2 changes: 1 addition & 1 deletion R/utils-pipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#' @param lhs A value or the magrittr placeholder.
#' @param rhs A function call using the magrittr semantics.
#' @return The result of calling `rhs(lhs)`.
NULL
NULL
2 changes: 1 addition & 1 deletion man/variable_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ebf8d85

Please sign in to comment.