From 8d4fed1da0c1b91cbe2b6a990d94ef90531ddf9a Mon Sep 17 00:00:00 2001 From: Mitsuo Shiota <48662507+mitsuoxv@users.noreply.github.com> Date: Thu, 25 May 2023 03:59:44 +0900 Subject: [PATCH] Fix/base-R typos and Figure 28.1 pepper caption (#1494) --- base-R.qmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base-R.qmd b/base-R.qmd index d7ec69d..c4b3719 100644 --- a/base-R.qmd +++ b/base-R.qmd @@ -300,7 +300,7 @@ For this reason we sometimes joke that tibbles are lazy and surly: they do less ### Lists `[[` and `$` are also really important for working with lists, and it's important to understand how they differ from `[`. -Lets illustrate the differences with a list named `l`: +Let's illustrate the differences with a list named `l`: ```{r} l <- list( @@ -349,8 +349,8 @@ If we suppose this pepper shaker is a list called `pepper`, then `pepper[1]` is #| out-width: "100%" #| fig-cap: > #| (Left) A pepper shaker that Hadley once found in his hotel room. -#| (Middle) `pepper[1]`. -#| (Right) `pepper[[1]]` +#| (Middle) `pepper[[1]]`. +#| (Right) `pepper[[1]][[1]]` #| fig-alt: > #| Three photos. On the left is a photo of a glass pepper shaker. Instead of #| the pepper shaker containing pepper, it contains a single packet of pepper. @@ -443,7 +443,7 @@ for (element in vector) { } ``` -The most straightforward use of `for` loops is to achieve the same affect as `walk()`: call some function with a side-effect on each element of a list. +The most straightforward use of `for` loops is to achieve the same effect as `walk()`: call some function with a side-effect on each element of a list. For example, in @sec-save-database instead of using walk: ```{r}