Skip to content

Commit

Permalink
amended the documentation to pretty_table to remove refs to the cols …
Browse files Browse the repository at this point in the history
…just being numeric, add link to the function family and linked the pretty_num function
  • Loading branch information
mzayeddfe committed Oct 10, 2024
1 parent 0cbe0c6 commit bf524d4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
9 changes: 5 additions & 4 deletions R/pretty.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ pretty_num <- function(
#' to specify columns for formatting
#' and pass arguments to `dfeR::pretty_num` for number formatting
#'
#' @param data A data frame containing the numeric columns to be formatted.
#' @param data A data frame containing the columns to be formatted.
#' @param include_columns A character vector specifying which columns to format.
#' If `NULL` (default), all columns will be considered for formatting.
#' @param exclude_columns A character vector specifying columns to exclude
Expand All @@ -341,6 +341,8 @@ pretty_num <- function(
#' If none are provided, it checks if columns are specified for exclusion
#' via `exclude_columns`.
#' If neither is specified, all columns in the data frame are formatted.
#' @family prettying
#' @seealso [pretty_num()]
#' @export
#' @examples
#' # Example data frame
Expand Down Expand Up @@ -381,15 +383,15 @@ pretty_table <- function(data,

# if the exclude_columns arg is specified
} else if (!is.null(exclude_columns)) {
# we assign the cols_to_include to names of all numeric columns
# we assign the cols_to_include to names of all columns
# except for ones specified in exclude_columns
cols_to_include <- setdiff(
names(data),
exclude_columns
)
} else {
# if none of the previous conditions are met
# , all numeric cols are assigned to cols_to_include
# , all columns are assigned to cols_to_include
cols_to_include <- names(data)
}

Expand All @@ -399,5 +401,4 @@ pretty_table <- function(data,
.cols = dplyr::all_of(cols_to_include),
~ pretty_num(., ...)
))

}
1 change: 1 addition & 0 deletions man/pretty_filesize.Rd

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

3 changes: 1 addition & 2 deletions man/pretty_num.Rd

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

11 changes: 10 additions & 1 deletion man/pretty_table.Rd

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

3 changes: 2 additions & 1 deletion man/pretty_time_taken.Rd

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

0 comments on commit bf524d4

Please sign in to comment.