Skip to content

Commit

Permalink
change to verbose
Browse files Browse the repository at this point in the history
I'm not sure why it was producing errors before

ref #126
  • Loading branch information
wibeasley committed Oct 28, 2023
1 parent 4457547 commit 628fbe7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions R/row.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @param threshold_proportion Designates the minimum proportion of columns
#' that have a nonmissing values (within each row) in order to return a sum.
#' Required; defaults to to 0.75.
#' @param vv a logical value to designate if extra information is
#' @param verbose a logical value to designate if extra information is
#' displayed in the console,
#' such as which columns are matched by `pattern`.
#'
Expand All @@ -42,16 +42,14 @@ row_sum <- function(
pattern,
new_column_name = "row_sum",
threshold_proportion = .75,
vv = FALSE
verbose = FALSE
) {
checkmate::assert_data_frame(d)
checkmate::assert_character(columns_to_average , any.missing = FALSE)
checkmate::assert_character(pattern , min.len = 0, max.len = 1)
checkmate::assert_character(new_column_name , len = 1)
checkmate::assert_double( threshold_proportion, len = 1)
checkmate::assert_logical( vv , len = 1)


checkmate::assert_logical( verbose , len = 1)

if (length(columns_to_average) == 0L) {
columns_to_average <-
Expand All @@ -64,7 +62,7 @@ row_sum <- function(
perl = TRUE
)

if (vv) {
if (verbose) {
message(
"The following columns will be summed:\n- ",
paste(columns_to_average, collapse = "\n- ")
Expand All @@ -90,7 +88,6 @@ row_sum <- function(
dplyr::across(!!columns_to_average),
na.rm = TRUE
),
# rs = dplyr::if_else(cast_to_integer, as.integer(rs), rs),
nonmissing_count =
rowSums(
dplyr::across(
Expand Down
4 changes: 2 additions & 2 deletions man/row_sum.Rd

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

0 comments on commit 628fbe7

Please sign in to comment.