Skip to content

Commit 48f89f0

Browse files
authored
Merge pull request #81 from r-devel/bettinagruen-patch-7
Update code_issues.qmd
2 parents 313ee55 + cdda7c6 commit 48f89f0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

code_issues.qmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ To allow users to suppress the console output CRAN recommends two different ways
125125

126126
* exchanging `cat()`/`print()` with other generics
127127
- [`message()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/message.html): for information messages and status updates
128-
- [`warning()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/warning.html): for warning, will print a "Warning: " before the output
128+
- [`warning()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/warning.html): for warnings, will print a "Warning: " before the output
129129
- [`stop()`](https://stat.ethz.ch/R-manual/R-devel/library/base/html/stop.html): for error messages, will print an "Error: " before the output and halt the execution
130130

131131
This allows to use functions like `suppressMessages()` to avoid unwanted output.
@@ -152,7 +152,7 @@ Functions can print per default, like the example above, as long as the printing
152152
:::{.callout-note}
153153

154154
`print()` and `cat()` are not the only functions which can write output onto the console. The issue described in the recipe, also applies to the use of other printing function like `writeLines()`.
155-
If you are using loggers to document your functions' process, make sure that users can set their log level such that not messages are displayed.
155+
If you are using loggers to document your functions' process, make sure that users can set their log level such that messages are not displayed.
156156

157157
:::
158158

@@ -255,8 +255,8 @@ Here the code will only reset the options if the example runs without breaking.
255255

256256
:::{.callout-tip}
257257

258-
If you need to change more than one option in the same function, example, vignette or demo, you can use `oldpar <- par(no.readonly = TRUE)` or `oldop <- options()` to reset all parameters at once. Saving the entire
259-
Note, that for `par()` the `no.readonly` argument must be set to `TRUE` or else warnings will be produced.
258+
If you need to change more than one option in the same function, example, vignette or demo, you can use `oldpar <- par(no.readonly = TRUE)` or `oldop <- options()` to reset all parameters at once.
259+
Note that, in this case, for `par()` the `no.readonly` argument must be set to `TRUE` or else warnings will be produced.
260260

261261
:::
262262

@@ -322,7 +322,7 @@ Check: for detritus in the temp directory, Result: NOTE\
322322
&emsp;&emsp; ‘this\_is\_detritus382e569a7712’
323323
:::
324324

325-
The code responsible for the detritus may include your own tests and examples creating files under `tempdir()`, child processes, or 'Python' code launched using 'reticulate'. For example, R packages that use the 'tensorflow' 'Python' package [find and remove temporary files created by its auto-gradient feature](https://github.com/cran/vetiver/blob/35b24768cf0e84fab96610e001bba377dc777953/tests/testthat/setup.R#L13).
325+
The code responsible for the detritus may include your own tests and examples creating files under `tempdir()`, child processes, or 'Python' code launched using 'reticulate'. For example, R packages that use the 'tensorflow' 'Python' package may use the following to [find and remove temporary files created by its auto-gradient feature](https://github.com/cran/vetiver/blob/35b24768cf0e84fab96610e001bba377dc777953/tests/testthat/setup.R#L13).
326326

327327
A package that uses the 'testthat' test suite will benefit from [the self-cleaning functions `withr::local_tempfile()` and `withr::local_tempdir()`](https://r-pkgs.org/testing-design.html#sec-tests-files-where-write) to work with temporary files. Even without 'testthat', the 'withr' package has no external strong dependencies and can be used independently.
328328

@@ -348,7 +348,7 @@ Please do not modify the global environment (e.g., by using <<-) in your functio
348348

349349
The `.GlobalEnv` is the main workspace of users. It can also be accessed by `globalenv()`. Writing to the global environment is forbidden for CRAN packages.
350350

351-
Sometimes package maintainers use the operator `<<-`. This operator not only evaluates the expression in the environment it is called in, checks parent environments for an existing definition of the variable. If such a variable is found then its value is redefined, otherwise assignment takes place in the `.GlobalEnv`.
351+
Sometimes package maintainers use the operator `<<-`. This operator not only evaluates the expression in the environment it is called in, but checks parent environments for an existing definition of the variable. If such a variable is found then its value is redefined, otherwise assignment takes place in the `.GlobalEnv`.
352352
To avoid writing to the global environment, the variable must be defined in a parent environment.
353353

354354
```{r eval=FALSE}
@@ -453,7 +453,7 @@ Create special functions for the purpose of installing software and don't instal
453453
### Details
454454

455455
::: {.callout-note title="CRAN Review Communication" appearance="simple" icon="false" collapse="true"}
456-
Please do not install packages in your functions, examples or vignette. This can make the functions, examples and cran-check very slow.
456+
Please do not install packages in your functions, examples or vignettes. This can make the functions, examples and CRAN-check very slow.
457457
:::
458458

459459
Packages should usually not be installed within functions, especially since dependencies should already be listed in the DESCRIPTION. For external software this is typically the same. However, if the purpose of your package is to connect to specific APIs or provides easier installation for some programs, installing software or packages is allowed on CRAN.

0 commit comments

Comments
 (0)