Skip to content

Commit b80d8ee

Browse files
Merge pull request #90 from richpauloo/fix-ch4-typos
fix small typos in ch4
2 parents d87615d + 8eb7869 commit b80d8ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

book/04.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ $ bash book/ch04/top-words-1.sh
110110
1778 of
111111
```
112112

113-
This already saves us from typing the one-liner. Because the file cannot be executed on its own, we cannot really speak of a true command-line tool, yet. Let us change that in the next step.
113+
This already saves us from typing the one-liner. Because the file cannot be executed on its own, it is not yet a true command-line tool. Let us change that in the next step.
114114

115115
### Step 2: Add Permission to Execute
116116

@@ -303,7 +303,7 @@ Example
303303

304304
And in R, the code would look something like Example \@ref(exm:top-words-5) (thanks to Hadley Wickham):
305305

306-
```{example top-words-5, name="~/book/ch04/top-words-1.R"}
306+
```{example top-words-5, name="~/book/ch04/top-words.R"}
307307
```
308308
```{r, eval=FALSE}
309309
#!/usr/bin/env Rscript
@@ -346,7 +346,7 @@ First, what’s immediately obvious is the difference in amount of code. For thi
346346

347347
### Processing Streaming Data from Standard Input
348348

349-
In the previous two code snippets, both Python R read the complete standard input at once. On the command line, most command-line tools pipe data to the next command-line tool in a streaming fashion. (There are a few command-line tools which require the complete data before they write any data to standard output, like `sort` and `awk` [@awk].) This means the pipeline is blocked by such command-line tools. This does not have to be a problem when the input data is finite, like a file. However, when the input data is a non-stop stream, such blocking command-line tools are useless.
349+
In the previous two code snippets, both Python and R read the complete standard input at once. On the command line, most command-line tools pipe data to the next command-line tool in a streaming fashion. (There are a few command-line tools which require the complete data before they write any data to standard output, like `sort` and `awk` [@awk].) This means the pipeline is blocked by such command-line tools. This does not have to be a problem when the input data is finite, like a file. However, when the input data is a non-stop stream, such blocking command-line tools are useless.
350350

351351
Luckily Python and R support processing streaming data. You can apply a function on a line-per-line basis, for example. Example \@ref(exm:stream-py) and Example \@ref(exm:stream-r) are two minimal examples that demonstrate how this works in Python and R, respectively.
352352

0 commit comments

Comments
 (0)