Skip to content

Commit

Permalink
updated loop slides
Browse files Browse the repository at this point in the history
  • Loading branch information
RedondoMA committed Oct 29, 2024
1 parent 9f83a3c commit 1046cd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slide_r_elements_4.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Example.

```{r for.loop, echo=T}
for (i in 1:5) {
cat(paste('Performing operation on no.', i), '\n')
print(paste('Performing operation on no.', i))
}
```

Expand All @@ -93,7 +93,7 @@ A slight modification of the above example.

```{r for.loop2, echo=T}
for (i in c(2,4,6,8,10)) {
cat(paste('Performing operation on no.', i), '\n')
print(paste('Performing operation on no.', i))
}
```
The variable `i` <u> takes values </u> from the sequences.
Expand Down

0 comments on commit 1046cd2

Please sign in to comment.