Skip to content

Commit 0c2e8ff

Browse files
authored
Merge pull request #392 from UBC-DSCI/jupyter-edits
Copyediting Jupyter Chapter
2 parents c609dfc + 812ee78 commit 0c2e8ff

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

jupyter.Rmd

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ with the text and images serving as narration for the code and its output.
1818
In this chapter we will show you how to accomplish this using Jupyter notebooks, a common coding platform in
1919
data science. Jupyter notebooks do precisely what we need: they let you combine text, images, and (executable!) code in a single
2020
document. In this chapter, we will focus on the *use* of Jupyter notebooks to program in R and write
21-
text via a web-interface.
21+
text via a web interface.
2222
These skills are essential to getting your analysis running; think of it like getting dressed in the morning!
2323
Note that we assume that you already have Jupyter set up and ready to use. If that is not the case, please first read
2424
Chapter \@ref(move-to-your-own-machine) to learn how to install and configure Jupyter on your own
2525
computer.
2626

2727
## Chapter learning objectives
2828

29-
By the end of the chapter, readers will be able to:
29+
By the end of the chapter, readers will be able to do the following:
3030

31-
- create new Jupyter notebooks
32-
- write, edit, and execute R code in a Jupyter notebook
33-
- write, edit, and view text in a Jupyter notebook
34-
- open and view plain text data files in Jupyter
35-
- export Jupyter notebooks to other standard file types (e.g., `.html`, `.pdf`)
31+
- Create new Jupyter notebooks.
32+
- Write, edit, and execute R code in a Jupyter notebook.
33+
- Write, edit, and view text in a Jupyter notebook.
34+
- Open and view plain text data files in Jupyter.
35+
- Export Jupyter notebooks to other standard file types (e.g., `.html`, `.pdf`).
3636

3737
## Jupyter
3838

@@ -42,7 +42,7 @@ documents that contain a mix of computer code (and its output) and formattable
4242
text. Given that they combine these two analysis artifacts in a single
4343
document—code is not separate from the output or written report—notebooks are
4444
one of the leading tools to create reproducible data analyses. Reproducible data
45-
analysis \index{reproducible} is one where you can reliably and easily recreate the same results when
45+
analysis \index{reproducible} is one where you can reliably and easily re-create the same results when
4646
analyzing the same data. Although this sounds like something that should always
4747
be true of any data analysis, in reality, this is not often the case; one needs
4848
to make a conscious effort to perform data analysis in a reproducible manner.
@@ -100,7 +100,7 @@ workflow typically used to ensure that your analysis runs in its entirety before
100100
sharing it with others, and when using a notebook as part of an automated
101101
process.
102102

103-
To run the a code cell independently, the cell needs to first be activated. This
103+
To run a code cell independently, the cell needs to first be activated. This
104104
is done by clicking on it with the cursor. Jupyter will indicate a cell has been
105105
activated by highlighting it with a blue rectangle to its left. After the cell
106106
has been activated (Figure \@ref(fig:activate-and-run-button)), the cell can be run by either pressing the **Run** (`r fa("play", height = "11px")`)
@@ -247,16 +247,17 @@ notebook that references `y` and execute it without error in the current session
247247
(Figure \@ref(fig:out-of-order-2)). This could also be done successfully in
248248
future sessions if, and only if, you run the cells in the same non-conventional
249249
order. However, it is difficult to remember this non-conventional order, and it
250-
is not the order that others would expect your code to be executed in. Thus in
251-
future this would lead to errors when the notebook is run in the conventional
250+
is not the order that others would expect your code to be executed in. Thus, in
251+
the future, this would lead
252+
to errors when the notebook is run in the conventional
252253
linear order (Figure \@ref(fig:out-of-order-3)).
253254

254255
```{r out-of-order-1, echo = FALSE, fig.cap = "Code that was written out of order, but not yet executed.", fig.retina = 2, out.width="100%"}
255256
image_read("img/out-of-order-1.png") |>
256257
image_crop("3632x800")
257258
```
258259

259-
```{r out-of-order-2, echo = FALSE, fig.cap = "Code that was written out of order, and was executed using the run button in a nonlinear error without error. The order of execution can be traced by following the numbers to the left of the code cells; their order indicates the order in which the cells were executed.", fig.retina = 2, out.width="100%"}
260+
```{r out-of-order-2, echo = FALSE, fig.cap = "Code that was written out of order, and was executed using the run button in a nonlinear order without error. The order of execution can be traced by following the numbers to the left of the code cells; their order indicates the order in which the cells were executed.", fig.retina = 2, out.width="100%"}
260261
image_read("img/out-of-order-2.png") |>
261262
image_crop("3632x800")
262263
```
@@ -404,8 +405,9 @@ image_read("img/launcher-annotated.png") |>
404405

405406
Once you have created a new Jupyter notebook, be sure to give it a descriptive
406407
name, as the default file name is `Untitled.ipynb`. You can rename files by
407-
right-clicking on the file name of the Jupyter notebook you just created and
408-
click **Rename**. This will make the file name editable. Use your keyboard to
408+
first right-clicking on the file name of the notebook you just created, and
409+
then clicking **Rename**. This will make
410+
the file name editable. Use your keyboard to
409411
change the name. Pressing `Enter` or clicking anywhere else in the Jupyter
410412
interface will save the changed file name.
411413

0 commit comments

Comments
 (0)