Skip to content

Commit

Permalink
Merge pull request hadley#79 from OaCantona/patch-4
Browse files Browse the repository at this point in the history
Difference in code
  • Loading branch information
hadley committed Mar 26, 2016
2 parents 5c7cf27 + a0fb728 commit 51943e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iteration.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Every for loop has three components:
it's easy to create them accidentally. If you use `1:length(x)` instead
of `seq_along(x)`, you're likely to get a confusing error message.
1. The __body__: `output[i] <- median(df[[i]])`. This is the code that does
1. The __body__: `output[[i]] <- median(df[[i]])`. This is the code that does
the work. It's run repeatedly, each time with a different value for `i`.
The first iteration will run `output[[1]] <- median(df[[1]])`,
the second will run `output[[2]] <- median(df[[2]])`, and so on.
Expand Down

0 comments on commit 51943e6

Please sign in to comment.