Skip to content

Commit

Permalink
Update Functions.Rmd (#1722)
Browse files Browse the repository at this point in the history
minor typo fix
  • Loading branch information
chayajones authored Mar 18, 2023
1 parent b16d27b commit 418e9a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ for(i in 1:10) print(i)
`for`(i, 1:10, print(i))
```

Suprisingly, in R, `for` can be called like a regular function! The same is true for basically every operation in R, which means that knowing the function name of a non-prefix function allows you to override its behaviour. For example, if you're ever feeling particularly evil, run the following code while a friend is away from their computer. It will introduce a fun bug: 10% of the time, it will add 1 to any numeric calculation inside the parentheses.
Surprisingly, in R, `for` can be called like a regular function! The same is true for basically every operation in R, which means that knowing the function name of a non-prefix function allows you to override its behaviour. For example, if you're ever feeling particularly evil, run the following code while a friend is away from their computer. It will introduce a fun bug: 10% of the time, it will add 1 to any numeric calculation inside the parentheses.

```{r}
`(` <- function(e1) {
Expand Down

0 comments on commit 418e9a0

Please sign in to comment.