Skip to content

Commit

Permalink
removed extra braces buried in hts_prep_data and moved hts_remove_mis…
Browse files Browse the repository at this point in the history
…sing_data up #74
  • Loading branch information
erika-redding committed Jan 26, 2024
1 parent c056007 commit 84bda7b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion R/get_distance_meters.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return A vector of distances in meters
#' @export get_distance_meters
#'
#' @example
#' @examples
#' get_distance_meters(c(38.8734, -75.2394), c(40.3497, -76.2314))
#'
get_distance_meters =
Expand Down
25 changes: 12 additions & 13 deletions R/hts_prep_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ hts_prep_data = function(summarize_var = NULL,
# TODO: Could we put id and weight cols in a snippet or some such?
# Or in a settings/options for these functions?

if (remove_missing){

data = hts_remove_missing_data(hts_data = data,
variables_dt = variables_dt,
summarize_var = summarize_var,
summarize_by = summarize_by,
ids = id_cols,
missing_value = missing_value,

not_imputable = not_imputable)
}

# Find location of summary variable:
var_location = hts_find_var(summarize_var, variables_dt = variables_dt)

Expand Down Expand Up @@ -132,7 +144,6 @@ hts_prep_data = function(summarize_var = NULL,

}

}


# Subset table to these column(s):
Expand Down Expand Up @@ -307,18 +318,7 @@ hts_prep_data = function(summarize_var = NULL,


}
if (remove_missing){

hts_data = hts_remove_missing_data(hts_data = data,
variables_dt = variables_dt,
summarize_var = summarize_var,
summarize_by = summarize_by,
ids = id_cols,
missing_value = missing_value,

not_imputable = not_imputable)
}

if (!is.null(strataname)) {

if(!is.null(cat_res)){
Expand Down Expand Up @@ -358,7 +358,6 @@ hts_prep_data = function(summarize_var = NULL,


return(prepped_dt_ls)

}


Expand Down
4 changes: 4 additions & 0 deletions man/get_distance_meters.Rd

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

0 comments on commit 84bda7b

Please sign in to comment.