Skip to content

Commit

Permalink
Mention assert_no_globals()
Browse files Browse the repository at this point in the history
  • Loading branch information
richardreeve committed Dec 7, 2022
1 parent cd24ec8 commit a797184
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: RPiR
Type: Package
Title: Reproducible Programming in R
Version: 0.76.21
Version: 0.76.22
Authors@R: c(person("Sonia", "Mitchell", email = "[email protected]",
role = c("aut"),
comment = c(ORCID = "0000-0003-1536-2066")),
Expand Down
17 changes: 16 additions & 1 deletion inst/tutorials/practical3-1/practical3-1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,22 @@ For Practical 3-2 you'll need to add a function called
with appropriate documentation. Copy the
<span style="color: #dd1c77;">step_deterministic_birth_death</span> function for
the time being, renamed of course. You'll be using this as a starting point in
Practical 3-2.
Practical 3-2. You can also add a check that the functions use no
global variables to the function definitions by adding a check at
the bottom of the file after the end of the function.:

```{r, eval = FALSE}
}
# Check for global variables
RPiR::assert_no_globals(timestep_stochastic_birth_death)
```

We've provided a new function in the RPiR package to do the checking for
you (`assert_no_globals()`) to make this simpler than it was in Series 2.
You can just type `assert_no_globals` without the brackets to read the function
definition and see that it is very similar to the code snippet we got you to
use before.

### 2. Add a demo
Now create a new R script called
Expand Down

0 comments on commit a797184

Please sign in to comment.