Grammar suggestions from @zhaoy
This commit is contained in:
parent
abb99996d8
commit
c15f6e5b57
|
@ -94,7 +94,7 @@ Every for loop has three components:
|
|||
|
||||
That's all there is to the for loop!
|
||||
Now is a good time to practice creating some basic (and not so basic) for loops using the exercises below.
|
||||
Then we'll move on some variations of the for loop that help you solve other problems that will crop up in practice.
|
||||
Then we'll move on to some variations of the for loop that help you solve other problems that will crop up in practice.
|
||||
|
||||
### Exercises
|
||||
|
||||
|
@ -285,7 +285,7 @@ This is common when doing simulations.
|
|||
For example, you might want to loop until you get three heads in a row.
|
||||
You can't do that sort of iteration with the for loop.
|
||||
Instead, you can use a while loop.
|
||||
A while loop is simpler than for loop because it only has two components, a condition and a body:
|
||||
A while loop is simpler than a for loop because it only has two components, a condition and a body:
|
||||
|
||||
```{r, eval = FALSE}
|
||||
while (condition) {
|
||||
|
@ -724,7 +724,7 @@ Purrr provides two other useful adverbs:
|
|||
## Mapping over multiple arguments
|
||||
|
||||
So far we've mapped along a single input.
|
||||
But often you have multiple related inputs that you need iterate along in parallel.
|
||||
But often you have multiple related inputs that you need to iterate along in parallel.
|
||||
That's the job of the `map2()` and `pmap()` functions.
|
||||
For example, imagine you want to simulate some random normals with different means.
|
||||
You know how to do that with `map()`:
|
||||
|
|
Loading…
Reference in New Issue