Skip to content

Commit

Permalink
Minor reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed May 9, 2019
1 parent 2a67b4b commit d3f129e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ rmd_files:

"args.Rmd",
"args-hidden.Rmd",
"args-required.Rmd",
"args-data-details.Rmd",
"args-independence.Rmd",
"cs-rep.Rmd",

"args-required.Rmd",
"args-enum.Rmd",
"args-magical-defaults.Rmd",
"args-defaults-short.Rmd",
Expand Down
2 changes: 1 addition & 1 deletion call-data-details.Rmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Data, then details {#call-data-details}
# Name data arguments {#call-data-details}

```{r, include = FALSE}
source("common.R")
Expand Down
12 changes: 6 additions & 6 deletions structure.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ The interface of a function describes how it interfaces with the world, independ
arguments. Avoid functions that suprise the user by returning different
results when the inputs look the same.

#### Default values

* Chapter \@ref(args-required): the absence of a default value should indicate
that an argument is required; the presence of a default value should indicate
that an argument is optional.

* Chapter \@ref(args-data-details): Required arguments should come before
optional arguments.

* Chapter \@ref(args-independence): Make arguments as orthogonal as possible.
Avoid complex interdependencies.

#### Default values

* Chapter \@ref(args-required): the absence of a default value should indicate
that an argument is required; the presence of a default value should indicate
that an argument is optional.

* Chapter \@ref(args-enum): If a details argument can take one of a fixed set
of possible strings, record them in the default value and use `match.arg()`
or `rlang::arg_match()` inside the function.
Expand Down

0 comments on commit d3f129e

Please sign in to comment.