olivroy / reuseme

Collections of Utility Functions to Work Across Projects
https://olivroy.github.io/reuseme/
Other
3 stars 2 forks source link

Defaults management and doc style #7

Open olivroy opened 12 months ago

olivroy commented 12 months ago

https://style.tidyverse.org/documentation.html

i.e. Sentences that ends with a dot. Capital letters,

Always indent with one space after #'. If any description corresponding to a roxygen tag spans over multiple lines, add another two spaces of extra indention.

For most tags, like @param, @seealso and @returns, the text should be a sentence, starting with a capital letter and ending with a full stop.

Add link when making statements, this thing doesn't work, etc.

style for defaults

negate | If TRUE, return non-matching elements.

#' @param start,end Integer vectors giving the `start` (default: first)
#'   and `end` (default: last) positions, inclusively. Alternatively, you
#'   pass a two-column matrix to `start`, i.e. `str_sub(x, start, end)`
#'   is equivalent to `str_sub(x, cbind(start, end))`
## defaults / missing / `NULL`

https://design.tidyverse.org/def-required.html https://design.tidyverse.org/def-magical.html#how-do-i-remediate-the-problem https://design.tidyverse.org/def-inform.html

with_ties | Should ties be kept together? The default, TRUE, may return more rows than you request. Use FALSE to ignore ties, and return the first n rows.

na_rm | Should missing values in order_by be removed from the result? If FALSE, NA values are sorted to the end (like in arrange()), so they will only be included if there are insufficient non-missing values to reach n/prop.

Should ties be kept together? The default, TRUE, may return more rows than you request. Use FALSE to ignore ties, and return the first n rows.

na_rm
Should missing values in order_by be removed from the result? If FALSE, NA values are sorted to the end (like in [arrange()] so they will only be included if there are insufficient non-missing values to reach n/prop.

replace | Should sampling be performed with (TRUE) or without (FALSE, the default) replacement.

too_few What should happen if a value separates into too few pieces?"error", the default, will throw an error."debug" adds additional columns to the output to help you locate and resolve the underlying problem. This option is intended to help you debug the issue and address and should not generally remain in your final code."align_start" aligns starts of short matches, adding NA on the end to pad to the correct length."align_end" (separate_wider_delim() only) aligns the ends of short matches, adding NA at the start to pad to the correct length.
olivroy commented 10 months ago

https://github.com/r-lib/httr2/pull/285/files

function(seconds, task, fps = 10, progress = getOption("httr2_progress", TRUE)) {

https://design.tidyverse.org/argument-clutter.html#how-do-i-remediate-past-mistakes